MaterialDialog-Android icon indicating copy to clipboard operation
MaterialDialog-Android copied to clipboard

[ISSUE] Theme is not changed in api 32

Open elboyev opened this issue 3 years ago • 1 comments

I have two themes.xml, day and night. And I tried to add custom material dialog items to themes.xml but style did not change

<resources xmlns:tools="http://schemas.android.com/tools">
    <!-- Base application theme. -->
    <style name="Theme.DANISHBETON" parent="Theme.MaterialComponents.Light.NoActionBar">
        <!-- Primary brand color. -->
        <item name="colorPrimary">@color/purple_500</item>
        <item name="colorPrimaryVariant">@color/purple_700</item>
        <item name="colorOnPrimary">@color/white</item>
        <!-- Secondary brand color. -->
        <item name="colorSecondary">@color/teal_200</item>
        <item name="colorSecondaryVariant">@color/teal_700</item>
        <item name="colorOnSecondary">@color/black</item>
        <!-- Status bar color. -->
        <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
        <!-- Customize your theme here. -->
        <!-- MD. -->
        <item name="material_dialog_background">#FFFFFF</item>
        <item name="material_dialog_title_text_color">#000000</item>
        <item name="material_dialog_message_text_color">#5F5F5F</item>
        <item name="material_dialog_positive_button_color">@color/danisred</item>
        <item name="material_dialog_positive_button_text_color">#FFFFFF</item>
        <item name="material_dialog_negative_button_text_color">@color/danisred</item>
    </style>
<resources>

elboyev avatar Apr 01 '22 20:04 elboyev

Oh! I found out how to do it. You add this line to the bottom of the theme: <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant

That's because I'm using the latest Android Studio Version.

Granddaster avatar Nov 14 '22 07:11 Granddaster