I have this button, style and color states file:
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button1"
style="@style/btnGreen"/>
<style name="btnGreen" parent="Widget.MaterialComponents.Button">
<item name="android:textStyle">bold</item>
<item name="backgroundTint">@color/color_states_btn_green</item>
</style>
Color states: color_states_btn_green.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="#00FF00" android:state_enabled="true" />
<item android:alpha="0.10" android:color="#00FF00"/>
</selector>
Goal is:
Button enabled => enabled style of Widget.MaterialComponents.Button
Button disabled => disabled style of Widget.MaterialComponents.Button.OutlinedButton
I need something like this (pseudocode):
<selector>
<item style="Widget.MaterialComponents.Button.OutlinedButton" android:state_enabled="false"/>
</selector>
How can I achieve this? I do not change button attributes programmatically, because there is problem to switch between Day & Night without recreating. Thank you.