Comments (3)
onPageSelected中使用for循环来改变指示点效率比较低,用一个标记位来记录上次的指示点,这样只用改变两个指示点就行了
声明局部变量用来记录上一次改变的指示点位置
private int lastPosition=1;
onPageSelected中的for循环替换为
indicatorImages.get((lastPosition - 1+indicatorImages.size())%indicatorImages.size()).setImageResource(mIndicatorUnselectedResId);
indicatorImages.get((position - 1+indicatorImages.size())%indicatorImages.size()).setImageResource(mIndicatorSelectedResId);
lastPosition=position;
from banner.
ok,thank you!
from banner.
已修改提交,非常感谢你的反馈!
from banner.
Related Issues (20)
- 我想让第一个图片变大,不是中间的变大,应该怎么实现,能不能告知下,跪求 就是把第二张图片的效果放到第一张展示 HOT 2
- banner添加新数据时,获取真实坐标报错
- Gallery 刷新数据时 显示第一个显示异常
- notifyDataSetChanged 导致 viewPager2 ScaleInTransformer 错乱问题 HOT 2
- 我想问下咱这个viewpage2的库在viewbinding中怎么传递这个范型
- indicator指示器数量超过一屏时两端被截断,没有做指示器自动滑动
- 第二张没有预加载出来,需要手动滑出来才行
- 画廊效果中间显示的那张图片,pageMargin设为0,依然跟左右的小图还有很大的边距
- 竖向轮播加轮播效果很奇怪
- 用Media3中的exoPlayer和SurfaceView播放视频,会没有画面只有声音怎么办? HOT 1
- 代码如何单独设置是否允许无限轮播。
- 作者跑路了嘛???
- 如何混淆代码
- string.xml中带有中文文本
- 博主你好,我是一个小白用了你的开源,功能很完善很好用,给你点个赞。
- 无线循环轮播问题
- 轮播多超过8张照片会有问题
- OnPageChangeListener 为何一直调用
- 缺少android.useAndroidX=true配置以及 AndroidManifest 缺少 android:exported="true", 编译失败
- 画廊和魅族效果问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from banner.