| name | android-screen-generator |
| description | Generates a new screen (Activity, Screen Composable, ViewModel) and registers it in the manifest and DI module. Use this when the user wants to add a new screen or feature to the app. |
Android Screen Generator
This skill automates the creation of a new screen in the CrystalScan project.
Workflow
- Determine the screen name: Ask the user for the screen name (e.g., "About", "Profile").
- Update Strings:
- Add a new string resource to
app/src/main/res/values/strings.xml.
- Name it
title_{{name_lower}} with the value {{name_title}}.
- Generate Files:
- Create a new package under
app/src/main/java/app/pwhs/crystalscan/presentation/ named with the lowercase screen name.
- Create
{{name}}Screen.kt using assets/Screen.kt.template.
- Create
{{name}}Activity.kt using assets/Activity.kt.template.
- Create
{{name}}ViewModel.kt using assets/ViewModel.kt.template.
- Register Activity:
- Add the new Activity to
app/src/main/AndroidManifest.xml.
- Use
android:exported="false", android:theme="@style/Theme.CrystalScan", and android:label="@string/title_{{name_lower}}".
- Register ViewModel:
- Add the ViewModel to
app/src/main/java/app/pwhs/crystalscan/di/AppModule.kt using viewModel { {{name}}ViewModel() }.
Templates
Use the templates in the assets/ directory and replace {{name_title}} with the PascalCase name and {{name_lower}} with the lowercase name.