Skip to content
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

Replace Menu with ModalBottomSheet and add UiEvents, UiState #161

Merged
merged 9 commits into from May 19, 2023

Conversation

dead8309
Copy link
Owner

Previously, the UI event handling in the CustomScreenViewModel relied on a different approach. This pr refactors the implementation to utilize channels for improved readability and conciseness.

Changes Made:

  • Replace DrowDownMenu with a new ModalBottomSheet component.
  • Add UiState Data class for storing all fields value along with some dialogs visibility values.
  • Add UiEvent interface for passing events from UI to ViewModel.
  • Introduced a new channel, uiEventChannel, to queue UI events.
  • Modified the onEvent function to send events to the uiEventChannel.
  • Added a coroutine in the init block to consume events from the uiEventChannel and process them sequentially.
  • Updated the processEvent function to handle events and update the UI state accordingly.

@dead8309 dead8309 merged commit 06d1ad3 into master May 19, 2023
1 check passed
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.

None yet

1 participant