Anki-Android icon indicating copy to clipboard operation
Anki-Android copied to clipboard

[BUG]: Zooming in Statistics Page

Open brishtibheja opened this issue 1 year ago • 13 comments

Checked for duplicates?

  • [X] This issue is not a duplicate

Does it also happen in the desktop version?

  • [ ] This bug does not occur in the latest version of Anki

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

  • [X] I am reporting a bug specific to AnkiDroid (Android app)
  • [X] I have checked the manual and the FAQ and could not find a solution to my issue
  • [X] (Optional) I have confirmed the issue is not resolved in the latest alpha release (instructions)

brishtibheja avatar Apr 08 '24 14:04 brishtibheja

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

jainishrpandya avatar Apr 11 '24 12:04 jainishrpandya

I am working on it.

jainishrpandya avatar Apr 11 '24 12:04 jainishrpandya

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

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

jainishrpandya avatar Apr 11 '24 12:04 jainishrpandya

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

brishtibheja avatar Apr 11 '24 13:04 brishtibheja

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

jainishrpandya avatar Apr 12 '24 02:04 jainishrpandya

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.

user1823 avatar Apr 17 '24 08:04 user1823

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 avatar Apr 17 '24 11:04 jainishrpandya

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

jainishrpandya avatar Apr 17 '24 12:04 jainishrpandya

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.

user1823 avatar Apr 17 '24 12:04 user1823

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

jainishrpandya avatar Apr 17 '24 14:04 jainishrpandya

@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

neeldoshii avatar May 19 '24 21:05 neeldoshii

@neeldoshii i will try and update you ASAP.

jainishrpandya avatar May 20 '24 12:05 jainishrpandya

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

neeldoshii avatar May 20 '24 14:05 neeldoshii

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.

jainishrpandya avatar Jul 12 '24 04:07 jainishrpandya

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

BrayanDSO avatar Jul 12 '24 19:07 BrayanDSO

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

deysak avatar Oct 08 '24 19:10 deysak

@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)

david-allison avatar Oct 09 '24 02:10 david-allison