Skip to content

Commit

Permalink
update sample
Browse files Browse the repository at this point in the history
  • Loading branch information
zhpanvip committed May 29, 2021
1 parent 2a8a8f5 commit ea2a87f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected void initView(Bundle savedInstanceState, @NonNull View view) {
mViewPager.setIndicatorSliderGap(BannerUtils.dp2px(6))
.setIndicatorView(mIndicatorView)
.setLifecycleRegistry(getLifecycle())
.setRoundCorner(BannerUtils.dp2px(36), 0, 0, BannerUtils.dp2px(36))
.setRoundCorner(getResources().getDimensionPixelOffset(R.dimen.dp_10))
.setOnPageClickListener((clickedView, position) -> {
ToastUtils.showShort("position:" + position);
int currentItem = mViewPager.getCurrentItem();
Expand All @@ -98,11 +98,20 @@ private void initRadioGroup() {
setDrawableIndicator(getDrawableIndicator());
} else if (checkedId == R.id.rb_vector_drawable) {
setDrawableIndicator(getVectorDrawableIndicator());
} else if (checkedId == R.id.rb_round_corner) {
setRoundCorner();
}
});
radioButton.performClick();
}

private void setRoundCorner() {
int dp36 = getResources().getDimensionPixelOffset(R.dimen.dp_36);
mViewPager
.setRoundCorner(dp36, 0, 0, dp36)
.refreshData(getPicList(4));
}

private void setDrawableIndicator(IIndicator indicator) {
mIndicatorView.setVisibility(View.INVISIBLE);
mViewPager
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/layout/fragment_others.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@
android:text="Drawable Indicator(VectorDrawable)"
android:textSize="@dimen/sp_16" />

<RadioButton
android:id="@+id/rb_round_corner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_10"
android:layout_marginEnd="15dp"
android:text="Round Corner"
android:textSize="@dimen/sp_16" />

</RadioGroup>

<TextView
Expand Down

0 comments on commit ea2a87f

Please sign in to comment.