Skip to content

Commit

Permalink
Added example of default indicators
Browse files Browse the repository at this point in the history
  • Loading branch information
vontell committed Jul 28, 2016
1 parent 139677b commit 0e4413d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_main);

// EXAMPLE WITH BASIC DRAWABLE RESOURCES ---------------------------------------------------
// INCLUDES PROGRESS STYLE -----------------------------------------------------------------

// Grab the views
ViewPager viewPager = (ViewPager) findViewById(R.id.view_pager_one);
Expand All @@ -42,9 +43,24 @@ protected void onCreate(Bundle savedInstanceState) {
indicatorContainer,
selectedImage,
unselectedImage);

// Set whether you want a progress style
sample.setProgressStyle(true);

// EXAMPLE WITHOUT PROGRESS STYLE ----------------------------------------------------------

LinearLayout indicatorContainerDefault = (LinearLayout) findViewById(R.id.indicator_default);

// Bind the view pager to the indicatorContainer
IndicatorBinder defaultInd = new IndicatorBinder().bind(this,
viewPager,
indicatorContainerDefault,
selectedImage,
unselectedImage);

// Set whether you want a progress style
defaultInd.setProgressStyle(false);

// EXAMPLE WITH TABS -----------------------------------------------------------------------

// Create each tab TextView
Expand Down
18 changes: 15 additions & 3 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,25 @@
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_below="@+id/view_pager_one"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"
android:gravity="center_horizontal"
android:id="@+id/indicator_cont">
android:id="@+id/indicator_cont"
android:layout_below="@+id/indicator_default"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">

</LinearLayout>

<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="30dp"
android:id="@+id/indicator_default"
android:layout_marginTop="8dp"
android:layout_below="@+id/view_pager_one"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:gravity="center_horizontal"></LinearLayout>


</RelativeLayout>

0 comments on commit 0e4413d

Please sign in to comment.