h07000223 / flycobanner_master Goto Github PK
View Code? Open in Web Editor NEWAn android view looper library. Support for Android 2.2 and up.
License: MIT License
An android view looper library. Support for Android 2.2 and up.
License: MIT License
如果新设置进去的list长度比原来的list短,而且当时的position要大于现在的list长度,程序在回调onTitleSlect
函数时就会发生异常:
java.lang.IndexOutOfBoundsException: Invalid index 1, size is 1
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
at java.util.ArrayList.get(ArrayList.java:308)
at com.yunwang.yunwang.view.SimpleImageBanner.onTitleSlect(SimpleImageBanner.java:43)
at com.flyco.banner.widget.Banner.base.BaseBanner.startScroll(BaseBanner.java:361)
我觉得这个事情不应该由使用者进行判断,程序应该在public T setSource(List<E> list)
中重置一下currentPositon
我只能想到通过控制View事件转发机制才能做到, 但是这个需要自定义重写ViewPager类, 能否提供一个可以使用自定义ViewPager的方法, 或者提交一个我自己修改后的PR?
或者有其它办法?
Caused by: java.lang.ArithmeticException: divide by zero
2 at com.flyco.banner.widget.Banner.base.BaseBanner$2.onPageSelected(BaseBanner.java:333)
3 at com.flyco.banner.widget.LoopViewPager.LoopViewPager$1.onPageSelected(LoopViewPager.java:142)
4 at android.support.v4.view.ViewPager.dispatchOnPageSelected(ViewPager.java:1967)
5 at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:664)
6 at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:630)
7 at android.support.v4.view.ViewPager.setCurrentItem(ViewPager.java:622)
8 at com.flyco.banner.widget.LoopViewPager.LoopViewPager.setCurrentItem(LoopViewPager.java:70)
9 at com.flyco.banner.widget.LoopViewPager.LoopViewPager.setCurrentItem(LoopViewPager.java:76)
10 at com.flyco.banner.widget.Banner.base.BaseBanner.scrollToNextItem(BaseBanner.java:291)
11 at com.flyco.banner.widget.Banner.base.BaseBanner.access$000(BaseBanner.java:35)
12 at com.flyco.banner.widget.Banner.base.BaseBanner$1.handleMessage(BaseBanner.java:83)
13 at android.os.Handler.dispatchMessage(Handler.java:111)
14 at android.os.Looper.loop(Looper.java:210)
15 at android.app.ActivityThread.main(ActivityThread.java:5809)
16 at java.lang.reflect.Method.invoke(Native Method)
17 at java.lang.reflect.Method.invoke(Method.java:372)
18 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1113)
19 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:879)
怎么刷新啊,好像刷新不了
在2.3.6的三星机器上,轮播图无法手动滑动
在6.0上图片轮播显示貌似有个padding,在4.x上ok!不知为何
This Banner is a good lib, but if i put this into a SwipeRefreshLayout
, there will be a trouble: whenever I'm going to swipe left / right to switch between pages the scrolling is too sensitive.
So I need to solve this bug by adding a PageChangListener
to the ViewPager
, but this will case a crash, even I do nothing in PageChangeListener
.
This is the code I add in SimpleImageBanner:
public void setSwipeRefresh(final SwipeRefreshLayout swipeRefreshLayout) {
vp.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
}
@Override
public void onPageScrollStateChanged(int state) {
swipeRefreshLayout.setEnabled(state == ViewPager.SCROLL_STATE_IDLE );
}
});
}
and the crash log:
java.lang.NullPointerException
at com.flyco.banner.widget.LoopViewPager.LoopViewPager$1.onPageScrolled(LoopViewPager.java:166)
at android.support.v4.view.ViewPager.dispatchOnPageScrolled(ViewPager.java:1777)
at android.support.v4.view.ViewPager.onPageScrolled(ViewPager.java:1750)
at android.support.v4.view.ViewPager.pageScrolled(ViewPager.java:1671)
at android.support.v4.view.ViewPager.scrollToItem(ViewPager.java:577)
at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1638)
at android.view.View.layout(View.java:14849)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1055)
at android.view.View.layout(View.java:14849)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
at android.view.View.layout(View.java:14849)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.widget.ScrollView.onLayout(ScrollView.java:1468)
at android.view.View.layout(View.java:14849)
Is there anyway I can addOnPageChangeListener
to the ViewPager
?
数据改变了 又调用setSource吗
java.lang.IllegalStateException: The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDataSetChanged! Expected adapter item count: 7, found: 5 Pager id: ffffffff Pager class: class com.flyco.banner.widget.LoopViewPager.LoopViewPager Problematic adapter: class com.flyco.banner.widget.LoopViewPager.LoopPagerAdapterWrapper
这个库性能有点问题,不建议直接使用
有内存泄漏问题
How to set the indicator's distance from the bottom
i can't show my layout in page, current show only image?
Plz help me.
首先,这个库真的很牛,但是我遇到一个问题我将banner的 android:clipChildren="false",android:layerType="software",viewpager也设置 android:clipChildren="false" ,但是还不能出现gallery效果,求指点
不让Indicator和不让滚动都可以通过属性做到, 但是唯独没有看到禁止用手去滑动该图片的事件啊, 就是说还是可以滑动, 由办法能解决这个问题吗?
引导员滚动到最后一个时,如何监听。现在是点击“立即体验”来实现页面切换的。能否像viewpager一样,直接滑动切换
我用了300*750的图片,可是显示图片不完整
#104 java.lang.IllegalArgumentException
pointerIndex out of range
com.flyco.banner.widget.Banner.base.BaseBanner.dispatchTouchEvent(BaseBanner.java:431)
dispatchTouchEvent 里面建议try下
第一次加载图片加载出来之前会显示一个黑框,这个是什么原因造成的?该怎么解决呢?
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.flyco.bannersamples.banner.SimpleImageBanner" on path: DexPathList[dexElements=[zip file "/data/app/com.hn481.tianhui.ky.ui-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.hn481.tianhui.ky.ui-1, /vendor/lib, /system/lib]]
请问这个是什么原因引起的
BaseBanner 里
protected Context context;
我在使用过程中发现跳转SimpleGuideBanner界面时会出现一闪而过的空白。这个可以解决吗
怎么办?
I dont know how to set banner height. please help me
Caused by: java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. Make sure your adapter calls notifyDataSetChanged() when its content changes. [in ListView(2131492870, class android.widget.ListView) with Adapter(class com.by.czw.adapter.LotteryDetailNormalAdapter)]
2 at android.widget.ListView.layoutChildren(ListView.java:1582)
3 at android.widget.AbsListView.onLayout(AbsListView.java:2190)
4 at android.view.View.layout(View.java:16707)
5 at android.view.ViewGroup.layout(ViewGroup.java:5476)
6 at com.aspsine.swipetoloadlayout.SwipeToLoadLayout.layoutChildren(SwipeToLoadLayout.java:1083)
7 at com.aspsine.swipetoloadlayout.SwipeToLoadLayout.fixCurrentStatusLayout(SwipeToLoadLayout.java:1146)
8 at com.aspsine.swipetoloadlayout.SwipeToLoadLayout.autoScrollFinished(SwipeToLoadLayout.java:1353)
9 at com.aspsine.swipetoloadlayout.SwipeToLoadLayout.access$1800(SwipeToLoadLayout.java:19)
10 at com.aspsine.swipetoloadlayout.SwipeToLoadLayout$AutoScroller.finish(SwipeToLoadLayout.java:1562)
11 at com.aspsine.swipetoloadlayout.SwipeToLoadLayout$AutoScroller.run(SwipeToLoadLayout.java:1545)
12 at android.os.Handler.handleCallback(Handler.java:739)
13 at android.os.Handler.dispatchMessage(Handler.java:95)
14 at android.os.Looper.loop(Looper.java:179)
15 at android.app.ActivityThread.main(ActivityThread.java:5672)
16 at java.lang.reflect.Method.invoke(Native Method)
17 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
18 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:676)
你可以看一下 我可以提供更多日志 [email protected]
比例不对时,例如太宽时,图片会显示不全
http://7xs0qt.media1.z0.glb.clouddn.com/banner/1461549919780.jpg
建议这样 ,不然长图 显示有问题,
public View onCreateItemView(int position) {
View inflate = View.inflate(mContext, R.layout.banner_simple_image, null);
ImageView iv = (ImageView) inflate.findViewById(com.vipheyue.fastlib.R.id.iv_banner);
final BannerItem item = mDatas.get(position);
iv.setScaleType(ImageView.ScaleType.FIT_XY);
String imgUrl = item.imgUrl;
if (!TextUtils.isEmpty(imgUrl)) {
Glide.with(mContext)
.load(imgUrl)
// .override(itemWidth, itemHeight)
.fitCenter()
// .centerCrop()
.placeholder(colorDrawable)
.into(iv);
} else {
iv.setImageDrawable(colorDrawable);
}
return inflate;
}```
Is it possible to disable manual scroll in case the list has only one image?
I believe it can be done using isLoopEnable, but its possible to set it on runtime.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.