Let module remove button support disable state

This commit is contained in:
RikkaW 2022-06-01 20:57:54 +08:00 committed by John Wu
parent 6a2ae89846
commit 4cc5e9f986
3 changed files with 9 additions and 6 deletions

View File

@ -148,7 +148,7 @@
<Button
android:id="@+id/module_remove"
style="@style/WidgetFoundation.Button.Text.Secondary"
style="@style/WidgetFoundation.Button.Text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
@ -157,6 +157,7 @@
android:onClick="@{() -> item.delete()}"
android:text="@{item.removed ? @string/module_state_restore : @string/module_state_remove}"
android:textAllCaps="false"
android:theme="@style/ThemeOverlay.Button.Text.Secondary"
app:icon="@{item.removed ? @drawable/ic_restart : @drawable/ic_delete_md2}"
app:iconGravity="textEnd"
app:layout_constraintEnd_toEndOf="parent"

View File

@ -61,11 +61,6 @@
<item name="iconPadding">@dimen/l_50</item>
</style>
<style name="WidgetFoundation.Button.Text.Secondary">
<item name="android:textColor">?colorSecondary</item>
<item name="iconTint">?colorSecondary</item>
</style>
<style name="WidgetFoundation.Button.Text.OnPrimary">
<item name="rippleColor">?colorOnPrimary</item>
<item name="android:textColor">?colorOnPrimary</item>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="ThemeOverlay.Button.Text.Secondary" parent="">
<item name="colorPrimary">?colorSecondary</item>
</style>
</resources>