Giter Club home page Giter Club logo

flycobanner_master's People

Contributors

alashow avatar h07000223 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flycobanner_master's Issues

重新setSource后onTitleSlect函数中的position参数没有重置

如果新设置进去的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

Caused by: java.lang.ArithmeticException: divide by zero

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)

Can not addOnPageChangeListener to the ViewPager

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 ?

Crash When I Update ArrayList My Gallaries

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

Show layout

i can't show my layout in page, current show only image?
Plz help me.

触摸崩溃

#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]]

请问这个是什么原因引起的

The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDataSetChan

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)

DEMO SimpleImageBanner 中onCreateItemView方法

建议这样 ,不然长图 显示有问题,

    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;
    }```

In case of just one image

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.

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.