-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scrolling issues #55
Comments
This sounds like a StaggeredGridView, which is not yet supported. |
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. |
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. |
I am, though (also using 0.4.4). How can I help you to reproduce this? Unfortunately I can not provide the project itself. |
Where's the max row height calculated? Perhaps I can fix it myself. |
GridSLM#fillRow(…) |
However, there seems to be a problem passing through margins in the layout params. |
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. |
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. |
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. |
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. |
Are those TextEdit views inside the cards? Maybe that is related. |
Yes, but the issue is not related. They were just the only ones I could fill easily. 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. |
I also get weird values from getDecoratedBottom(). They seem to be changing based on the scroll speed. |
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) |
If that early return is the issue then it means the section bottom edge is not being calculated properly. |
Hang on, is this only happening for the very last item in the entire (super) layout, not just a grid layout? |
Aha, there we go. |
Yes, I think I nailed it down. The getAnchorAtEnd() return the last view, not the biggest in the last row :) |
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. |
Yeah, getAnchorAtEnd should be passing through to the SLM. |
Do you think it's a big deal to get this fixed? |
Actually, it should be using getAnchorAtEnd, it should be asking the SLM directly for the bottom edge. |
It should be a minor fix. Give me a couple of minutes and I'll push a snapshot for you to test. |
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. |
Sure, take your time. |
- Fix scroll at content end with grid. Closes #55. - Lots of minor fixes. - - Layout params copy constructor using margin params source. - - Actually trim children below the screen before whole section has passed. - - Better anchor finding for fill next section to start. - - While filling row, don't look into next section. - - Better naming for column anchor position. - - Decache the correct view. - - Remove dead code. - - Add layout params copy constructor using margins layout source.
stop.. I just encountered it again. I have to re-check this... |
OK, the scrolling is fixed, but the card is still cut if I scroll slowly. Are you sure you forward the measurement calls everywhere? |
Yeah, I am seeing the bug in master after merging it, but not on the release branch. There is something I have to check. |
As I said: take your time :) |
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. |
I only got it after the second release, but I will check again. |
I am definitely not seeing the bug anymore. I fixed the code divergence on master too. |
I just did a full rebuild with 0.4.5-snapshot and it's still there.. did you try scrolling slowly? |
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). |
I will quickly try a rebuild with the current source code. It's the early_release_4 branch, right? |
Yes |
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. |
As I thought: the scrollVerticallyBy method still uses the wrong view for measurement |
ahhh shit.. This may have been my fault... |
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. |
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. |
and in v0.5.0 they don't matter again |
Actually, they were not quite always ignored. For the scroll indicator they are required in v0.4.x. |
great! Thanks! I will go with the current solution for now (multiple markup) and wait for 0.5 to change them. |
Yeah, sorry. It is a pain, I know. :( |
It's ok as long as it works :) Thanks for helping me. |
But now I have two more problems to fix for EditText. |
:) You're welcome, reporting bugs helps me too. |
If i can help you with the edit text just let me know. |
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. |
Alright, v0.4.5 should be available now. |
Hi,
I think I found another issue:
I have a grid layout with variable size cards. If the first card in the last line is bigger than the rest it is cut off. Also I can't scroll back to the top in this case.
The layout item is completely displayed if I first scroll down and then turn the display (probably repainting the view)
Edit: I am using the width-based version of the grid layout.
Edit 2: If I scroll fast enough I will get the complete item visible
The text was updated successfully, but these errors were encountered: