Skip to content

feature/exit_confirm_dialog#12

Merged
dev-ali-mansour merged 23 commits intomainfrom
feature/exit_confirm_dialog
Nov 19, 2025
Merged

feature/exit_confirm_dialog#12
dev-ali-mansour merged 23 commits intomainfrom
feature/exit_confirm_dialog

Conversation

@dev-ali-mansour
Copy link
Owner

No description provided.

Introduces a new reusable `ConfirmDialog` Composable function. This dialog displays a title, a message, and provides "OK" and "Cancel" buttons for user confirmation.
Adds a new Kotlin extension property, `activity`, to the `Context` class.

This utility allows for retrieving the `Activity` from any `Context` by traversing the `ContextWrapper` hierarchy. If no `Activity` is found, it throws an `IllegalStateException`.
Introduces an exit confirmation dialog when the back button is pressed on the home screen.

This is achieved by:
- Adding `openDialog` to `HomeState` to control the dialog's visibility.
- Adding a new `ExitApp` `HomeEffect` to close the application.
- Adding `OnBackPress`, `OnExitDialogConfirmed`, and `OnExitDialogCancelled` events to `HomeEvent` to handle user interactions with the back button and the dialog.
Introduces a confirmation dialog when the user presses the back button on the home screen.

This change adds the following events to `HomeViewModel`:
*   `OnBackPress`: Sets a flag to show the exit dialog.
*   `OnExitDialogConfirmed`: Triggers an effect to close the application.
*   `OnExitDialogCancelled`: Hides the dialog.
Introduces an exit confirmation dialog on the `HomeScreen`.

Key changes:
- A `BackHandler` is added to intercept the back press event.
- Pressing back now triggers a confirmation dialog asking the user if they want to exit the app.
- New `HomeEffect.ExitApp`, `HomeEvent.OnBackPress`, `HomeEvent.OnExitDialogConfirmed`, and `HomeEvent.OnExitDialogCancelled` are handled to manage the dialog's state and app exit logic.
- New string resources for the dialog title and message have been added.
Adds a new "Screenshots" section to the `README.md` file, showcasing the application's user interface with four new images.
Revamps the `README.md` to provide detailed instructions for setting up the project for contribution, including:
- Forking the repository.
- Configuring required GitHub secrets (`KEYSTORE_PASSWORD`, `KEY_ALIAS`, `KEY_PASSWORD`, `ANDROID_KEYSTORE`, `GOOGLE_PLAY_AUTH_JSON`) for the CI/CD workflows.
- Commands and links for creating an Android keystore and a Google Play service account.

The existing "Clone the repository" section is repurposed for users who only want to build and run the app locally, and the subsequent steps are renumbered accordingly.
Adds the `core/ui` layer to the architecture breakdown in the `README.md` file, describing it as the location for shared UI components, theme, and helper functions.
Removes the top-level `duration` metadata property from the codelab's frontmatter.

Additionally, it formats the duration for the "Introduction" section from `4` to `4:00`.
Removes the unnecessary `----` divider from the frontmatter section of the `codelab.md` file.
Updates the image source paths in `codelab/codelab.md` to be relative to the current directory (`./images/`) instead of the parent directory (`../images/`).
Updates the `codelab.yml` workflow to use the `-prefix "My-Tasks"` option when running the `claat export` command. This ensures that generated links for assets like CSS and images are correctly prefixed.

The step for renaming the output directory has been kept, as the folder name is determined by the `id` in the codelab's metadata, not the prefix.
Sets the `home` property in the `codelab.md` frontmatter to `/My-Tasks/`. This allows the removal of the `-prefix "My-Tasks"` argument from the `claat export` command in the `codelab.yml` workflow, as the tool will now use the `home` property to configure the base path.
Updates the `home` URL in `codelab.md` from a relative path (`/My-Tasks/`) to an absolute GitHub Pages URL.
Updates the codelab metadata in `codelab/codelab.md` to a new format.

Key changes include:
- Renaming `category` to `categories`.
- Renaming `author` to `authors`.
- Renaming `lastupdated` to `updated`.
- Renaming `environment` to `environments`.
- Adding `tags`, `source`, and `feedback link` fields.
Adds an "About this codelab" section to `codelab/codelab.md` which includes:
- Last Updated date
- Author
- Links to the source GitHub repository and for submitting feedback.
Updates the `README.md` file with several formatting improvements:

- Fixes the paths for screenshot images.
- Adds newlines for better readability in the "Tech Stack" section.
- Corrects inconsistent indentation and spacing throughout the document.
Removes the `runs-on` value in the `validate_pr_sources` job within the codelab documentation, replacing it with a `TODO` comment to configure the runner to the latest Ubuntu version.
Removes the `runs-on` value in the `validate_pr_sources` job within the codelab documentation, replacing it with a `TODO` comment to configure the runner to the latest Ubuntu version.
@dev-ali-mansour dev-ali-mansour self-assigned this Nov 19, 2025
@dev-ali-mansour dev-ali-mansour merged commit af0c76b into main Nov 19, 2025
3 of 4 checks passed
@dev-ali-mansour dev-ali-mansour deleted the feature/exit_confirm_dialog branch February 14, 2026 12:07
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.

1 participant