GithubHelp home page GithubHelp logo

Scrolling issues about superslim HOT 58 CLOSED

tonicartos avatar tonicartos commented on July 18, 2024
Scrolling issues

from superslim.

Comments (58)

PatrickDattilio avatar PatrickDattilio commented on July 18, 2024

This sounds like a StaggeredGridView, which is not yet supported.

from superslim.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

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.

TonicArtos avatar TonicArtos commented on July 18, 2024

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.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

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.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

Where's the max row height calculated? Perhaps I can fix it myself.

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

GridSLM#fillRow(…)

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

However, there seems to be a problem passing through margins in the layout params.

from superslim.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

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.

TonicArtos avatar TonicArtos commented on July 18, 2024

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.

TonicArtos avatar TonicArtos commented on July 18, 2024

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.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

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.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

I just hit the autocompletion a few times to fill some text views. Here are my results:

scroll_works
If the second card is bigger than the first one everythingn is ok.

scroll_broken
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.

TonicArtos avatar TonicArtos commented on July 18, 2024

Are those TextEdit views inside the cards? Maybe that is related.

from superslim.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

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.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

I also get weird values from getDecoratedBottom(). They seem to be changing based on the scroll speed.

from superslim.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

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.

TonicArtos avatar TonicArtos commented on July 18, 2024

If that early return is the issue then it means the section bottom edge is not being calculated properly.

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

Hang on, is this only happening for the very last item in the entire (super) layout, not just a grid layout?

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

Aha, there we go.

from superslim.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

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.

TonicArtos avatar TonicArtos commented on July 18, 2024

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.

TonicArtos avatar TonicArtos commented on July 18, 2024

Yeah, getAnchorAtEnd should be passing through to the SLM.

from superslim.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

Do you think it's a big deal to get this fixed?

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

Actually, it should be using getAnchorAtEnd, it should be asking the SLM directly for the bottom edge.

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

It should be a minor fix. Give me a couple of minutes and I'll push a snapshot for you to test.

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

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.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

Sure, take your time.

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

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.

TonicArtos avatar TonicArtos commented on July 18, 2024

sorry

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

hangon

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

Okay, I actually merged the fix in to the snapshot this time. You can test it now :)

from superslim.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

You are awesome! It works perfectly fine now.

from superslim.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

stop.. I just encountered it again. I have to re-check this...

from superslim.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

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.

TonicArtos avatar TonicArtos commented on July 18, 2024

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.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

As I said: take your time :)

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

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.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

I only got it after the second release, but I will check again.

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

I am definitely not seeing the bug anymore. I fixed the code divergence on master too.

from superslim.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

I just did a full rebuild with 0.4.5-snapshot and it's still there.. did you try scrolling slowly?

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

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.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

I will quickly try a rebuild with the current source code. It's the early_release_4 branch, right?

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

Yes

from superslim.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

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.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

As I thought: the scrollVerticallyBy method still uses the wrong view for measurement

from superslim.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

ahhh shit.. This may have been my fault...

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

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.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

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.

TonicArtos avatar TonicArtos commented on July 18, 2024

and in v0.5.0 they don't matter again

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

Actually, they were not quite always ignored. For the scroll indicator they are required in v0.4.x.

from superslim.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

great! Thanks! I will go with the current solution for now (multiple markup) and wait for 0.5 to change them.

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

Yeah, sorry. It is a pain, I know. :(

from superslim.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

It's ok as long as it works :) Thanks for helping me.

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

But now I have two more problems to fix for EditText.

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

:) You're welcome, reporting bugs helps me too.

from superslim.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

If i can help you with the edit text just let me know.

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

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.

TonicArtos avatar TonicArtos commented on July 18, 2024

Alright, v0.4.5 should be available now.

from superslim.

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.