ankidroid / Anki-Android

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

Show Answer button jumps view back to top #5182

Open sanjayananda opened 5 years ago

sanjayananda commented 5 years ago

For context, I primarily have cards that have long texts with clozes. This bug relates to those types of cards.

Reproduction Steps
  1. Open a deck's cards for study
  2. Scroll down until I find the cloze "[...]"
  3. Tap "Show Answer"
Expected Result

The page view stays where it is - no movement.

Actual Result

The page view jumps all the way back to the top of the screen. I have to scroll down again, to find the now-revealed answer.

Debug info

AnkiDroid Version = 2.8.4 Android Version = 8.1.0 ACRA UUID = 58cab56b-9a8b-41a8-98ed-91e378e5bc58

Research

[ x ] I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid

[ x ] I have checked the manual and the FAQ and could not find a solution to my issue

[ x ] I have searched for similar existing issues here and on the user forum

mikehardy commented 5 years ago

Hi there and thanks for taking the time to report this. Sorry you've run into trouble. I'm traveling right now so don't have time to test but the first thing I would check is if this happens with the current alpha version. If you follow the instructions here you can check for yourself if you want to help move the issue forward - https://github.com/ankidroid/Anki-Android/wiki/Installation#beta--alpha-releases

sanjayananda commented 5 years ago

@mikehardy thanks for this.

I tried to figure out downloading the alpha version, joined the Google group but didn't find an alpha download link there or in the link you shared - it's different than the basic public Play Store version?

I tried the beta version, but the original issue was acting the same, jumping to the top.

mikehardy commented 5 years ago

Hi @sanjayananda - The alpha version is much more current than the beta version at this point, and while I don't think it will solve this bug you never know - and it's good to test on it. On the link above, in order to get the Alpha version immediately (after joining the Google alpha testers group) - do this:

To get a beta or alpha update with no delay instead of waiting, may manually tap the 
button to scan for updates in the Google Play Store app on your device, then update via 
the update button in the list of app updates found (not in the app details section).
sanjayananda commented 5 years ago

@mikehardy ok, went through the steps, hope it worked but not clear if it did or not - any way to confirm if I have the alpha version or not?

Issue remains the same.

mikehardy commented 5 years ago

In preferences, settings, advanced, at the bottom it has the version

sanjayananda commented 5 years ago

2.8.4

mikehardy commented 5 years ago

Strange, but if you see 2.8.4 and you have definitely checked for new versions that means you are probably not in the beta and alpha groups.

sanjayananda commented 5 years ago

Hmm, yeah, went through the steps (joined alpha Google group, checked for updates), there was no update as described. Any suggestions?

You mentioned this might not solve the issue anyway - just want to check that this isn't a sidetrack from the scroll jumping issue.

mikehardy commented 5 years ago

For now this is a sidetrack but later when this has a fix you won't be able to confirm it until there is a major release - so it is t vital, but maybe useful. Sounds like you tried though for sure! No idea why it didn't work... Maybe your phone is connected to Google play with a different account than the Google alpha group membership

sanjayananda commented 5 years ago

Ok, thanks for explaining. Happy to continue down the sidetrack if you see it all connecting 😄

I checked on the different account possibility - both are on the same account.

sanjayananda commented 5 years ago

Hey, checking in about this. Any ideas for next steps?

mikehardy commented 5 years ago

sorry @sanjayananda - I got roped into a startup in Real Life with some tight deadlines and haven't had time to move any AnkiDroid things forward in the last couple weeks. I've tagged it with needs-triage so it'll stay near the top of the investigation stack but I can't promise when I'll have a chance to look at it, personally :-(

sanjayananda commented 5 years ago

Ok thanks Mike. All the best with the project, and thanks for your help this far!

sanjayananda commented 5 years ago

Any news on this?

Used to use this app on mobile daily. It's been a few months without it, and no response since Mike stepped back. :(

Can I do anything to help this progress?

mikehardy commented 5 years ago

Hi there - no news as of yet, sorry. Just thinking about it quickly now while I'm looking at it, I'm not even sure how I would solve this...we reuse the WebView between question/answer (card flip) but we completely re-display the document inside of it.

The only thing I can think of is something like what @pigoz did with https://github.com/pigoz/anki-canvas - use local storage to share state across the question/answer flip. In this case you would want to store current scroll position I believe, which means you'd want some javascript that listened to scroll events and stored the scroll position when scrolling was stopped, then on answer load you'd want to see if there was a scroll position - use it then clear it if so, and you're set.

I am not saying this is easy, but I am thinking this is actually possible as a javascript solution and could be developed independent of the main project - possibly with the aid of the HTML / JS inspection powers available in the new alpha https://github.com/ankidroid/Anki-Android/wiki/Development-Guide#html-javascript-inspection

sanjayananda commented 5 years ago

Checking in - any update? Just downloaded AnkiDroid again to check on the issue, it's still present as described :(

mikehardy commented 5 years ago

This issue will be updated when/if anyone has time to get to it - sorry it's not faster but it's a volunteer project and we were wrapping up the 2.9 release

github-actions[bot] commented 4 years ago

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

sanjayananda commented 3 years ago

Hey all, any news on this? It's been a few years 😅😔, so wanted to check in. Really missing getting to use Anki offline on a mobile device.

mikehardy commented 3 years ago

Ironically there was another comment on another issue recently related to the same chunk of code - I think we may remove it but I'm not sure, it needs testing: https://github.com/ankidroid/Anki-Android/issues/7825#issuecomment-738911823

sanjayananda commented 3 years ago

Thanks for the update! Glad it's still being considered 🙏