Overhaul SettingsItem

Close #5021
This commit is contained in:
topjohnwu
2022-01-22 05:25:36 -08:00
parent 761a8dde65
commit 5313a46aa2
6 changed files with 163 additions and 218 deletions
@@ -42,7 +42,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textUri"
android:text="@={data.result}"
android:text="@={data.inputResult}"
android:textAppearance="@style/AppearanceFoundation.Body"
android:textColor="?colorOnSurface"
tools:text="@tools:sample/lorem" />
@@ -34,7 +34,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textUri"
android:text="@={data.result}"
android:text="@={data.inputResult}"
android:textAppearance="@style/AppearanceFoundation.Body"
android:textColor="?colorOnSurface"
tools:text="@tools:sample/lorem" />
+4 -4
View File
@@ -10,8 +10,8 @@
type="com.topjohnwu.magisk.ui.settings.BaseSettingsItem" />
<variable
name="callback"
type="com.topjohnwu.magisk.ui.settings.BaseSettingsItem.Callback" />
name="handler"
type="com.topjohnwu.magisk.ui.settings.BaseSettingsItem.Handler" />
</data>
@@ -23,7 +23,7 @@
android:alpha="@{item.enabled ? 1f : .5f}"
android:clickable="@{item.enabled}"
android:focusable="@{item.enabled}"
android:onClick="@{(view) -> item.onPressed(view, callback)}"
android:onClick="@{(view) -> item.onPressed(view, handler)}"
tools:layout_gravity="center">
<LinearLayout
@@ -81,7 +81,7 @@
android:layout_height="wrap_content"
android:checked="@{item.checked}"
android:focusable="@{item.enabled}"
android:onCheckedChanged="@{(v, c) -> item.onToggle(v, callback, c)}" />
android:onCheckedChanged="@{(v, c) -> item.onToggle(v, handler, c)}" />
</LinearLayout>