Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Theme.MaterialComponents.DayNight not found

In my build.gradle, I included the material design library(version 1.1.0) but in styles.xml, when I try to use Theme.MaterialComponents.DayNight, it says cannot resolve symbol. Wasn't the DayNight theme already implemented in material design library 1.1.0? Please help. Thanks.

like image 220
LCZ Avatar asked Dec 27 '19 04:12

LCZ


1 Answers

https://m3.material.io/

https://m3.material.io/libraries/mdc-android/getting-started

According to the Material design 3 latest version is 1.5.0

implementation 'com.google.android.material:material:1.5.0'

style.xml

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.Material3.DayNight">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>
like image 65
Jaydeep chatrola Avatar answered Oct 24 '22 06:10

Jaydeep chatrola