I'm having trouble with styling buttons in my app, I've tried using selectors, themes but none of that has worked for me (or worked but not as intended), any ideas what should I change to set it up correctly?
code:
one of buttons (the dark theme one (should swap colors from black to violet(when activated))
<Button
android:id="@+id/dark_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:theme="@style/buttonDark"
android:text="dark"
app:icon="@drawable/ic_moon"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
style:
<style name="buttonDark" >
<item name="android:state_active">@color/black</item>
<item name="android:textColor">@color/white</item>
<item name="android:state_pressed">@color/violet</item>
</style>
representation of the both light mode and dark mode (and the buttons in both):