Comments (58)
This sounds like a StaggeredGridView, which is not yet supported.
from superslim.
It sounds like one, but it is not ;) Due to the fact that staggered layouts are not yet supported I put the views in a grid. It works perfectly fine if the biggest item is not the first one in a grid row, so there must be some small measuring issue. I am trying to find it right now, but it's quite hard if you don't know where to look.
from superslim.
Grid layout does handle different height items but makes the row fit the max row item height. I am not seeing this error in v0.4.4.
from superslim.
I am, though (also using 0.4.4). How can I help you to reproduce this? Unfortunately I can not provide the project itself.
from superslim.
Where's the max row height calculated? Perhaps I can fix it myself.
from superslim.
GridSLM#fillRow(…)
from superslim.
However, there seems to be a problem passing through margins in the layout params.
from superslim.
Even if I remove the margins I can not scroll back to the top any more. I will have a look at this tomorrow if you can't reproduce it.
from superslim.
Okay the margin issue is just a red herring, the margins were being stripped as they were passed through the grid layout layout param constructor.
Anyway, there is actually something strange going on with CardView. Sometimes cards are not measuring as the same size.
from superslim.
Is the card view completely cut off? Or is text content cut off? If it is the latter, then I think it is basically the same issue as #56. I suggest making sure you are using different view type ids for views going to different layouts, and for headers too.
from superslim.
The card view is completely cut off. I am also using different view types, but the views themselves are of a dynamic height. I will display some dummy values and post a few screen shots later.
from superslim.
I just hit the autocompletion a few times to fill some text views. Here are my results:
If the second card is bigger than the first one everythingn is ok.
However if the first one is bigger the recycler view doe snot scroll any more and cards may be cut off if I scroll there slowly. If I scroll to the position with a fast movement I see the complete card (as in the image).
from superslim.
Are those TextEdit views inside the cards? Maybe that is related.
from superslim.
Yes, but the issue is not related. They were just the only ones I could fill easily.
I set the values by typing into a dialog and then call settext on the EditText later.
The issue also happens with LinearLayouts that I fill programmatically (that was the original reason). It really seems to depend on the size of the views.
from superslim.
I also get weird values from getDecoratedBottom(). They seem to be changing based on the scroll speed.
from superslim.
I think I found the issue that blocks the scrolling, but I don't think that this was the original problem...
Look at this commit in my fork, please: https://github.com/Eifelschaf/SuperSLiM/commit/90f6c8b4c0e9f203554a7874fe3c607f55c54325
Does this make sense? This change allows me to scroll up at least (still with the cut card)
from superslim.
If that early return is the issue then it means the section bottom edge is not being calculated properly.
from superslim.
Hang on, is this only happening for the very last item in the entire (super) layout, not just a grid layout?
from superslim.
Aha, there we go.
from superslim.
Yes, I think I nailed it down. The getAnchorAtEnd() return the last view, not the biggest in the last row :)
This is why it only appears in the grid layout..
from superslim.
The reason for the cut off is that the grid is not computing the bottom edge correctly, so the scroll is not advancing to the real end of the layout.
from superslim.
Yeah, getAnchorAtEnd should be passing through to the SLM.
from superslim.
Do you think it's a big deal to get this fixed?
from superslim.
Actually, it should be using getAnchorAtEnd, it should be asking the SLM directly for the bottom edge.
from superslim.
It should be a minor fix. Give me a couple of minutes and I'll push a snapshot for you to test.
from superslim.
Yeah, it was trivial to fix. I am just testing it now. There are some other small fixes that have been pulled together with this and I want to check it is all working together.
from superslim.
Sure, take your time.
from superslim.
Okay, I didn't come across any problems. Check the snapshot, if it is fine I'll push up the new version.
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
compile 'com.tonicartos:superslim:0.4.5-SNAPSHOT'
}
from superslim.
sorry
from superslim.
hangon
from superslim.
Okay, I actually merged the fix in to the snapshot this time. You can test it now :)
from superslim.
You are awesome! It works perfectly fine now.
from superslim.
stop.. I just encountered it again. I have to re-check this...
from superslim.
OK, the scrolling is fixed, but the card is still cut if I scroll slowly. Are you sure you forward the measurement calls everywhere?
from superslim.
Yeah, I am seeing the bug in master after merging it, but not on the release branch. There is something I have to check.
from superslim.
As I said: take your time :)
from superslim.
Oh, hey, can you make sure to refresh the snapshot? Because there were two copies released close to each other, the unfixed one might be cached on your machine. Just to be sure.
from superslim.
I only got it after the second release, but I will check again.
from superslim.
I am definitely not seeing the bug anymore. I fixed the code divergence on master too.
from superslim.
I just did a full rebuild with 0.4.5-snapshot and it's still there.. did you try scrolling slowly?
from superslim.
Yeah, slow scrolling is fine here. I've tested with a number of views including EditText. I just noticed couple of bugs with EditText, but they are quite different (performance and keyboard interaction).
from superslim.
I will quickly try a rebuild with the current source code. It's the early_release_4 branch, right?
from superslim.
Yes
from superslim.
Nope, still there, even with the latest source. I will have a look at it now and let you know if I find something more specific.
from superslim.
As I thought: the scrollVerticallyBy method still uses the wrong view for measurement
from superslim.
ahhh shit.. This may have been my fault...
from superslim.
Okay. Here is what should be happening. On scroll a leading edge is calculated. For a scroll towards the end of the content that edge is the height of the view + the scroll displacement.
To fill the leading are in the scroll, the gridSlm should be measuring and laying out content row by row, up to that edge. The line (markerLine) up to which the grid has filled should be the bottom of the last grid row laid out.
The fix to this problem was an adjustment to use the SLM to calculate the end of the content (grid slm knows about rows, layout manager does not), rather than assuming the anchor position is at the bottom edge.
from superslim.
OK. It's fixed. It was just some very weird behavior:
I removed all sectionmanager markups from my non-header views as they were ignored for layout anyways. Turns out that they are taken into account to get the slm for measurement now.
from superslim.
and in v0.5.0 they don't matter again
from superslim.
Actually, they were not quite always ignored. For the scroll indicator they are required in v0.4.x.
from superslim.
great! Thanks! I will go with the current solution for now (multiple markup) and wait for 0.5 to change them.
from superslim.
Yeah, sorry. It is a pain, I know. :(
from superslim.
It's ok as long as it works :) Thanks for helping me.
from superslim.
But now I have two more problems to fix for EditText.
from superslim.
:) You're welcome, reporting bugs helps me too.
from superslim.
If i can help you with the edit text just let me know.
from superslim.
Thanks for offering. I am going to tackle it after #53. I will have to make a number of changes to the layout code so I might be able to fix it with that anyway.
from superslim.
Alright, v0.4.5 should be available now.
from superslim.
Related Issues (20)
- Flexbox layout
- Dynamic sticky content
- Built in elevation change for sticky content.
- Infinite scroll
- Collapsible/expandable sections
- Sticky footers weirdly wobble on horizontal scroll. HOT 1
- Toggling collapsible sections loses items.
- Prepare milestone 5 release
- Update Readme.md
- On layout a sticky footer always sits above sticky inset (section state inset parameter).
- Sticky footer HOT 2
- RecycleView scrolls over sticky header
- Crash On RecyclerView Refresh
- Does SuperSLiM supports sub headers ? HOT 10
- Mocking framework
- i cannot build the project
- NPE at LayoutManager#onItemsUpdated
- Androidx HOT 1
- Is this covered by the Apache 2.0 License?
- Scrolling issue with Sticky Headers on
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 superslim.