zafar
zafar

Reputation: 53

Theme.MaterialComponents.DayNight.NoActionBar is not working in light mode but work when dark mode is enable in android 14

My custom theme doesn't function when the mobile device is in light mode, but it does work when switched to dark mode on Android 14.(light and dark mode of system(mobile)).and show the white screen when light mode On.

<style name="Base.Theme.Client" parent="Theme.MaterialComponents.DayNight.NoActionBar">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorOnPrimary">@color/client_gray_50</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorOnSurface">@color/client_black</item>
        <item name="colorAccent">@color/colorAccent</item>
        <item name="colorSurface">@color/client_gray_50</item>
        <item name="colorSecondary">@color/client_gray_500</item>
        <item name="android:textColorPrimary">@color/black_87</item>
        <item name="android:textColorSecondary">#77000000</item>
        <item name="android:textColorPrimaryDisableOnly">@color/white</item>
        <item name="android:colorBackground">@color/client_background</item>
        <item name="android:panelColorBackground">@color/white</item>
        <item name="android:selectedWeekBackgroundColor">@color/client_gray_500</item>
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
        <item name="android:forceDarkAllowed" tools:targetApi="q">false</item>

        <item name="textInputStyle">@style/Style.Client.TextInputLayout</item>
    </style>

    <style name="Theme.Client" parent="Base.Theme.Client" />

in AndroidManifest.xml

  <application
        android:name="com.embraceit.cubivue.dao.ekl.MainApplication"
        android:hardwareAccelerated="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:requestLegacyExternalStorage="true"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.Client"
        android:usesCleartextTraffic="true"
        tools:replace="android:theme,android:icon">

i tried different ways but not able to fix it like

Upvotes: 0

Views: 28

Answers (0)

Related Questions