Feat: Add `Toggle Auto Advance` shortcut
Purpose / Description
Toggle Auto Advance gesture
Fixes
- Fixes #15519
How Has This Been Tested?
Physical Device ( Realme 9 )
https://github.com/ankidroid/Anki-Android/assets/65113071/744838fc-e2df-4a6e-b29b-dad3b1201518
Checklist
- [x] You have a descriptive commit message with a short title (first line, max 50 chars).
- [ ] You have commented your code, particularly in hard-to-understand areas
- [x] You have performed a self-review of your own code
- [x] UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
- [ ] UI Changes: You have tested your change using the Google Accessibility Scanner
Message to maintainers, this PR contains strings changes.
- Before merging this PR, it is best to run the "Sync Translations" GitHub action, then make and merge a PR from the i18n_sync branch to get translations cleaned out.
- Then merge this PR, and immediately do another translation PR so the huge change made by this PR's key changes are all by themselves.
Read more about updating strings on the wiki,
This only works when I go to SettingsFragment and return to Reviewer again. This doesn't update instantly. I tried a lot.
automaticAnswer.enable()
I have called this function but it didn't work.
Can any of the maintainers/contributors help me to resolve this
The first step would be to launch AnkiDroid under a debugger and see what's happening
Visually, it doesn't look like you're updating settings.useTimer
https://github.com/ankidroid/Anki-Android/blob/d50ed50557fbcc3d863214e8954fbf5f28fba9f1/AnkiDroid/src/main/java/com/ichi2/anki/reviewer/AutomaticAnswer.kt#L138-L152
fun toggle() {
settings.useTimer = true
}
wrote a function in AutomaticAnswer and called it when toggleAutoAdvance() but still not working
Could you force push to the current code which isn't working?
By mistakenly it is closed I will create another PR
By mistakenly it is closed I will create another PR
So, you have pushed zero commits which closes the PR, and instead of fixing that and pushing a corrected branch you will open an entirely new PR that will no longer have the useful conversation that has taken place here?
Don't do that.
Learn git rebase, fix the branch, and push back to your 'answer' branch on your fork containing the changes you want, on this PR
That will preserve the work here, as opposed to abandoning it - which I will tell you as a reviewer + someone that collaborates on PRs here feels disrespectful to the reviewer time by breaking the conversational chain that the reviewer invested time in
- git rebase -i
- pulled latest changes
- made changes and commited
- git push --force origin answer
It worked
This only works when I go to SettingsFragment and return to Reviewer again. This doesn't update instantly
It needs to update instantly if the user presses a menu item or performs a gesture.
There's a known bug that settings doesn't immediately update the Reviewer
automaticAnswer = AutomaticAnswer.createInstance(this, preferences, col)
@david-allison recreating instance in toggleAdvance() will solve this problem but know how to access collection
Sorry, but it seems you now have a merge conflict. Would you mind providing a screenshot, or better, a video, to show what your change will look like for the user ? (Put it in the first message, so it can easily be found by any reviewer)
but know how to access collection
withCol { }
My one request would be to comment on your intention of how this will affect the auto-advance timers (and audio playback) on enabling and disabling the preference
I don't understand what you are expecting.
If I toggle auto advance on and off what should happen, should the timer be reset or not?
State your intention in a comment
Likewise for if you enable it while audio is playing. Does it wait for the audio to finish, or start the timer immediately
this feature not available in alpha releases yet ?
this feature not available in alpha releases yet ?
It's not available, this is a pull request
Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically
Now there's #16400 trying to fix the same thing, since this had the Needs a new dev label
@MorenoTropical Do you want to continue working on PR #16400 If yes, then I have no problem. I will close this PR
Hi, I want to continue it but I need someone to review it. I sent my PR two months ago