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

Feat: Add `Toggle Auto Advance` shortcut

Open sanjaysargam opened this issue 2 years ago • 18 comments

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

sanjaysargam avatar Feb 17 '24 10:02 sanjaysargam

Message to maintainers, this PR contains strings changes.

  1. 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.
  2. 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,

github-actions[bot] avatar Feb 17 '24 10:02 github-actions[bot]

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

sanjaysargam avatar Feb 17 '24 10:02 sanjaysargam

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

david-allison avatar Feb 17 '24 22:02 david-allison

 fun toggle() { 
     settings.useTimer = true 
 } 

wrote a function in AutomaticAnswer and called it when toggleAutoAdvance() but still not working

sanjaysargam avatar Feb 18 '24 20:02 sanjaysargam

Could you force push to the current code which isn't working?

david-allison avatar Feb 18 '24 23:02 david-allison

By mistakenly it is closed I will create another PR

sanjaysargam avatar Feb 19 '24 06:02 sanjaysargam

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

mikehardy avatar Feb 19 '24 15:02 mikehardy

  1. git rebase -i
  2. pulled latest changes
  3. made changes and commited
  4. git push --force origin answer

It worked

sanjaysargam avatar Feb 21 '24 16:02 sanjaysargam

This only works when I go to SettingsFragment and return to Reviewer again. This doesn't update instantly

sanjaysargam avatar Mar 18 '24 07:03 sanjaysargam

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

david-allison avatar Mar 18 '24 11:03 david-allison

automaticAnswer = AutomaticAnswer.createInstance(this, preferences, col)

@david-allison recreating instance in toggleAdvance() will solve this problem but know how to access collection

sanjaysargam avatar Mar 23 '24 17:03 sanjaysargam

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)

Arthur-Milchior avatar Mar 24 '24 14:03 Arthur-Milchior

but know how to access collection

withCol { }

david-allison avatar Mar 24 '24 20:03 david-allison

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.

sanjaysargam avatar Apr 09 '24 12:04 sanjaysargam

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

david-allison avatar Apr 13 '24 14:04 david-allison

this feature not available in alpha releases yet ?

fredjoe7 avatar Apr 14 '24 05:04 fredjoe7

this feature not available in alpha releases yet ?

It's not available, this is a pull request

david-allison avatar Apr 14 '24 08:04 david-allison

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

github-actions[bot] avatar May 01 '24 23:05 github-actions[bot]

Now there's #16400 trying to fix the same thing, since this had the Needs a new dev label

BrayanDSO avatar Jul 21 '24 20:07 BrayanDSO

@MorenoTropical Do you want to continue working on PR #16400 If yes, then I have no problem. I will close this PR

sanjaysargam avatar Jul 21 '24 20:07 sanjaysargam

Hi, I want to continue it but I need someone to review it. I sent my PR two months ago

MorenoTropical avatar Jul 21 '24 20:07 MorenoTropical