没有录制动态效果图….. XBanner 参考地址https://github.com/xiaohaibin/XBanner 1 效果图

2 依赖
allprojects { repositories { ... maven { url 'https://jitpack.io' } } } dependencies { implementation 'com.github.xiaohaibin:XBanner:1.6.1' implementation 'com.github.bumptech.glide:glide:4.9.0' }3 布局
<com.stx.xhb.xbanner.XBanner android:id="@+id/banner" android:layout_width="match_parent" android:layout_height="300dp" android:clipChildren="false" app:AutoPlayTime="3000" app:clipChildrenLeftRightMargin="20dp" app:isClipChildrenMode="true" app:isShowNumberIndicator="false" app:pointsVisibility="false"></com.stx.xhb.xbanner.XBanner> <!--AutoPlayTime 图片轮播时间间隔--> <!--tipTextSize 提示文案的文字大小--> <!--isClipChildrenMode 是否开启一屏显示多个模式--> <!--pointsVisibility 是否显示指示器--> <!--clipChildrenLeftRightMargin 一屏显示多个左右间距--> 4 设置图片集合
package com.example.myapplication; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import com.bumptech.glide.Glide; import com.bumptech.glide.load.resource.bitmap.RoundedCorners; import com.bumptech.glide.request.RequestOptions; import com.stx.xhb.xbanner.XBanner; import com.stx.xhb.xbanner.transformers.Transformer; import java.util.ArrayList; import java.util.List; public class MainActivity extends AppCompatActivity { private XBanner banner; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); banner = findViewById(R.id.banner); List<String> list2 = new ArrayList<>(); for (int i = 0; i < 7; i++) { list2.add("https://file.alapi.cn/image/comic/215610-154116697054cd.jpg"); } banner.setData(list2, null); banner.loadImage(new XBanner.XBannerAdapter() { @Override public void loadBanner(XBanner banner, Object model, View view, int position) { //设置图片圆角角度 RoundedCorners roundedCorners = new RoundedCorners(20); //通过RequestOptions扩展功能,override:采样率,因为ImageView就这么大,可以压缩图片,降低内存消耗 // RequestOptions options = RequestOptions.bitmapTransform(roundedCorners).override(300, 300); RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); Glide.with(MainActivity.this).load(list2.get(position)).apply(options).into((ImageView) view); } }); banner.setPageTransformer(Transformer.Default); } }
本网页所有视频内容由 imoviebox边看边下-网页视频下载, iurlBox网页地址收藏管理器 下载并得到。
ImovieBox网页视频下载器 下载地址: ImovieBox网页视频下载器-最新版本下载
本文章由: imapbox邮箱云存储,邮箱网盘,ImageBox 图片批量下载器,网页图片批量下载专家,网页图片批量下载器,获取到文章图片,imoviebox网页视频批量下载器,下载视频内容,为您提供.
阅读和此文章类似的: 全球云计算
官方软件产品操作指南 (170)