Skip to content

Conversation

@biplab1
Copy link
Contributor

@biplab1 biplab1 commented Jun 26, 2025

Fixes - Jira-#478

Change Summary:

  • Forced canvas background to white in all themes to ensure black ink signatures are visible and export-ready.
  • Fixed reset button not clearing the canvas by using a shared DrawingState and adding a clear() method.

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 check or ci-prepush.sh to make sure you didn't break anything

  • If you have multiple commits please combine them into one commit by squashing them.

@biplab1 biplab1 changed the title fix(feature:client): force white canvas background in signature screen fix(feature:client): fix signature reset issue and enforce white canvas background Jun 26, 2025
val drawBrush = 5f

val paths = remember { mutableStateListOf<PathState>() }
val drawingState = remember { DrawingState() }

This comment was marked as resolved.

Copy link
Contributor Author

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.

Copy link
Collaborator

@niyajali niyajali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@niyajali niyajali merged commit 39a3290 into openMF:kmp-impl Jun 27, 2025
1 check passed
@biplab1
Copy link
Contributor Author

biplab1 commented Jun 27, 2025

@niyajali Thanks for the suggestion! I'll check out the CMP library and see if it fits our use case.

itsPronay pushed a commit to itsPronay/android-client that referenced this pull request Aug 5, 2025
…as background (openMF#2417)

Co-authored-by: Sk Niyaj Ali <niyaj639@gmail.com>
itsPronay pushed a commit to itsPronay/android-client that referenced this pull request Aug 5, 2025
…as background (openMF#2417)

Co-authored-by: Sk Niyaj Ali <niyaj639@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants