Документы о кнопке материала говорят:
Для заполненных кнопок этот класс использует ?attr/colorPrimary вашей темы для цвета оттенка фона и ?attr/colorOnPrimary для цвета текста.
Но кнопка берет цвет акцента темы. Это моя тема приложения:
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
Код кнопки:
<com.google.android.material.button.MaterialButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:text="Material button">
</com.google.android.material.button.MaterialButton>
Цвета.xml:
<resources>
<color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#00574B</color>
<color name="colorAccent">#D81B</color>
</resources>
Манифест:
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
Я не знаю, чего мне не хватает в документах.
AppTheme
в своем приложении? Не могли бы вы показать нам свой файлcolors.xml
, содержащий определения цвета/цвета дляcolorPrimary
? КнопкаMaterialButton
заполнена? - person Edric   schedule 06.01.2020