Skip to content

开始时最左边变大,滑动时中间变大,最后时右边变大

Notifications You must be signed in to change notification settings

Alzzzz/ScaleBanner

Repository files navigation

ScaleBanner

基于RecycleView编写的左右滑动ViewPager,与其他ViewPager不同的是,第一个和最后一个item靠边放大,其他的中间放大。

样式展示

最前面的的样式

中间的样式

最后面的样式

使用方式

1、RecyclerView使用HouseScaleLayoutManager

    HouseScaleLayoutManager layoutManager = new HouseScaleLayoutManager
            .Builder(this, 0)
            .build();
    layoutManager.setOrientation(CardScaleLayoutManager.HORIZONTAL);
    layoutManager.setInfinite(false);
    recyclerView.setLayoutManager(layoutManager);

2、滑动绑定,使用HouseBannerSnapHelper绑定RecyclerView

    HouseBannerSnapHelper pagerSnapHelper = new HouseBannerSnapHelper();
    pagerSnapHelper.attachToRecyclerView(recyclerView);

3、绑定Adapter,自定义View的样式

    HouseBannerSnapHelper pagerSnapHelper = new HouseBannerSnapHelper();
    pagerSnapHelper.attachToRecyclerView(recyclerView);

引用方式

maven引入方式:

    <dependency>
      <groupId>com.alzzz</groupId>
      <artifactId>scalemanagerlib</artifactId>
      <version>1.0.0</version>
      <type>pom</type>
    </dependency>

gradle引入方式:

    implementation 'com.alzzz:scalemanagerlib:1.0.0'

About

开始时最左边变大,滑动时中间变大,最后时右边变大

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages