Skip to content

Commit

Permalink
Added gesture for rescheduling (ankidroid#14182)
Browse files Browse the repository at this point in the history
* added gesture for rescheduling

* added tests

* removed unnecessary changes

* Update AnkiDroid/src/main/java/com/ichi2/anki/cardviewer/ViewerCommand.kt

Co-authored-by: Brayan Oliveira <[email protected]>

---------

Co-authored-by: Brayan Oliveira <[email protected]>
  • Loading branch information
parthn2 and BrayanDSO authored Aug 5, 2023
1 parent f8fcf0a commit 98b40a6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions AnkiDroid/src/main/java/com/ichi2/anki/Reviewer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,10 @@ open class Reviewer :
openCardInfo(fromGesture)
return true
}
ViewerCommand.RESCHEDULE_NOTE -> {
showRescheduleCardDialog()
return true
}
else -> return super.executeCommand(which, fromGesture)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ object UsageAnalytics {
"binding_SHOW_HINT",
"binding_SHOW_ALL_HINTS",
"binding_ADD_NOTE",
"binding_RESCHEDULE_NOTE",
// Accessibility
"cardZoom",
"imageZoom",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ enum class ViewerCommand(val resourceId: Int) {
CHANGE_WHITEBOARD_PEN_COLOR(R.string.title_whiteboard_editor),
SHOW_HINT(R.string.gesture_show_hint),
SHOW_ALL_HINTS(R.string.gesture_show_all_hints),
ADD_NOTE(R.string.menu_add_note);
ADD_NOTE(R.string.menu_add_note),
RESCHEDULE_NOTE(R.string.card_editor_reschedule_card);

companion object {
val allDefaultBindings: List<MappableBinding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ class ViewerCommandTest {
"binding_TOGGLE_FLAG_PINK, binding_TOGGLE_FLAG_TURQUOISE, binding_TOGGLE_FLAG_PURPLE, " +
"binding_UNSET_FLAG, binding_PAGE_UP, binding_PAGE_DOWN, binding_TAG, binding_CARD_INFO, binding_ABORT_AND_SYNC, " +
"binding_RECORD_VOICE, binding_REPLAY_VOICE, binding_TOGGLE_WHITEBOARD, binding_CLEAR_WHITEBOARD, " +
"binding_CHANGE_WHITEBOARD_PEN_COLOR, binding_SHOW_HINT, binding_SHOW_ALL_HINTS, binding_ADD_NOTE",
"binding_CHANGE_WHITEBOARD_PEN_COLOR, binding_SHOW_HINT, binding_SHOW_ALL_HINTS, binding_ADD_NOTE, " +
"binding_RESCHEDULE_NOTE",
names
)
}
Expand Down

0 comments on commit 98b40a6

Please sign in to comment.