2019-12-02适合做滑动页面的广告业的banner

BGABanner-Android

github的地址:

https://github.com/bingoogolapple/BGABanner-Android

引导界面滑动导航 + 大于等于1页时无限轮播 + 各种切换动画轮播效果

用法简介:
androidX:
dependencies {
implementation 'androidx.legacy:legacy-support-v4:latestVersion'
implementation 'cn.bingoogolapple:bga-banner:latestVersion@aar'
}
非安卓X:

implementation cn.bingoogolapple:bga-banner:2.2.7@aar

android:id="@+id/banner"
android:layout_width="fill_parent"
android:layout_height="200dp"
app:banner_indicatorGravity="center_horizontal"
app:banner_pageChangeDuration="7000"
app:banner_pointContainerBackground="#00000000"
app:banner_pointDrawable="@drawable/banner_selector_point_bg"
app:banner_pointTopBottomMargin="10dp"
app:banner_tipTextSize="13sp"
app:banner_transitionEffect="cube"
/>
设置默认的滑动方式
mBanner.setTransitionEffect(TransitionEffect.Default);
设置加载image
mBanner.setAdapter((BGABanner.Adapter) (banner, itemView, model, position) -> {
Glide.with(getActivity())
.load(model.getTitle_img())
.apply(new RequestOptions().dontAnimate().centerCrop())
.into(itemView);
});

获取数据,接收数据,设置进去
if (null != bannerEntity && bannerEntity.size() > 0) {
mBanner.setData(bannerEntity, null);
}

你可能感兴趣的:(2019-12-02适合做滑动页面的广告业的banner)