android-templates icon indicating copy to clipboard operation
android-templates copied to clipboard

[#553] Define BaseScreen composable for all screens

Open luongvo opened this issue 1 year ago • 3 comments

Closes https://github.com/nimblehq/android-templates/issues/553

What happened 👀

  • Create a BaseScreen composable for all screens, as we did with BaseActivity or BaseFragment.
  • 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

luongvo avatar Oct 06 '23 04:10 luongvo

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

github-actions[bot] avatar Oct 06 '23 04:10 github-actions[bot]

Just one concern. Isn't accompanist-systemuicontroller deprecated? Is it a good idea to keep using it for the project?

kaungkhantsoe avatar Nov 23 '23 05:11 kaungkhantsoe

@luongvo Please resolve the conflict 🙏🏼

chornerman avatar Jan 08 '24 03:01 chornerman

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 ✅

luongvo avatar May 27 '24 17:05 luongvo

@ryan-conway This one could be processed now. It's also fine if you want to get more reviews from @nimblehq/chapter-android 🏃

luongvo avatar Jun 04 '24 04:06 luongvo