mihon icon indicating copy to clipboard operation
mihon copied to clipboard

Weird and not tangible scrollbar

Open Kuddus73 opened this issue 1 year ago • 3 comments

Steps to reproduce

Sometimes a weird scrollbar appears, it doesn't when you are normally scrolling the app but when you touch the right top or bottom corner. Also, when it appears, the scrollbar is not tangible to be used to actually scroll.

https://github.com/user-attachments/assets/892cb723-364a-4de3-b92a-aa794682be83

Expected behavior

If there is a scroll a bar, it should appear always when scrolling when the content doesn't fit. Also, when visible, the scrollbar should be usable to scroll.

Actual behavior

Explained in Steps to reproduce.

Crash logs

No response

Mihon version

0.17.0

Android version

14

Device

S22

Other details

No response

Acknowledgements

  • [X] I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open or closed issue.
  • [X] I have written a short but informative title.
  • [X] I have gone through the FAQ and troubleshooting guide.
  • [X] I have updated the app to version 0.17.0.
  • [X] I have updated all installed extensions.
  • [X] I will fill out all of the requested information in this form.

Kuddus73 avatar Oct 26 '24 23:10 Kuddus73

I think this appears because you bump it to the top. Otherwise, it should appear on the side during scrolls.

MajorTanya avatar Oct 26 '24 23:10 MajorTanya

I think this appears because you bump it to the top. Otherwise, it should appear on the side during scrolls.

I don't think I'm bumping it here and yet the scrollbar doesn't appear during scrolling:

https://github.com/user-attachments/assets/223ca576-6783-41e3-befa-a18cf3cbc605

Kuddus73 avatar Oct 27 '24 01:10 Kuddus73

this might be the same as #1302, or at least related.

mm12 avatar Feb 06 '25 19:02 mm12

Hi, sorry to say, but on 0.19.1 I still don't have a scrollbar at all in the library. My device is Android 9.

Please let me know what I can do that might help track down the issue.

@anirudhsnayak

Sunspark-007 avatar Aug 09 '25 15:08 Sunspark-007

@Sunspark-007 Sorry, I couldn't reproduce the issue on my end. A video recording would be helpful in figuring out what's wrong.

anirudhsnayak avatar Aug 09 '25 23:08 anirudhsnayak

It would be exactly the same as the 4 second video a little higher up. Library scrolls up and down, but the scroll indicator never appears at any point.

Tachiyomi did have a working scroll indicator in version 0.13.6, and in the 0.14 series it switched to a new backend rendering method. It's been too long and I can't remember now if the scroll indicator disappeared at that time or later. My secure folder partition doesn't let me install older versions of apks to try and identify when it happened.

Sunspark-007 avatar Aug 11 '25 15:08 Sunspark-007

Manually testing the 0.13.6 and 0.14 releases, the main difference that I can see is that the threshold for displaying the scrollbar between both versions is slightly different. In version 0.13.6, the scrollbar displays whenever any scroll is possible, but from 0.14 onward the scrollbar is visible only if there is an item entirely off screen that can be scrolled to.

I'm not sure if this is what you're seeing, or if there are many items off-screen and the scrollbar still isn't showing.

anirudhsnayak avatar Aug 11 '25 19:08 anirudhsnayak

Ok, this is interesting.. with 0.13.6 holding my finger on the screen without lifting it but scrolling, the scrollbar never appears. However, if I lift the finger and do light flicks, the scrollbar appears. I didn't know it was touch sensitive like that in that version.

Testing with Mihon 0.19.1, using light minimal flicks doesn't resolve it.. the scrollbar never appears. Tried different settings like items per row or display mode, no change.

There are many items off-screen and the scrollbar still isn't showing, that is correct.

GOOD NEWS! I found what causes the problem!

I was looking at Scrollbar.kt (even though I am not a coder) and wondering if the animation was completing before a frame gets drawn. So I tried an experiment, I went into developer options on my device where I have animations off for window animation scale, transition animation scale, and animator duration scale and changed them all to 1x and went back to Mihon to check.

WE HAVE A SCROLLBAR that disappears about 3 seconds after the flick.

Further testing.. leaving window animation scale and transition animation scale to off but animator duration scale at 1x, you still have a scrollbar.. so it is that single setting.

So, any fix to capture this edge case, needs to not depend on android's duration scale. Changing it to 2x makes the bar stay 6 seconds, etc.

Maybe you can set it to ignore what the system duration itself is set to? (What did 0.13.6 do differently that it could display with flicks when duration is set to off?)

Sunspark-007 avatar Aug 11 '25 22:08 Sunspark-007

Ok, time to try vibe coding!

old:

private val FadeOutAnimationSpec = tween<Float>( durationMillis = ViewConfiguration.getScrollBarFadeDuration(), delayMillis = ViewConfiguration.getScrollDefaultDelay(), )

new possibility:

private val FadeOutAnimationSpec = tween<Float>( durationMillis = ViewConfiguration.getScrollBarFadeDuration().takeIf { it > 0 } ?: 250, delayMillis = ViewConfiguration.getScrollDefaultDelay().takeIf { it > 0 } ?: 300, )

So this one uses the system setting if it's there, and if it's not, then use a fallback value.

As for what that value should be.. good question..

https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/view/ViewConfiguration.java

uses

/**
 * Duration of the fade when scrollbars fade away in milliseconds
 */
private static final int SCROLL_BAR_FADE_DURATION = 250;
/**
 * Default delay before the scrollbars fade in milliseconds
 */
private static final int SCROLL_BAR_DEFAULT_DELAY = 300;

But some OEMs use different values.

Sunspark-007 avatar Aug 11 '25 22:08 Sunspark-007

Oh, I see what the issue was. This should be straightforward to fix by moving the delay outside of the animation spec, so it'll be unaffected by the animator duration scale. I'll open a PR that addresses this.

The idea of using fallback values sounds nice, but ultimately if users disable animations then there isn't much we can do within the animation API to override that preference. The intended fix will just keep the scrollbar visible for a couple seconds, then disappear without a fade.

anirudhsnayak avatar Aug 12 '25 09:08 anirudhsnayak

When selecting a filter causing lesser titles to be shown, the scrollbar does not display correct length until you switch tabs and back.

App ID: app.mihon.debug App version: 0.19.1-7360 (3d3c36078, 13, 2025-08-14T17:43:30Z) Android version: 15 (SDK 35; build AP3A.240905.015.A2.G996BXXSFHYE1) Device brand: samsung Device manufacturer: samsung Device name: t2s (t2sxxx) Device model: SM-G996B WebView: Android System WebView 139.0.7258.62

https://github.com/user-attachments/assets/24e7ce53-da0b-45e4-99a2-70719d962f2d

HZzzzzzzzzzzzzzzzzzzz avatar Aug 14 '25 19:08 HZzzzzzzzzzzzzzzzzzzz