-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Option to choose the default answer(Again, Hard, Good, Easy) on timeout when the "automatic display answer" setting is used #8281
Conversation
I have currently hard coded a string as I was not able to add translations for all the languages and I am not aware of how this is done in Ankidroid. |
Codecov Report
@@ Coverage Diff @@
## master #8281 +/- ##
============================================
- Coverage 36.95% 36.92% -0.04%
- Complexity 3783 3797 +14
============================================
Files 354 356 +2
Lines 35820 35971 +151
Branches 4736 4774 +38
============================================
+ Hits 13239 13282 +43
- Misses 21072 21171 +99
- Partials 1509 1518 +9 Continue to review full report at Codecov.
|
@IAmJaishree Hi, it's looking great. We don't have to add translations for all the languages. We just have to add the strings in the default one. Rest all work is done by crowdin. It will show the string label red at the time of addition but it will not cause the build to fail ;-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better using int
here, over a String
.
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.java
Outdated
Show resolved
Hide resolved
Got it, thanks for this, I tried adding it in the default file and got red text as errors so I Hardcoded it instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good! Some code style nitpicks, ad a few translation changes
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.java
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.java
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.java
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.java
Outdated
Show resolved
Hide resolved
19bc23f
to
5dc0ec7
Compare
@david-allison-1 I have made the changes, please review :) |
Thanks! I'm trying a new workflow to ensure I'm not missing things. Could you add a row here (sheet: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! One change, and one nice to have, then good to go. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another request: could you ensure that the first line of the commit message is 50 characters or less
Leave a blank line after the title, and the longer commit description can be as long as you'd like, typically including the issue that is fixed, and 80 characters per line.
Just a lint error to fix. We have duplicate strings, which adds unnecessary work for our translators. Either add a In this case
|
This commit provides functionality of choosing the default answer for automatic display answer" scenario and by default "Good" is selected instead of "Again" as the answer. Fixes ankidroid#2609
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 but on the related issue, it was noted that in the other parts of the ecosystem (AnkiMobile specifically) "Bury" is the default action on the card:
And for what it's worth, AnkiMobile's auto-advance default is to bury cards (least harm done if the user gets distracted), with options to use again/hard&good.
...so I was expecting bury to be the default option here, and within the set of available options for the preference.
Separately, in the Java code at least constants should be used vs hard-coded magic numbers 1, 2, 3 etc - not possible in the XML I think but in Java we have the 4 possible buttons at least
Anki-Android/AnkiDroid/src/main/java/com/ichi2/libanki/Consts.java
Lines 140 to 143 in d42a9e3
public static final int BUTTON_ONE = 1; | |
public static final int BUTTON_TWO = 2; | |
public static final int BUTTON_THREE = 3; | |
public static final int BUTTON_FOUR = 4; |
public static final int QUEUE_TYPE_MANUALLY_BURIED = -3; |
I think the actual handling of the buttons and the code itself is pretty clean, just that bury isn't available and is not the default as I was expecting based on the connected issue
Should we make "Again" the default option? |
@IAmJaishree I feel as though you did not read my comment completely.
No. My comment was specific and included a reference
|
Hello 👋, this PR has been opened for more than 2 months with no activity on it. 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 |
This is a very popular request - keeping open, will harvest the code for a fresh PR to get it done if it sits much longer |
Hello 👋, this PR has been opened for more than 2 months with no activity on it. 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 |
okay - definitely needs harvesting, this is really popular. Up for grabs if anyone has time 🙏 |
Hello 👋, this PR has been opened for more than 2 months with no activity on it. 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 |
Never stale, I would love to see this in! |
Purpose / Description
Currently when "automatic display answer" setting is used on timeout by default "Again" gets selected and there is no option to change this setting.
This PR provides functionality of choosing the default answer for "automatic display answer" scenario.
Now by default "Good" is selected instead of "Again" as the answer.
Fixes
Fixes #2609
Approach
Added an option to change the default settings in the Preferences Page(Screenshot attached).
Based on the selected preference on timeout automatically answering by clicking the button.
How Has This Been Tested?
This has been tested manually by me by going through the possible scenarios.
Checklist
Please, go through these checks before submitting the PR.
if
statements)Screenshots:
On Clicking on the "Automatic Display Answer" a popup appears.