Code Monkey home page Code Monkey logo

Comments (8)

leochuan avatar leochuan commented on July 17, 2024 2

Finally reappear this error..I think I can fix it today

from viewpagerlayoutmanager.

leochuan avatar leochuan commented on July 17, 2024

duplicate #25 , This error confuse me either, It seems like it has something to do with the version of RecyclerView, You may change the version into 26.0.1. Because I can not reappear this error, So I still not quite sure why it happens.

from viewpagerlayoutmanager.

Kolyall avatar Kolyall commented on July 17, 2024

I found that the error doesnt appear if I add this:

GravitySnapHelper snapHelper = new GravitySnapHelper(Gravity.START);
snapHelper.attachToRecyclerView(mRecyclerView);

from this lib
https://github.com/rubensousa/RecyclerViewSnap

from viewpagerlayoutmanager.

Kolyall avatar Kolyall commented on July 17, 2024

But if I set this, the error appears again

LinearSnapHelper snapHelper = new LinearSnapHelper();
snapHelper.attachToRecyclerView(mRecyclerView);

WTF?

from viewpagerlayoutmanager.

leochuan avatar leochuan commented on July 17, 2024

what is your gradle build tools version?

from viewpagerlayoutmanager.

Kolyall avatar Kolyall commented on July 17, 2024
 androidBuildToolsVersion = "26.0.2"
 androidMinSdkVersion = 19
 androidTargetSdkVersion = 23
 androidCompileSdkVersion = 25
 supportLibVer = '25.4.0'
compileOnly "com.android.support:recyclerview-v7:${supportLibVer }"

My customer doest want to update this versions

from viewpagerlayoutmanager.

leochuan avatar leochuan commented on July 17, 2024

Fixed by : 8c4acfa. Try version 2.0.3.
It because LinearLayoutManager below 26.0.0 did not call ensureLayoutState before updateLayoutState in method collectAdjacentPrefetchPositions. Cause I don't need to prefetch items, so I just simply disable it.

I find that GravitySnapHelper use api "com.android.support:recyclerview-v7:27.0.2" in its gradle build file. So maybe when you set it, recyclerview-27.0.2 is the one you use.

from viewpagerlayoutmanager.

Kolyall avatar Kolyall commented on July 17, 2024

Fixed!

from viewpagerlayoutmanager.

Related Issues (20)

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.