Мой AppTheme
в styles.xml
выглядит так:
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:textColorPrimary">@color/textColorPrimary</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
</style>
Я установил это в манифесте как:
<application
android:name=".MyApp"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
Согласно https://material.io/develop/android/components/ Цвет по умолчанию примененный к моим виджетам, должен быть заданным colorPrimary, но мой выбирает colorAccent как цвет по умолчанию. Например, эта кнопка:
<com.google.android.material.button.MaterialButton
android:id="@+id/loginButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="56dp"
android:layout_marginEnd="56dp"
android:text="login"
app:cornerRadius="5dp"
app:elevation="0dp"
app:fontFamily="@font/gotham_bold" />
Мне не хватает определенной конфигурации для этого проекта, чтобы кнопка отображала colorPrimary
, а не colorAccent
?