android-templates
android-templates copied to clipboard
[#553] Define BaseScreen composable for all screens
Closes https://github.com/nimblehq/android-templates/issues/553
What happened 👀
- Create a
BaseScreen
composable for all screens, as we did withBaseActivity
orBaseFragment
. - Add
accompanist-systemuicontroller
to demo the status bar color changing between screens.
Insight 📝
The BaseScreen
will contain base parameters to request & base logic in the body to execute for all screens.
@Composable
fun BaseScreen(
// TODO Base parameters to request on all screens here
content: @Composable () -> Unit,
) {
// TODO Base logic for all screens here
content()
}
Proof Of Work 📹
https://github.com/nimblehq/android-templates/assets/16315358/4de60402-020a-4eb5-ab22-e3963693cebc
3 Warnings | |
---|---|
:warning: | Uh oh! BaseScreen.kt is under 95% coverage! |
:warning: | Uh oh! HomeScreen.kt is under 95% coverage! |
:warning: | Uh oh! Your project is under 80% coverage! |
Kover report for template-compose:
🧛 Template - Compose Unit Tests Code Coverage: 61.54%
Coverage of Modified Files:
File | Coverage |
---|---|
BaseScreen.kt |
50.77% |
HomeScreen.kt |
65.00% |
Modified Files Not Found In Coverage Report:
ComposableUtil.kt SecondScreen.kt ThirdScreen.kt Versions.kt build.gradle.kts colors.xml styles.xml
Codebase cunningly covered by count Shroud 🧛
Generated by :no_entry_sign: Danger
Just one concern. Isn't accompanist-systemuicontroller
deprecated? Is it a good idea to keep using it for the project?
@luongvo Please resolve the conflict 🙏🏼
Just one concern. Isn't
accompanist-systemuicontroller
deprecated? Is it a good idea to keep using it for the project?
@kaungkhantsoe, I think we can keep the current approach. It's a deprecated approach, but I added it to the sample
project so we can refactor it later. Not a big deal, right?
@chornerman rebased ✅
@ryan-conway This one could be processed now. It's also fine if you want to get more reviews from @nimblehq/chapter-android 🏃