Skip to content

Conversation

@krystek-dev
Copy link
Collaborator

This commit introduces a MainViewModel that handles the logic for generating random names.

Key changes:

  • Added MainViewModel to manage UI state and business logic.
  • Implemented onClick function in MainViewModel to increment a counter and generate a new random name using a Repository.
  • The MainActivity now observes the state from MainViewModel and displays the generated names in a LazyColumn.
  • Added a Button to trigger the name generation.
  • Introduced a Repository class responsible for generating random strings.
  • The UI now displays a list of generated names, with a horizontal divider between them.
  • The button text dynamically updates to show the length of the next name to be generated.

This commit introduces a `MainViewModel` that handles the logic for generating random names.

Key changes:
- Added `MainViewModel` to manage UI state and business logic.
- Implemented `onClick` function in `MainViewModel` to increment a counter and generate a new random name using a `Repository`.
- The `MainActivity` now observes the state from `MainViewModel` and displays the generated names in a `LazyColumn`.
- Added a `Button` to trigger the name generation.
- Introduced a `Repository` class responsible for generating random strings.
- The UI now displays a list of generated names, with a horizontal divider between them.
- The button text dynamically updates to show the length of the next name to be generated.
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.

2 participants