feat: make possible to hide the whiteboard toolbar#20274
feat: make possible to hide the whiteboard toolbar#20274lukstbit merged 2 commits intoankidroid:mainfrom
Conversation
|
Important Maintainers: This PR contains Strings changes
|
32230d8 to
e74a5c5
Compare
e74a5c5 to
bd1395d
Compare
AnkiDroid/src/main/java/com/ichi2/anki/ui/windows/reviewer/whiteboard/WhiteboardToolbar.kt
Outdated
Show resolved
Hide resolved
| if (!isShown) { | ||
| hideToolbar() | ||
| } |
There was a problem hiding this comment.
Is it possible to sync the UI state here on both show & hide?
| binding.innerControlsLayout.orientation = if (isVertical) LinearLayout.VERTICAL else LinearLayout.HORIZONTAL | ||
| currentAlignment = alignment | ||
|
|
||
| val isVertical = alignment == ToolbarAlignment.LEFT || alignment == ToolbarAlignment.RIGHT |
There was a problem hiding this comment.
nit: this is unintuitive, comment, naming change or adding a property to ToolbarAlignment
There was a problem hiding this comment.
went with:
// Check if the toolbar is docked to a side edge (Left/Right).
val isSideDocked = alignment == ToolbarAlignment.LEFT || alignment == ToolbarAlignment.RIGHTnot sure if it is good enough
AnkiDroid/src/main/java/com/ichi2/anki/ui/windows/reviewer/whiteboard/WhiteboardToolbar.kt
Outdated
Show resolved
Hide resolved
| val dx = event.rawX - dragStartX | ||
| val dy = event.rawY - dragStartY |
There was a problem hiding this comment.
nit: I don't think it's worth it, but a Point class would allow:
val (dx, dy) = event.toPoint() - dragStart
AnkiDroid/src/main/java/com/ichi2/anki/ui/windows/reviewer/whiteboard/WhiteboardToolbar.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/ui/windows/reviewer/whiteboard/WhiteboardToolbar.kt
Outdated
Show resolved
Hide resolved
the rest of the implementation will be in the next commit. Split to ease the review process.
bd1395d to
fc4dfc5
Compare
fc4dfc5 to
4743a13
Compare
lukstbit
left a comment
There was a problem hiding this comment.
Not going to use this myself but the functionality is nice.
The side positioning makes it a bit harder to hide/show as it's in the path of the predictive gesture but it's not that important.
|
Maintainers: Please Sync Translations to produce a commit with only the automated changes from this PR. Read more about updating strings on the wiki, |
Purpose / Description
The biggest complaint about the new whiteboard was the screen space that it consumed.
So, I'm adding a way to hide it by dragging it outside the screen.
Fixes
Approach
How Has This Been Tested?
Galaxy Tab S9, Android 16
Screen_Recording_20260131_171704_AnkiDroid.mp4
Learning (optional, can help others)
Despite the branch name, it's probably the 7th thing I tried. I don't like much to deal with moving and animating stuff in Android
Checklist
Please, go through these checks before submitting the PR.