Skip to content

Commit

Permalink
Try to fix issue #291
Browse files Browse the repository at this point in the history
  • Loading branch information
zhpanvip committed Feb 11, 2023
1 parent ac87d35 commit 64807fc
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,8 @@ private void initRevealWidth(BannerOptions bannerOptions) {
int orientation = bannerOptions.getOrientation();
int padding2 = bannerOptions.getPageMargin() + rightRevealWidth;
int padding1 = bannerOptions.getPageMargin() + leftRevealWidth;
if (padding1 < 0) padding1 = 0;
if (padding2 < 0) padding2 = 0;
if (orientation == ViewPager2.ORIENTATION_HORIZONTAL) {
recyclerView.setPadding(padding1, 0, padding2, 0);
} else if (orientation == ViewPager2.ORIENTATION_VERTICAL) {
Expand Down

0 comments on commit 64807fc

Please sign in to comment.