mifos-mobile
mifos-mobile copied to clipboard
Fixed #2713
Fixes #Issue_Number
Please Add Screenshots If there are any UI changes.
Please make sure these boxes are checked before submitting your pull request - thanks!
-
[x] Apply the
AndroidStyle.xmlstyle template to your code in Android Studio. -
[x] Run the unit tests with
./gradlew checkto make sure you didn't break anything -
[x] If you have multiple commits please combine them into one commit by squashing them.
UI Changes
we no need to configuring it manually this should be provided by EnableEdgeToEdge Api, you could configure theme for night & dark mode like below
update splash.xml
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Allows us to override night specific attributes in the
values-night folder. -->
<style name="NightAdjusted.Theme" parent="android:Theme.Material.Light.NoActionBar">
<item name="android:statusBarColor">@color/status_bar</item>
</style>
<!-- The final theme we use -->
<style name="Theme.Mifos" parent="NightAdjusted.Theme" />
<style name="NightAdjusted.Theme.Splash" parent="Theme.SplashScreen">
<item name="android:windowLightNavigationBar" tools:targetApi="27">true</item>
</style>
<style name="Theme.Mifos.Splash" parent="NightAdjusted.Theme.Splash">
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_icon</item>
<item name="postSplashScreenTheme">@style/Theme.Mifos</item>
</style>
</resources>
create values-night folder and create theme.xml, colors.xml file
values-night/theme.xml would be look like this
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="NightAdjusted.Theme" parent="android:Theme.Material.NoActionBar">
<item name="android:statusBarColor">@color/status_bar</item>
</style>
<style name="NightAdjusted.Theme.Splash" parent="Theme.SplashScreen">
<item name="android:windowLightNavigationBar" tools:targetApi="27">false</item>
</style>
</resources>
color.xml
<color name="status_bar">#FFFEFBFF</color> // light/color.xml
<color name="status_bar">#FF1B1B1F</color> // dark/color.xml
HomeActivity.kt
setContent {
val darkTheme = isSystemInDarkTheme()
// Update the dark content of the system bars to match the theme
DisposableEffect(darkTheme) {
enableEdgeToEdge(
statusBarStyle = SystemBarStyle.auto(
Color.TRANSPARENT,
Color.TRANSPARENT,
) { darkTheme },
navigationBarStyle = SystemBarStyle.auto(
lightScrim,
darkScrim,
) { darkTheme },
)
onDispose {}
}
}
you may need to configure TopAppBar colors as well, update DarkThemeColors
surface = BackgroundDark
you may need to do some small tweaks to match these StatusBar, NavigationBar and Surface colors to same.
@yashc18 Closing this PR since there's no update on requested changes