Skip to content

Commit

Permalink
update sample.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhpanvip committed Oct 18, 2020
1 parent 3f39309 commit 397156c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 22 deletions.
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public class FigureIndicatorView extends BaseIndicatorView {
}
}
```
#### (2)User custom indicator with ViewPager/ViewPager2
#### (2)Use custom indicator with ViewPager/ViewPager2

```
val indicatorView = findViewById<FigureIndicatorView>(R.id.indicator_view)
Expand All @@ -239,11 +239,6 @@ public class FigureIndicatorView extends BaseIndicatorView {

![QQ交流群60902509](https://github.com/zhpanvip/Resource/blob/master/image/group/qq_group.png)


## <span id="Sponsor"> Sponsor </span>

**如果您觉得BannerViewPager库还不错,帮您省了不少时间,可以点击Star表示对作者的支持,也可以扫描二维码请作者喝杯咖啡。**

| Alipay | WeChat |
|--|--|
| ![NORMAL](https://github.com/zhpanvip/Resource/blob/master/image/pay/pay_alipay.jpg) | ![SMOOTH](https://github.com/zhpanvip/Resource/blob/master/image/pay/pay_wechat.png) |
Expand Down
7 changes: 0 additions & 7 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,6 @@ public class FigureIndicatorView extends BaseIndicatorView {

## <span id="Sponsor"> Sponsor </span>

**如果您觉得BannerViewPager库还不错,帮您省了不少时间,可以点击Star表示对作者的支持,也可以扫描二维码请作者喝杯咖啡。**

| Alipay | WeChat |
|--|--|
| ![NORMAL](https://github.com/zhpanvip/Resource/blob/master/image/banner/style_custum.gif) |


## 更多详情

[《聊一聊ViewPagerIndicator重构的一些经验》](https://juejin.im/post/5dda0b6d518825731f569a8c)
Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ open class MainActivity : BaseDataActivity() {
val dp20 = resources.getDimensionPixelOffset(R.dimen.dp_20)
view_pager2.adapter = ViewPager2Adapter(getData(4))

figureIndicator.setRadius(IndicatorUtils.dp2px(15f))
figureIndicator.setTextSize(IndicatorUtils.dp2px(12f))
figureIndicator.setRadius(resources.getDimensionPixelOffset(R.dimen.dp_20))
figureIndicator.setTextSize(resources.getDimensionPixelSize(R.dimen.dp_16))
.setupWithViewPager(view_pager2)
figureIndicator.setBackgroundColor(Color.parseColor("#aa118EEA"))
normalColor = getResColor(R.color.red_normal_color)
Expand Down Expand Up @@ -112,7 +112,7 @@ open class MainActivity : BaseDataActivity() {
indicatorView.setIndicatorStyle(IndicatorStyle.ROUND_RECT)
.setSliderGap(IndicatorUtils.dp2px(4f).toFloat())
.setSlideMode(mSlideMode)
.setSliderHeight(resources.getDimensionPixelOffset(R.dimen.dp_4).toFloat())
.setSliderHeight(resources.getDimensionPixelOffset(R.dimen.dp_6).toFloat())
.setSliderColor(normalColor, checkedColor)
.setSliderWidth(normalWidth, checkedWidth)
indicatorView.notifyDataChanged()
Expand Down
12 changes: 6 additions & 6 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text="(Bitmap Drawable)"
android:text="Bitmap"
android:layout_centerHorizontal="true"
android:textColor="#FFFFFF" />
</RelativeLayout>

Expand All @@ -58,8 +59,6 @@
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginStart="@dimen/dp_10"
android:layout_toEndOf="@id/rl_bitmap"
android:orientation="vertical">

<com.zhpan.indicator.DrawableIndicator
Expand All @@ -71,8 +70,9 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:text="(Vector Drawable)"
android:text="Vector"
android:textColor="#FFFFFF" />
</RelativeLayout>

Expand All @@ -88,13 +88,13 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_5" />
android:layout_marginTop="@dimen/dp_10"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text="(Custom)"
android:text="Custom"
android:textColor="#FFFFFF" />

</RelativeLayout>
Expand Down

0 comments on commit 397156c

Please sign in to comment.