You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Reorganize home screen layout
This commit is contained in:
@@ -9,8 +9,6 @@
|
||||
|
||||
<import type="com.topjohnwu.magisk.core.InfoKt" />
|
||||
|
||||
<import type="com.topjohnwu.magisk.core.Config" />
|
||||
|
||||
<import type="com.topjohnwu.magisk.ui.home.MagiskState" />
|
||||
|
||||
<variable
|
||||
@@ -108,17 +106,16 @@
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="@style/W.Home.Card.First"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:alpha="@{viewModel.stateCodeMagisk < 0 ? .5f : 1f}">
|
||||
android:layout_width="wrap_content" >
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/home_magisk_remote_title"
|
||||
android:id="@+id/home_magisk_info_title"
|
||||
style="@style/W.Home.Title"
|
||||
android:text="@string/module_section_remote"
|
||||
android:text="@string/home_device_info_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -127,41 +124,56 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_magisk_remote_title" />
|
||||
app:layout_constraintTop_toBottomOf="@id/home_magisk_info_title" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/home_magisk_remote_version"
|
||||
android:id="@+id/home_magisk_latest_version"
|
||||
style="@style/W.Home.Item.Top"
|
||||
invisible="@{viewModel.stateCodeMagisk < 0}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_magisk_remote_title">
|
||||
app:layout_constraintTop_toBottomOf="@id/home_magisk_info_title" >
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent"
|
||||
android:text="@string/home_extra_version" />
|
||||
android:text="@string/module_section_remote" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent.Right"
|
||||
android:text="@{viewModel.stateVersionMagisk}"
|
||||
tools:text="20.1" />
|
||||
android:text="@{viewModel.isConnected ? viewModel.stateMagiskRemoteVersion : @string/home_extra_stub_na}"
|
||||
tools:text="20.1 (12345)" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/home_magisk_remote_version_code"
|
||||
style="@style/W.Home.Item.Bottom"
|
||||
invisible="@{viewModel.stateCodeMagisk < 0}"
|
||||
android:id="@+id/home_magisk_installed_version"
|
||||
style="@style/W.Home.Item"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_magisk_remote_version">
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_magisk_latest_version">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent"
|
||||
android:text="@string/home_extra_code" />
|
||||
android:text="@string/installed" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent.Right"
|
||||
android:text="@{Integer.toString(viewModel.stateCodeMagisk)}"
|
||||
tools:text="12345" />
|
||||
android:text="@{Info.env.isActive ? viewModel.stateMagiskInstalledVersion : @string/home_extra_stub_na}"
|
||||
tools:text="20.1 (12345)" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/home_magisk_mode"
|
||||
style="@style/W.Home.Item.Bottom"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_magisk_installed_version">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent"
|
||||
android:text="@string/home_extra_mode" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent.Right"
|
||||
android:text="@{Info.env.isActive ? viewModel.stateMagiskMode : @string/home_extra_stub_na}"
|
||||
tools:text="Normal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -181,144 +193,18 @@
|
||||
style="@style/W.Home.Card"
|
||||
gone="@{Info.env.magiskVersionCode < 0}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/home_magisk_internal_title"
|
||||
style="@style/W.Home.Title"
|
||||
android:text="@string/installed"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
style="@style/W.Home.Section"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_magisk_internal_title" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/home_magisk_internal_version"
|
||||
style="@style/W.Home.Item.Top"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_magisk_internal_title">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent"
|
||||
android:text="@string/home_extra_version" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent.Right"
|
||||
android:text="@{Info.env.magiskVersionString}"
|
||||
tools:text="20.1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/home_magisk_internal_version_code"
|
||||
style="@style/W.Home.Item.Bottom"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_magisk_internal_version">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent"
|
||||
android:text="@string/home_extra_code" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent.Right"
|
||||
android:text="@{Integer.toString(Info.env.magiskVersionCode)}"
|
||||
tools:text="12345" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="@style/W.Home.Card"
|
||||
gone="@{Info.env.magiskVersionCode < 0}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/home_magisk_details_title"
|
||||
style="@style/W.Home.Title"
|
||||
android:text="@string/home_details_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
style="@style/W.Home.Section"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_magisk_details_title" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/home_magisk_internal_mode"
|
||||
style="@style/W.Home.Item.Top"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_magisk_details_title">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent"
|
||||
android:text="@string/home_extra_mode" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent.Right"
|
||||
android:text="@{Config.coreOnly ? @string/home_extra_mode_safe : @string/home_extra_mode_normal}"
|
||||
tools:text="Normal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/home_magisk_internal_connection"
|
||||
style="@style/W.Home.Item.Bottom"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_magisk_internal_mode">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent"
|
||||
android:text="@string/home_extra_connection" />
|
||||
|
||||
<!--todo(topjohnwu) fix connection type-->
|
||||
<!--don't forget to bind verbose values to proper resources-->
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/home_magisk_extra_connection_value"
|
||||
style="@style/W.Home.ItemContent.Right"
|
||||
tools:text="Normal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="@style/W.Home.Card"
|
||||
gone="@{Info.env.magiskVersionCode < 0}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="true"
|
||||
android:onClick="@{() -> viewModel.onDeletePressed()}">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:id="@+id/view"
|
||||
style="@style/W.Home.Section"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -340,8 +226,8 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
style="@style/WidgetFoundation.Icon.Error"
|
||||
android:layout_marginTop="@dimen/l_50"
|
||||
android:background="@null"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_magisk_delete"
|
||||
@@ -357,4 +243,4 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
</layout>
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
|
||||
<import type="com.topjohnwu.magisk.core.Info" />
|
||||
|
||||
<import type="com.topjohnwu.magisk.BuildConfig" />
|
||||
|
||||
<import type="com.topjohnwu.magisk.core.InfoKt" />
|
||||
|
||||
<import type="com.topjohnwu.magisk.ui.home.MagiskState" />
|
||||
@@ -106,7 +104,6 @@
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="@style/W.Home.Card.First"
|
||||
android:layout_width="wrap_content"
|
||||
android:alpha="@{viewModel.stateCodeManager < 0 ? .5f : 1f}"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -114,9 +111,9 @@
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/home_manager_remote_title"
|
||||
android:id="@+id/home_manager_info_title"
|
||||
style="@style/W.Home.Title"
|
||||
android:text="@string/module_section_remote"
|
||||
android:text="@string/home_device_info_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -125,59 +122,39 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_manager_remote_title" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_manager_info_title" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/home_manager_remote_version"
|
||||
android:id="@+id/home_manager_latest_version"
|
||||
style="@style/W.Home.Item.Top"
|
||||
invisible="@{viewModel.stateCodeManager < 0}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_manager_remote_title">
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_manager_info_title">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent"
|
||||
android:text="@string/home_extra_version" />
|
||||
android:text="@string/module_section_remote" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent.Right"
|
||||
android:text="@{viewModel.stateVersionManager}"
|
||||
tools:text="20.1" />
|
||||
android:text="@{viewModel.isConnected ? viewModel.stateManagerRemoteVersion : @string/home_extra_stub_na}"
|
||||
tools:text="8.0.0 (123) (10)" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/home_manager_remote_version_code"
|
||||
style="@style/W.Home.Item"
|
||||
invisible="@{viewModel.stateCodeManager < 0}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_manager_remote_version">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent"
|
||||
android:text="@string/home_extra_code" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent.Right"
|
||||
android:text="@{Integer.toString(viewModel.stateCodeManager)}"
|
||||
tools:text="12345" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/home_manager_remote_stub_version_code"
|
||||
android:id="@+id/home_manager_installed_version"
|
||||
style="@style/W.Home.Item.Bottom"
|
||||
invisible="@{viewModel.stateCodeManager < 0}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_manager_remote_version_code">
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_manager_latest_version">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent"
|
||||
android:text="@string/home_extra_stub" />
|
||||
android:text="@string/installed" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent.Right"
|
||||
android:text="@{Integer.toString(viewModel.stateCodeStub)}"
|
||||
tools:text="5" />
|
||||
android:text="@{viewModel.stateManagerInstalledVersion}"
|
||||
tools:text="8.0.0 (123) (10)" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -198,84 +175,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/home_manager_internal_title"
|
||||
style="@style/W.Home.Title"
|
||||
android:text="@string/installed"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
style="@style/W.Home.Section"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_manager_internal_title" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/home_manager_internal_version"
|
||||
style="@style/W.Home.Item.Top"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_manager_internal_title">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent"
|
||||
android:text="@string/home_extra_version" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent.Right"
|
||||
android:text="@{BuildConfig.VERSION_NAME}"
|
||||
tools:text="20.1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/home_manager_internal_version_code"
|
||||
style="@style/W.Home.Item"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_manager_internal_version">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent"
|
||||
android:text="@string/home_extra_code" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent.Right"
|
||||
android:text="@{Integer.toString(BuildConfig.VERSION_CODE)}"
|
||||
tools:text="12345" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/home_manager_internal_stub_version_code"
|
||||
style="@style/W.Home.Item.Bottom"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/home_manager_internal_version_code">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent"
|
||||
android:text="@string/home_extra_stub" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/W.Home.ItemContent.Right"
|
||||
android:text="@{Info.stub != null ? Integer.toString(Info.stub.version) : @string/home_extra_stub_na}"
|
||||
tools:text="5" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="@style/W.Home.Card"
|
||||
gone="@{Info.env.magiskVersionCode < 0}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
@@ -324,7 +223,7 @@
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/home_manager_extra_connection_value"
|
||||
style="@style/W.Home.ItemContent.Right"
|
||||
android:text="@{viewModel.statePackageManager}"
|
||||
android:text="@{viewModel.statePackageName}"
|
||||
tools:text="com.topjohnwu.magisk" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -339,4 +238,4 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
</layout>
|
||||
|
||||
@@ -28,7 +28,9 @@
|
||||
<string name="home_item_source">Source</string>
|
||||
<string name="home_support_content">Magisk is, and always will be, free and open-source. You can however show us that you care by sending a small donation.</string>
|
||||
|
||||
<string name="home_device_title">Your device</string>
|
||||
<string name="home_loading">Loading…</string>
|
||||
|
||||
<string name="home_device_title">Device</string>
|
||||
<string name="home_device_info_title">Info</string>
|
||||
<string name="home_device_extra_manufacturer">Manufacturer</string>
|
||||
<string name="home_device_extra_model">Model</string>
|
||||
|
||||
Reference in New Issue
Block a user