-
-
Couldn't load subscription status.
- Fork 2.5k
fix(new study screen): finish current stroke before changing pen color #19257
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
base: main
Are you sure you want to change the base?
fix(new study screen): finish current stroke before changing pen color #19257
Conversation
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.
The screen is already complex, and the fix makes it even more complex, and doesn't fix it well.
A simpler fix is just to track whether the user is drawing in WhiteboardView, then not allowing to change tools if the user is drawing.
Currently, you can also press other buttons (like the answer buttons) while drawing. Consider whether to disallow that too. |
For now, disable only the whiteboard buttons. Disabling the others will be more complex, and I prefer to stabilize the screen first. |
|
The commits got a bit messy |
|
Please don't create a new PR. Rebase it |
Test fails |
3bc8e60 to
50763fb
Compare
|
@Amitesh-exp rebase it |
50763fb to
338686f
Compare
Screenrecorder-2025-09-28-17-44-43-628.mp4New Fix: Restricts the user from changing color while drawing |
AnkiDroid/src/main/java/com/ichi2/anki/ui/windows/reviewer/whiteboard/WhiteboardView.kt
Outdated
Show resolved
Hide resolved
| .onEach { isCurrentlyDrawing -> | ||
| // When drawing starts, show the blocker. When it stops, hide it. | ||
| touchBlockerView.visibility = if (isCurrentlyDrawing) View.VISIBLE else View.GONE |
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.
Adding an extra layer to block inputs seems much of a hack. A better approach would be disable inputs from the toolbar when user is drawing.
This could be something like if(isDrawing) disableButtons() else enableButtons()
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.
Wouldn't it be even better if the button are not even visible while drawing?
Instead of disabling or enabling them I can make them invisible or visible
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.
Sure, feel free to go ahead. I do not see any conflicting behaviour.
if(isDrawing) showToolbar() else hideToolbar(). Which I believe already exists inside overflowMenuButton.setOnClickListener
@BrayanDSO Any comments?
A plus point from UX pov would be if you can implement slide in/out the toolbar from screen edge (requires more changes + animations)
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.
Don't hide the toolbars while drawing. That's unusual and unexpected
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.
I have done two commits.
In the first, toolbar doesn't hide and in the second, it does.
Is first commit the correct fix?
Screenrecorder-2025-10-09-14-17-35-151.mp4This type of feature where toolbar disappears is available in many apps where drawing screen is present. Doesn't look unusual too. |
|
Hey, sorry for the long waiting, I was away the time. I think it's a totally subjective choice Will let @BrayanDSO to tak the call here.
or
|
new.study.screen.fix.issue.19236.mp4
Purpose / Description
When drawing, if the user tapped with another finger to change the brush color, the stroke would continue instead of ending. This caused unexpected merging of strokes with the wrong color.
Fixes
Approach
drawFinish()),isCurrentlyDrawingis reset, and the brush change is applied cleanly.How Has This Been Tested?
Checklist
Please, go through these checks before submitting the PR.