feat(whiteboard): support gestures/keybinds#20268
feat(whiteboard): support gestures/keybinds#20268BrayanDSO wants to merge 5 commits intoankidroid:mainfrom
Conversation
|
Important Maintainers: This PR contains Strings changes
|
6fb0f6f to
cb2d474
Compare
cb2d474 to
e8014a6
Compare
9e468e3 to
f0239f8
Compare
f0239f8 to
032c8f2
Compare
032c8f2 to
7a96ffa
Compare
| REDO, | ||
| ; | ||
|
|
||
| override val preferenceKey: String get() = "binding_whiteboard_$name" |
There was a problem hiding this comment.
name is subject to accidental refactor and we need to guard against this.
|
|
||
| val dx = abs(startX - currentX) | ||
| val dy = abs(startY - currentY) | ||
| if (dx >= touchSlop || dy >= touchSlop) { |
There was a problem hiding this comment.
Could you make a comment on the math here, this doesn't need to be 'fixed', but a future implementor should be aware:
I suspect this doesn't matter as the refresh rate on most devices will be massive, so the position deltas will be small
If a large MotionEvent occurs, this code will pick the midway point from the start and the end. If the extremity is used, it may be outside the tap tolerance.
There was a problem hiding this comment.
should be more correct now
AnkiDroid/src/main/java/com/ichi2/anki/ui/windows/reviewer/whiteboard/MultiTouchDetector.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/preferences/ReviewerControlPreference.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/ui/windows/reviewer/ReviewerFragment.kt
Show resolved
Hide resolved
the actions are restricted to 'both' sides of the card to simplify my life coding it. Also, that makes the UX simpler the only gestures available are the multi-finger taps and shake. Swipes and single taps can't be used because they conflict with the screen functionality
this way, the user can have gestures do different depending whether the whiteboard is enabled
7a96ffa to
35c09cc
Compare
|
@BrayanDSO merge at your discretion. I'd mildly prefer a second look on this one, but don't want it to be blocking |
|
I'd like this in 2.24. If someone doesn't merge it before that, I (or someone else) should do it |
Fixes
Approach
Question and Answergestures are acceptedHow Has This Been Tested?
Galaxy Tab S9, Android 16
Screen_Recording_20260130_162646_AnkiDroid.mp4
Learning (optional, can help others)
Working on architecture is paying off. This was way easier than I expected by extending stuff instead of reorganizing everything.
Checklist
Please, go through these checks before submitting the PR.