-
Notifications
You must be signed in to change notification settings - Fork 658
fix(feature:client): fix signature reset issue and enforce white canvas background #2417
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
fix(feature:client): fix signature reset issue and enforce white canvas background #2417
Conversation
| val drawBrush = 5f | ||
|
|
||
| val paths = remember { mutableStateListOf<PathState>() } | ||
| val drawingState = remember { DrawingState() } |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
Thanks for the suggestion! While rememberSaveable works great for primitive types (which it handles automatically), DrawingState uses non-serializable types like Path, so it would require a custom Saver. I explored that, but given users can easily re-sign if the screen rotates, the added complexity doesn’t offer much real value. Keeping it simple for now.
Reference: UI Logic with rememberSaveable
rememberSaveable stores UI element state in a Bundle through the saved instance state mechanism.
It is able to store primitive types to the bundle automatically. If your state is held in a type that is not primitive, like a data class, you can use different storing mechanisms, such as using the Parcelize annotation, using Compose APIs like listSaver and mapSaver, or implementing a custom saver class extending Compose runtime Saver class.
niyajali
left a comment
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.
@biplab1 you can try this CMP library - https://github.com/niyajali/compose-signature
|
@niyajali Thanks for the suggestion! I'll check out the CMP library and see if it fits our use case. |
…as background (openMF#2417) Co-authored-by: Sk Niyaj Ali <niyaj639@gmail.com>
…as background (openMF#2417) Co-authored-by: Sk Niyaj Ali <niyaj639@gmail.com>
Fixes - Jira-#478
Change Summary:
Before Fix (Dark Mode):
before-fix-client-signature-dark-mode.mp4
After Fix (Dark Mode):
after-fix-client-signature-dark-mode.mp4
Light Mode:
client-signature-light-mode.mp4
Signature Reset and Upload from Gallery:
upload-from-gallery-and-reset.mp4
Run the static analysis check
./gradlew checkorci-prepush.shto make sure you didn't break anythingIf you have multiple commits please combine them into one commit by squashing them.