ankidroid / Anki-Android

AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
GNU General Public License v3.0
8.62k stars 2.23k forks source link

[BUG]: Zooming in Statistics Page #16135

Closed brishtibheja closed 2 weeks ago

brishtibheja commented 6 months ago

Checked for duplicates?

Does it also happen in the desktop version?

What are the steps to reproduce this bug?

  1. Open Statistics
  2. Zoom in then Zoom Out
  3. Scroll to the bottom

Expected behaviour

everything's normal

Actual behaviour

page scrolls infinitely. After the Cards Added section it's an infinite empty screen you can scroll through.

Debug info

AnkiDroid Version = 2.18alpha8 (6fc26947fd31743bc83e68f17ae7fec64bfa8e62)

Backend Version = provider(?) (24.04 429bc9e14cefb597646a0e1beac6ef140f226b6f)

Android Version = 11 (SDK 30)

ProductFlavor = full

Manufacturer = realme

Model = RMX2193

Hardware = mt6768

Webview User Agent = null

ACRA UUID = cf265e01-9693-407f-984d-61ddf9698fac

FSRS Enabled = true

Crash Reports Enabled = true

(Optional) Anything else you want to share?

No response

Research

jainishrpandya commented 6 months ago

Reproduced! after zooming in and zooming out the statistics page goes into infinite scroll and goes into empty white spaces.

jainishrpandya commented 6 months ago

I am working on it.

jainishrpandya commented 6 months ago

@brishtibheja Can you confirm if this is the issue you mentioned?

https://github.com/ankidroid/Anki-Android/assets/69842037/82e376d1-06b7-43e6-969e-ca87c6c865f5

brishtibheja commented 6 months ago

Don't worry. You've got the right one.

jainishrpandya commented 6 months ago

@brishtibheja thanks for confirming. I am working on it.

user1823 commented 6 months ago

Zoom in the stats page is quite buggy. For example, after zooming in, it is sometimes not possible to zoom out. Sometimes, zooming in itself requires multiple tries.

Out of the many Anki pages included in AnkiDroid, this issue occurs only in the Stats page and started in alpha 8. This makes me think that https://github.com/ankidroid/Anki-Android/pull/16027 might have a role. I may be wrong but I think that it's worth checking whether this PR is the cause.

jainishrpandya commented 6 months ago

the problem is with the nestedScrollView. Instead we can use LinearLayout.

I Tested it with Linear Layout.

https://github.com/ankidroid/Anki-Android/assets/69842037/708224c1-1528-4184-a589-b1e8c5179d75

jainishrpandya commented 6 months ago

@user1823 Yes! This bug appeared after the nestedscrollview added to hide the topbar when scrolled.

user1823 commented 6 months ago

the problem is with the nestedScrollView. Instead we can use LinearLayout. I Tested it with Linear Layout.

Based on the video, it seems to break the feature added in the above-mentioned PR, i.e., hiding the top bar on scroll.

Ideally, we would want to fix the current issue without breaking the feature.

jainishrpandya commented 6 months ago

@user1823 It is just to confirm the reason of bug. We can find alternate solution that works with this feature also. My bad

neeldoshii commented 5 months ago

@jainishrpandya Thanks for breaking the cause of the bug. Seems I forgot to test throughly while I implemented hide scroll feature which led 2 more issues.

Can you check, does this help in fixing it?

https://stackoverflow.com/questions/35127845/webview-inside-nestedscrollview-cannot-be-scrolled

jainishrpandya commented 5 months ago

@neeldoshii i will try and update you ASAP.

neeldoshii commented 5 months ago
    <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
+      android:fillViewport="false"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

Did this helped anyway? My spare android device is pretty old which's multiple taps ain't working properly.

jainishrpandya commented 3 months ago

I'm sorry for not getting back to you sooner. I have tested different approaches, but the problem persists. so I think the problem is with the page from where the data is sourced. maybe I am wrong so can someone double check.

BrayanDSO commented 3 months ago

I believe that this is a problem with the interaction of View zooming and the appbar properties. This may not be solvable without doing hacks or without a deep understanding of the views that are being used.

I'm removing the Priority-High label since this isn't a major distress for the user

deysak commented 3 weeks ago

Hi @jainishrpandya, are you still working on this? If not, I would like to.

david-allison commented 3 weeks ago

@deysak feel free to work on it if you don't get a reply within 24 hours from your comment

Ping me at this point if you want it assigned (only as a formality, not required to work on the issue)