Updated module sections so it looks more consistent

This commit is contained in:
Viktor De Pasquale
2019-11-11 19:36:40 +01:00
parent 82120cf47f
commit 495e734428
5 changed files with 40 additions and 99 deletions
+4 -3
View File
@@ -32,13 +32,14 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:animateLayoutChanges="true">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/module_state_icon"
style="?styleImageSmall"
gone="@{!item.removed &amp;&amp; !item.updated}"
srcCompat="@{item.removed ? R.drawable.ic_delete_md2 : R.drawable.ic_update_md2}"
srcCompat="@{item.removed ? R.drawable.ic_delete_md2 : (item.updated ? R.drawable.ic_update_md2 : 0)}"
android:layout_marginStart="@dimen/l1"
android:background="@null"
app:layout_constraintBottom_toBottomOf="@+id/module_version_author"
@@ -101,7 +102,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="@{(v) -> item.delete(viewModel)}"
android:text="@{item.removed ? `Restore` : `Remove`}"
android:text="@{item.removed ? @string/module_state_restore : @string/module_state_remove}"
android:textAllCaps="false"
app:icon="@{item.removed ? R.drawable.ic_restart : R.drawable.ic_delete_md2}"
app:iconGravity="textEnd"
+7 -1
View File
@@ -8,10 +8,15 @@
name="item"
type="com.topjohnwu.magisk.model.entity.recycler.SectionTitle" />
<variable
name="viewModel"
type="com.topjohnwu.magisk.redesign.module.ModuleViewModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:animateLayoutChanges="true"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatTextView
@@ -30,7 +35,8 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/module_button"
style="?styleButtonText"
gone="@{item.button == 0 || item.icon == 0}"
gone="@{!item.hasButton}"
android:onClick="@{() -> viewModel.sectionPressed(item)}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
+3 -1
View File
@@ -76,8 +76,10 @@
<string name="module_safe_mode_message">You\'re in safe mode. None of user modules will work.\nThis message will disappear once safe mode is disabled.</string>
<string name="module_version_author">%1$s by %2$s</string>
<string name="module_section_pending">Pending changes</string>
<string name="module_section_active">Active</string>
<string name="module_section_installed">Installed</string>
<string name="module_section_remote">Remote</string>
<string name="module_state_remove">Remove</string>
<string name="module_state_restore">Restore</string>
<string name="superuser_toggle_log">Toggles logging</string>
<string name="superuser_toggle_notification">Toggles “toast” notifications</string>