editText tint line color not changing in night mode

I have editText in my layout

<EditText
 android:id="@+id/etMarks1"
 style="@style/Marks"/>

and theme.xml

    <style name="Marks" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
        <item name="android:layout_weight">15</item>
        <item name="android:ems">1</item>
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:inputType">number</item>
        <item name="android:textSize">18sp</item>
        <item name="android:gravity">center</item>
    </style>

The tint line color is black by default and it is changing to white in night mode when I tested in Samsung and Pixel devices (Android Q).
But when I tested in Redmi Note 8 (Android Q), it remains black as it is! remaining components are working fine.

I tried to manually define the tint line color in theme.xml(nignt)

<item name ="backgroundTint">@color/white</item>
<item name="colorControlNormal">@color/black</item>

But, it is not working,
Any Solution for this ?

Source: Android Questions

LEAVE A COMMENT