How to fix UI to Light mode

45 views Asked by At

I've been cracking my head to fix my app to work in Light Mode even when user changes phones UI to Dark Mode ie I want this pic layout to be fixed in This Light Mode But when I select Dark Mode in my phone all I get isThis Dark Modeand it looks really bad.

This is what my styles file look like

<resources>
    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.MaterialComponents.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

</resources>

I've literally tried everything like

> android:forceDarkAllowed="false" (In xml File)
> AppCompatDelegate.setDefaultNightMode()  (In Kotlin file)
> val currentNightMode = configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK  (In Kt file)

Help me find the solution.

1

There are 1 answers

0
cactustictacs On

You just want a light theme? You're using a dark one, change it to this

<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">