I want to have my buttons to have the colors I specified, but otherwise still look and behave like the standard buttons. So I searched and found this. I followed the advice given there, but the background color stays the standard grey. Any Idea where I´m going wrong?
In my styles.xml I put this:
<style name="AppTheme.Button" parent="Widget.AppCompat.Button.Borderless.Colored">
<item name="android:colorButtonNormal">@color/colorButtonDark</item>
<item name="android:textColor">@color/colorAccent</item>
</style>
My colors are these:
<resources>
[...]
<color name="colorAccent">#ffffff</color>
<color name="colorButtonDark">#300a03</color>
</resources>
And one example Button looks like this:
<Button
android:text="exampleButton"
android:layout_width="0dp"
android:layout_height="0dp"
android:id="@+id/button7" android:layout_marginTop="8dp"
app:layout_constraintTop_toTopOf="@+id/guideline19" android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/guideline"
android:layout_marginStart="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:theme="@style/AppTheme.Button"/>