Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial Indicator and other unused Dependencies removed #285

Merged
merged 1 commit into from
Dec 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions source-code/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ android {
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
Expand All @@ -60,18 +59,15 @@ dependencies {
compile('com.crashlytics.sdk.android:crashlytics:2.3.1@aar') {
transitive = true;
}
compile files('libs/core-1.51.0.0.jar')
compile files('libs/prov-1.51.0.0.jar')
compile files('libs/zipio-lib-1.8.jar')

compile files('libs/zipsigner-lib-1.17.jar')
compile files('libs/zipsigner-lib-optional-1.16.jar')
compile files('libs/pkix-1.51.0.0.jar')
compile files('libs/kellinwood-logging-android-1.4.jar')
compile files('libs/kellinwood-logging-lib-1.1.jar')
compile files('libs/kellinwood-logging-log4j-1.0.jar')
compile files('libs/axml.jar')
compile 'com.viewpagerindicator:library:2.4.1@aar'
compile 'com.nineoldandroids:library:2.4.0'


compile 'com.squareup.picasso:picasso:2.5.2'
compile 'org.jsoup:jsoup:1.9.1'
androidTestCompile 'com.android.support:support-annotations:23.4.0'
Expand Down
Binary file removed source-code/app/libs/core-1.51.0.0.jar
Binary file not shown.
Binary file removed source-code/app/libs/pkix-1.51.0.0.jar
Binary file not shown.
Binary file removed source-code/app/libs/prov-1.51.0.0.jar
Binary file not shown.
Binary file removed source-code/app/libs/zipio-lib-1.8.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,26 @@
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.text.Html;
import android.util.TypedValue;

import android.widget.LinearLayout;
import android.widget.TextView;

import com.viewpagerindicator.CirclePageIndicator;

import org.buildmlearn.toolkit.R;
import org.buildmlearn.toolkit.adapter.TutorialAdapter;
import org.buildmlearn.toolkit.constant.Constants;
import org.buildmlearn.toolkit.model.Tutorial;

/**
* @brief Shows the tutorial related to BuildmLearn toolkit usage.
*/
public class TutorialActivity extends AppCompatActivity {


private LinearLayout indicatingDotsContainer;

/**
* {@inheritDoc}
*/
Expand All @@ -27,14 +35,57 @@ protected void onCreate(Bundle savedInstanceState) {

ViewPager mPager = (ViewPager) findViewById(R.id.pager);
// mPager.setAdapter(mAdapter);
indicatingDotsContainer = (LinearLayout) findViewById(R.id.layoutDots);
addBottomDots(0); //adds indicating dots to given slide i.e current slide

assert mPager != null;
mPager.setAdapter(mAdapter);
mPager.addOnPageChangeListener(viewPagerPageChangeListener);
}

private void addBottomDots(int current_slide) {
TextView[] dots = new TextView[Tutorial.values().length];
int dot_colorActive = getResources().getColor(R.color.selected_dot);

CirclePageIndicator mIndicator = (CirclePageIndicator) findViewById(R.id.indicator);
assert mIndicator != null;
mIndicator.setViewPager(mPager);
indicatingDotsContainer.removeAllViews();

//number of dots added to container equals number of slides
for (int i = 0; i < dots.length; i++) {
dots[i] = new TextView(this);
dots[i].setText(Html.fromHtml("&#9675;"));
dots[i].setTextSize(TypedValue.COMPLEX_UNIT_SP,15);
indicatingDotsContainer.addView(dots[i]);
}

//dot corresponding to current slide is given active color i.e white color
if (dots.length > 0) {
dots[current_slide].setTextColor(dot_colorActive);
dots[current_slide].setText(Html.fromHtml("&#8226;"));
dots[current_slide].setTextSize(TypedValue.COMPLEX_UNIT_SP,32);
}
}

}
ViewPager.OnPageChangeListener viewPagerPageChangeListener = new ViewPager.OnPageChangeListener() {


@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
//do nothing

}

//invoked when slide is changed
@Override
public void onPageSelected(int position) {
addBottomDots(position);
}

@Override
public void onPageScrollStateChanged(int state) {

//do nothing
}


};
}
11 changes: 8 additions & 3 deletions source-code/app/src/main/res/layout/activity_tutorial.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />

<com.viewpagerindicator.CirclePageIndicator
android:id="@+id/indicator"

<LinearLayout
android:id="@+id/layoutDots"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:padding="10dip" />
></LinearLayout>
</RelativeLayout>
5 changes: 2 additions & 3 deletions source-code/app/src/main/res/layout/tutorial_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
android:padding="16dp"
android:text="@string/screen_1_title"
android:textSize="@dimen/headline" />



<ImageView
android:id="@+id/device_image"
android:layout_width="wrap_content"
Expand All @@ -26,7 +25,7 @@
android:scaleType="centerInside" />

<Button
android:text="Skip tutorial."
android:text="Skip Tutorial"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
1 change: 1 addition & 0 deletions source-code/app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@
<color name="colorPrimary_spell">#26C6DA</color>
<color name="colorPrimaryDark_spell">#00BCD4</color>
<color name="colorAccent_spell">#3F99A9</color>
<color name="selected_dot">#FFFFFF</color>

</resources>