Skip to content

Commit f14d3e6

Browse files
committed
添加查看图片指示器
1 parent 5879f22 commit f14d3e6

2 files changed

Lines changed: 27 additions & 3 deletions

File tree

diycode-app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ dependencies {
5858
compile 'com.github.bumptech.glide:glide:3.7.0'
5959
compile 'com.github.gcssloop:ViewSupport:v1.3.0'
6060
compile 'com.bm.photoview:library:1.4.1'
61+
compile 'com.romandanylyk:pageindicatorview:0.1.2@aar'
6162
compile project(':diycode-sdk')
6263
compile project(':expectanim')
6364

diycode-app/src/main/res/layout/activity_image.xml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<LinearLayout
2525
xmlns:android="http://schemas.android.com/apk/res/android"
2626
xmlns:tools="http://schemas.android.com/tools"
27+
xmlns:app="http://schemas.android.com/apk/res-auto"
2728
android:id="@+id/activity_image"
2829
android:layout_width="match_parent"
2930
android:layout_height="match_parent"
@@ -35,9 +36,31 @@
3536
android:layout_width="match_parent"
3637
android:layout_height="wrap_content"/>
3738

38-
<android.support.v4.view.ViewPager
39-
android:id="@+id/view_pager"
39+
<RelativeLayout
4040
android:layout_width="match_parent"
4141
android:layout_height="match_parent">
42-
</android.support.v4.view.ViewPager>
42+
43+
<android.support.v4.view.ViewPager
44+
android:id="@+id/view_pager"
45+
android:layout_width="match_parent"
46+
android:layout_height="match_parent">
47+
</android.support.v4.view.ViewPager>
48+
49+
<com.rd.PageIndicatorView
50+
android:id="@+id/pageIndicator"
51+
android:layout_marginBottom="16dp"
52+
android:layout_centerHorizontal="true"
53+
android:layout_alignParentBottom="true"
54+
android:layout_width="wrap_content"
55+
android:layout_height="wrap_content"
56+
app:piv_viewPager="@id/view_pager"
57+
app:piv_animationType="worm"
58+
app:piv_autoVisibility="false"
59+
app:piv_radius="4dp"
60+
app:piv_padding="12dp"
61+
app:piv_unselectedColor="@color/diy_gray2"
62+
app:piv_selectedColor="@color/diy_red"
63+
/>
64+
</RelativeLayout>
65+
4366
</LinearLayout>

0 commit comments

Comments
 (0)