Android ViewPager with bottom dots

No need for that much code. You can do all this stuff without coding so much by using only viewpager with tablayout. Your main Layout: <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” android:layout_width=”match_parent” android:layout_height=”wrap_content”> <android.support.v4.view.ViewPager android:id=”@+id/pager” android:layout_width=”match_parent” android:layout_height=”match_parent”> </android.support.v4.view.ViewPager> <android.support.design.widget.TabLayout android:id=”@+id/tabDots” android:layout_alignParentBottom=”true” android:layout_width=”match_parent” android:layout_height=”wrap_content” app:tabBackground=”@drawable/tab_selector” app:tabGravity=”center” app:tabIndicatorHeight=”0dp”/> </RelativeLayout> Hook up your UI elements inactivity or fragment as follows: Java … Read more