k0shk0sh / FastHub

FastHub the ultimate GitHub client for Android.
GNU General Public License v3.0
5.71k stars 928 forks source link

The scrolling bar keeps resizing #605

Closed ghost closed 7 years ago

ghost commented 7 years ago

App Version: 3.0.0

OS Version: 25

Model: Samsung Galaxy S5

When you're scrolling through an issue with a lot of comments like this one, the scrolling bar (or FastScroller, as you like to call it) keeps jumping around.

Sent from my Samsung kminilte using FastHub

yakov116 commented 7 years ago

Attaching a GIF 2017-06-04_13-20-13

ghost commented 7 years ago

@yakov116 Yeah that's what I meant

Sent from my Samsung kminilte using FastHub

Sent from my Samsung Galaxy S5 using FastHub

k0shk0sh commented 7 years ago

Well, its because each comment has its own length plush the timeline has plenty of different rows, header, labels, comments. So it will definitely do that. Its what any fastscroller do.

Sent from my Htc m8 using FastHub

ghost commented 7 years ago

@k0shk0sh But couldn't you just calculate the sum of all the lengths of all the comments?

Sent from my Samsung Galaxy S5 using FastHub

k0shk0sh commented 7 years ago

@StanNL for what reason exactly? as I said, when you have such complex multi-row list, you gonna have such thing.

ghost commented 7 years ago

@k0shk0sh Well, I'm not a Java expert, nor an app developer at all, but I'd say it would look better if it was more consistent and it wouldn't be jumping from place to place all the time

Sent from my Samsung Galaxy S5 using FastHub

wasdennnoch commented 7 years ago

That would indeed be nice but hardly if even not possible to implement; the thing is the app uses a so-called RecyclerView which is basically a box with scrollable content that is based on the same layout. Only the content that is actually visible to the user is also in the view hierarchy which means in this example comments that are not visible practically do not exist at all. Because of that the RecyclerView, which only knows the total amount of comments and the height of the currently visible ones, has to assume all items have a similar height; it can't detect that there is for example one very big one in between because, as said, it doesn't exist as a view. The only way to detect the total height would be to add views for all comments which is extremely expensive. Theoretically there are also other ways to determine the height but all of them require very complex code or are also expensive so it's best to just leave it that way. Oh, and I think you can't even manually set the scrollbar position or dimensions from outside.

k0shk0sh commented 7 years ago

@wasdennnoch it is in 3.0.1 the fastscroller is fixed to one size so I hope everyone is happy

Sent from my Htc m8 using FastHub

ghost commented 7 years ago

@k0shk0sh Yeah that seems like a very reasonable solution to me

Sent from my Samsung Galaxy S5 using FastHub

wasdennnoch commented 7 years ago

@k0shk0sh I guess this doesn't change that it moves with different speeds but it's something.

k0shk0sh commented 7 years ago

@wasdennnoch that's true and can't do anything about it for the meantime.

Sent from my Htc m8 using FastHub

Younes-L commented 7 years ago

@wasdennnoch thanks ! I've been wondering why this happens on the Google Keep app for years...

Sent from my Htc Nexus 9 using FastHub