GithubHelp home page GithubHelp logo

android-convenientbanner's Issues

提交一个bug

readme 里有一个符号错了
demo是用Module方式依赖,你也可以使用gradle 依赖:

compile 'com.bigkoo:convenientbanner:1.1.1’

上面最后一个符号错了 应该是'

IllegalAccessException

ConvenientBanner类中的setPageTransformer()方法报IllegalAccessException,好像是反射那问题

几个问题

1、首先很致命的问题,用起来居然卡卡的
手指滑动过后,感觉有些滞后
2、我用在ViewPager里面嵌套,点击每个Item居然无效;
3、canLoop不能再代码里面设置。如果我实现不清楚是否需要canLoop,那么我肯定是要在后面设置的,xml文件可以,代码居然不可以

只有一条数据时能否禁止滚动

如果datas数组只有一条数据,现在依然能够左右无限滚动。从需求上讲这时我可能不希望viewpager能够滚动,因为滚来滚去都只有一条数据。我现在是通过重写dispatchTouchEvent来禁止触摸事件,但总归是hack。能否增加一个开关来让控制滚动?

当设置滚动间为1000毫秒时,滚动异常

当设置startTurning(1000)的时候,我使用了三张图片,第一圈滚动是正常的从左往右滚动,但是当滚动进行到第二圈的时候,到第二张图片的时候是从右向左滚动,然后在从左向右滚动,往后每一圈的顺序都是这样的,但是设置startTurning(2000)的时候是正常的

如何停止循環?

在最後1頁不能向右掃回第1頁 及 第1頁不能向左掃到最後頁

還有另1問題就是在activity第一次增加圖片在ConvenientBanner上,然後向左掃就加載失敗.再次掃左或右才回復正常

Gradle依赖失败了

在gradle中加上 compile 'com.bigkoo:convenientbanner:1.0.0' 一直没有办法正常引用,只能下载aar粘贴到工程中。
另外你的android:icon会与调用者的android:icon冲突,应该把library moule中的android:icon删掉。

指示器设置后不显示

holder.convenientBanner.setPageIndicator(new int[]{R.drawable.kw_homesys_dotnormal, R.drawable.kw_homesys_dotselected});
holder.convenientBanner.setPageIndicatorAlign(ConvenientBanner.PageIndicatorAlign.ALIGN_PARENT_RIGHT);
holder.convenientBanner.setPages(new CBViewHolderCreator() {
@OverRide
public NetworkImageHolderView createHolder() {
return new NetworkImageHolderView();
}
}, images);

图片乱跳,还会有空白页

ConvenientBanner.setScrollDuration(10000);
ConvenientBanner.startTurning(10000);
我自定义了淡入淡出的切换效果,再做了模糊处理,有时候图片就会乱跳,还会有空白页。

请问一下如何动态更新图片资源

我这边有个项目,其中的广告图是根据商场不同需要切换不同的广告图。
List中存放的是DrawableId,然后clean了List数据后,重新向List内add了新的DrawableId。然后调用调用notifyDataSetChange,控件不刷新生效,只能重新setPage才能生效
请问一下是我哪个地方做错了嘛?

除了Image還想加入字串或其他view

convenientBanner.setPages(new CBViewHolderCreator() {
@OverRide
public ImageHolder createHolder() {
return new ImageHolder();
}
},networkImages);

networkImages 只能是List
不能用
ArrayList<HashMap<String,Object>> 這類 ?
"image" : url
"text" : "hello this is image 1"
然後在相片上顯示字串

java.lang.NullPointerException

网络请求超时后报错

com.android.volley.TimeoutError


E/AndroidRuntime: FATAL EXCEPTION: main    Process: com.fangbei.market, PID: 28280
java.lang.NullPointerException , 
  at com.bigkoo.convenientbanner.ConvenientBanner$1.run(ConvenientBanner.java:88)
  at android.os.Handler.handleCallback(Handler.java:733)
  at android.os.Handler.dispatchMessage(Handler.java:95)
  at android.os.Looper.loop(Looper.java:136)
  at android.app.ActivityThread.main(ActivityThread.java:5001)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:515)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
  at dalvik.system.NativeStart.main(Native Method)

与Glide配合使用时报错

Android-ConvenientBanner在使用Glide作为图片加载器时会报错,内容如下:

java.lang.IllegalArgumentException: You must not call setTag() on a view Glide is targeting

应该是CBPageAdapter类中getView的实现导致的

@Override public View getView(int position, View view, ViewGroup container) {
    Holder holder;
    if (view == null) {
        holder = (Holder) holderCreator.createHolder();
        view = holder.createView(container.getContext());
        view.setTag(holder);
    } else {
        holder = (Holder<T>) view.getTag();
    }
    if(mDatas!=null&&!mDatas.isEmpty())
    holder.UpdateUI(container.getContext(), position, mDatas.get(position));
    return view;
}

将该方法改为如下就可以正常运行:

@Override
public View getView(int position, View view, ViewGroup container) {
    Holder<T> holder = (Holder) holderCreator.createHolder();
    view = holder.createView(container.getContext());
    if (mDatas != null && !mDatas.isEmpty())
        holder.UpdateUI(container.getContext(), position, mDatas.get(position));
    return view;
}

但这样应该就不能重用ImageView了吧!
我对Android不是很熟悉,不知道我提的问题是不是存在,或者是我用法不正确?如果问题存在,请问作者有什么好的解决方法么?

PageIndicator

PageIndicator能不能改位置,比如右下角。

UpdateUI 里面设置的imageview 设置tag 会报错

原因是应为CBPageAdapter里面的geteview 也设置了tag .......获取到了我在UpdateUI 里面设置的.然而类型不对就挂掉了......我的处理方式是imageView.setTag(R.id.tag_1,uri); 这样解决的

棉花糖系统有问题

我的手机是nexus5,6.0系统,连续快速滑动时,ui会卡顿大约5秒的时间,卡的不能进行任何操作,也没报错,5秒后正常,查阅了下源码也没找出是什么原因

建议在CBLoopViewPager的super.setCurrentItem(realItem, smoothScroll);用try-catch一下

java.lang.IllegalStateException: The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDataSetChanged! Expected adapter item count: 2, found: 4 Pager id: com.rjfittime.app:id/cbLoopViewPager Pager class: class com.bigkoo.convenientbanner.CBLoopViewPager Problematic adapter: class com.bigkoo.convenientbanner.CBLoopPagerAdapterWrapper
at android.support.v4.view.ViewPager.populate(ViewPager.java:1000)
at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:552)
at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:514)
at android.support.v4.view.ViewPager.setCurrentItem(ViewPager.java:506)
at com.bigkoo.convenientbanner.CBLoopViewPager.setCurrentItem(CBLoopViewPager.java:132)
at com.bigkoo.convenientbanner.CBLoopViewPager.setCurrentItem(CBLoopViewPager.java:138)
at com.bigkoo.convenientbanner.ConvenientBanner$1.run(ConvenientBanner.java:75)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5942)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)

ERROR BACK

my gradler can't add your compile
this is the photo:
error

adapter bug,

如果数据设置两条以上,
例如3条或者4条,上来就直接向左边滑动,控件会被清一下,
您的这个adapter处理我不太看得懂,
下面留一个gif,

http://wy.21bit.cn/test/sa.gif

高度设置为wrap_content无效

listView设置为头部视图时,设置banner的高度为wrap_content 无效,必须要设置固定高度或match_parent, 另外,源码里好像没有重新测算高度

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.