PageIndicatorView底部点显示

来源:互联网 发布:caroemerald 知乎 编辑:程序博客网 时间:2024/04/28 18:51

1、依赖包:
compile 'com.romandanylyk:pageindicatorview:X.X.X'

If your project already use appcompat-v7 support library, you can omit PageIndicatorView dependencies by adding a single .aar file to your project, that will decrease total amount of methods used in your project.

compile 'com.romandanylyk:pageindicatorview:X.X.X@aar'

Keep in mind, that PageIndicatorView has min API level 14 and these dependencies:

 compile 'com.android.support:support-annotations:25.3.0' compile 'com.android.support:support-compat:25.3.0' compile 'com.android.support:support-core-ui:25.3.0'
2、代码中

ViewPager viewPager = (ViewPager) findViewById(R.id.viewPager);viewPager.setAdapter(adapter);//instance of android.support.v4.view.PagerAdapter adapterPageIndicatorView pageIndicatorView = (PageIndicatorView) view.findViewById(R.id.pageIndicatorView);pageIndicatorView.setViewPager(viewPager);
3、布局中
 <com.rd.PageIndicatorView        android:id="@+id/pageIndicatorView"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        attrs:piv_viewPager="@+id/viewPager"/>


NameSupport versionPreviewAnimationType.NONE0.0.1anim_noneAnimationType.COLOR0.0.1anim_colorAnimationType.SCALE0.0.1anim_scaleAnimationType.SLIDE0.0.1anim_slideAnimationType.WORM0.0.1anim_wormAnimationType.FILL0.0.6anim_wormAnimationType.THIN_WORM0.0.7anim_thin_wormAnimationType.DROP0.1.0anim_dropAnimationType.SWAP0.1.1


anim_swap

github地址:https://github.com/romandanylyk/PageIndicatorView