Comments (20)
good,it is ok. @fondesa
from recycler-view-divider.
left and right space also not equal.
from recycler-view-divider.
but if i use GridLayoutManager,those questions is ok.
from recycler-view-divider.
Interesting. Guess I found the problem calculating the group count of a StaggeredGridLayoutManager
. Is your project open source so I can directly test my changes there? Otherwise I'll try to reproduce your layout
from recycler-view-divider.
Interesting. Guess I found the problem calculating the group count of a
StaggeredGridLayoutManager
. Is your project open source so I can directly test my changes there? Otherwise I'll try to reproduce your layout
sorry,my project is enterprise project,i think you can write a simple demo to test this bug
from recycler-view-divider.
Ok no problem, I'll keep you up-to-date
from recycler-view-divider.
Ok no problem, I'll keep you up-to-date
https://blog.csdn.net/qq_33373648/article/details/77584995
you can consult this blog.
from recycler-view-divider.
This PR should fix it: #37
from recycler-view-divider.
Update to 3.0.2 and feel free to reopen the issue if it's not solved for you yet.
from recycler-view-divider.
first page is normal,but second page is wrong
from recycler-view-divider.
@fondesa
this is a demo.
Demo.zip
from recycler-view-divider.
from recycler-view-divider.
Ok thanks, I'll look into it
from recycler-view-divider.
@AcgnCodeMonkey I found the problem.
It's related to the internal usage of parent.getChildAdapterPosition(child)
which, with StaggeredGridLayoutManager
, doesn't match the position in which the item is rendered.
This will be harder than I thought to fix it since the "entire" library is based on the item's position.
Probably a solution would be to limit the position-dependent features of this library only for StaggeredGridLayoutManager
.
from recycler-view-divider.
because my kotlin is careless,i try do it.
// val lineAccumulatedSpan = lm.getAccumulatedSpanInLine(spanSize, itemPosition, groupIndex)
var lineAccumulatedSpan = 0
if (parent.layoutManager is StaggeredGridLayoutManager) {
val params = view.layoutParams as StaggeredGridLayoutManager.LayoutParams
lineAccumulatedSpan = params.spanIndex % spanCount + 1
} else {
lineAccumulatedSpan = lm.getAccumulatedSpanInLine(spanSize, itemPosition, groupIndex)
}
and test result as follows :
i check most pages ,all page is right.
i think you can draw lessons from that.
from recycler-view-divider.
from recycler-view-divider.
@AcgnCodeMonkey Yes but this is not the problem. Your code works only if there's a basic configuration of the divider (e.g. all the dividers have the same size).
If the dividers have different configurations (e.g. they change the size based on groupIndex
), the layout manager will render a wrong grid since the groupIndex
isn't calculated right.
from recycler-view-divider.
@AcgnCodeMonkey I've probably found a good solution for it. I'm working on it.
from recycler-view-divider.
Here we go: #39
The problem was related to the item position.
Since StaggeredGridLayoutManager
can change the position of the items without change their adapter positions, I had to add a partial support to it cause all the managers were currently based on groupIndex
and groupCount
. Now I added a list of managers not dependent to those two variables.
I checked your sample and it works.
from recycler-view-divider.
@AcgnCodeMonkey 3.1.0 out. Can you confirm it works?
from recycler-view-divider.
Related Issues (20)
- Animate divider
- Expose 'absoluteCellIndex'? HOT 11
- GridLayoutManager item height not equal HOT 4
- Run tests on Android Q HOT 1
- Update Android 11
- "GridLayoutManager.multipleSpanGrid" It takes too much time with a large data set HOT 4
- visibilityProvider is not working fine with GridLayoutMananger HOT 3
- Grag Item,the space will bigger and bigger HOT 4
- Fix sourceSets deprecation in CoveragePlugin
- Crash: The grid doesn't contain the item at position... HOT 3
- Equal Spacing HOT 2
- How to set float size decoration? HOT 2
- The size of the divider is wrong after notifyItemRemoved() HOT 2
- How to use the SizeProvider HOT 1
- 使用说明可以详细一些么 HOT 2
- Try JaCoCo report aggregation
- Upgrade Releases Hub Plugin to v4.0.0 HOT 1
- Failed to allocate a xxx0 byte allocation with xxx free bytes and 503MB until OOM, HOT 2
- Dependency Dashboard
- GridView
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 recycler-view-divider.