mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-22 16:07:39 +00:00
Don't do layered cards
This commit is contained in:
parent
0ce7da1bf6
commit
b90e0430f8
@ -31,6 +31,8 @@ class HomeFragment : BaseUIFragment<HomeViewModel, FragmentHomeMd2Binding>() {
|
|||||||
// Set barrier reference IDs in code, since resource IDs will be stripped in release mode
|
// Set barrier reference IDs in code, since resource IDs will be stripped in release mode
|
||||||
binding.homeMagiskWrapper.homeMagiskTitleBarrier.referencedIds =
|
binding.homeMagiskWrapper.homeMagiskTitleBarrier.referencedIds =
|
||||||
intArrayOf(R.id.home_magisk_action, R.id.home_magisk_title, R.id.home_magisk_icon)
|
intArrayOf(R.id.home_magisk_action, R.id.home_magisk_title, R.id.home_magisk_icon)
|
||||||
|
binding.homeMagiskWrapper.homeMagiskBarrier.referencedIds =
|
||||||
|
intArrayOf(R.id.home_magisk_latest_version, R.id.home_magisk_installed_version, R.id.home_magisk_mode)
|
||||||
binding.homeManagerWrapper.homeManagerTitleBarrier.referencedIds =
|
binding.homeManagerWrapper.homeManagerTitleBarrier.referencedIds =
|
||||||
intArrayOf(R.id.home_manager_action, R.id.home_manager_title, R.id.home_manager_icon)
|
intArrayOf(R.id.home_manager_action, R.id.home_manager_title, R.id.home_manager_icon)
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ import com.topjohnwu.magisk.core.model.ManagerJson
|
|||||||
import com.topjohnwu.magisk.core.model.UpdateInfo
|
import com.topjohnwu.magisk.core.model.UpdateInfo
|
||||||
import com.topjohnwu.magisk.data.repository.MagiskRepository
|
import com.topjohnwu.magisk.data.repository.MagiskRepository
|
||||||
import com.topjohnwu.magisk.extensions.*
|
import com.topjohnwu.magisk.extensions.*
|
||||||
import com.topjohnwu.magisk.model.entity.internal.DownloadSubject.Magisk
|
|
||||||
import com.topjohnwu.magisk.model.entity.internal.DownloadSubject.Manager
|
import com.topjohnwu.magisk.model.entity.internal.DownloadSubject.Manager
|
||||||
import com.topjohnwu.magisk.model.entity.recycler.DeveloperItem
|
import com.topjohnwu.magisk.model.entity.recycler.DeveloperItem
|
||||||
import com.topjohnwu.magisk.model.entity.recycler.HomeItem
|
import com.topjohnwu.magisk.model.entity.recycler.HomeItem
|
||||||
@ -48,7 +47,6 @@ class HomeViewModel(
|
|||||||
val stateMagiskInstalledVersion get() =
|
val stateMagiskInstalledVersion get() =
|
||||||
"${Info.env.magiskVersionString} (${Info.env.magiskVersionCode})"
|
"${Info.env.magiskVersionString} (${Info.env.magiskVersionCode})"
|
||||||
val stateMagiskMode get() = (if (Config.coreOnly) R.string.home_status_safe else R.string.home_status_normal).res()
|
val stateMagiskMode get() = (if (Config.coreOnly) R.string.home_status_safe else R.string.home_status_normal).res()
|
||||||
val stateMagiskProgress = KObservableField(0)
|
|
||||||
|
|
||||||
val stateManagerRemoteVersion = KObservableField(R.string.loading.res())
|
val stateManagerRemoteVersion = KObservableField(R.string.loading.res())
|
||||||
val stateManagerInstalledVersion = Info.stub?.let {
|
val stateManagerInstalledVersion = Info.stub?.let {
|
||||||
@ -70,8 +68,6 @@ class HomeViewModel(
|
|||||||
init {
|
init {
|
||||||
RemoteFileService.progressBroadcast.observeForever {
|
RemoteFileService.progressBroadcast.observeForever {
|
||||||
when (it?.second) {
|
when (it?.second) {
|
||||||
is Magisk.Download,
|
|
||||||
is Magisk.Flash -> stateMagiskProgress.value = it.first.times(100f).roundToInt()
|
|
||||||
is Manager -> stateManagerProgress.value = it.first.times(100f).roundToInt()
|
is Manager -> stateManagerProgress.value = it.first.times(100f).roundToInt()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,6 @@
|
|||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
style="@style/WidgetFoundation.Button"
|
style="@style/WidgetFoundation.Button"
|
||||||
gone="@{viewModel.stateMagisk != MagiskState.OBSOLETE}"
|
gone="@{viewModel.stateMagisk != MagiskState.OBSOLETE}"
|
||||||
isEnabled="@{viewModel.stateManager == MagiskState.UP_TO_DATE && (viewModel.stateMagiskProgress == 0 || viewModel.stateMagiskProgress == 100)}"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:onClick="@{() -> viewModel.onMagiskPressed()}"
|
android:onClick="@{() -> viewModel.onMagiskPressed()}"
|
||||||
@ -87,7 +86,6 @@
|
|||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
style="@style/WidgetFoundation.Button.Text"
|
style="@style/WidgetFoundation.Button.Text"
|
||||||
gone="@{viewModel.stateMagisk == MagiskState.OBSOLETE}"
|
gone="@{viewModel.stateMagisk == MagiskState.OBSOLETE}"
|
||||||
isEnabled="@{viewModel.stateManager == MagiskState.UP_TO_DATE && (viewModel.stateMagiskProgress == 0 || viewModel.stateMagiskProgress == 100)}"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:onClick="@{() -> viewModel.onMagiskPressed()}"
|
android:onClick="@{() -> viewModel.onMagiskPressed()}"
|
||||||
@ -102,7 +100,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:barrierDirection="bottom"
|
app:barrierDirection="bottom"
|
||||||
app:constraint_referenced_ids="home_magisk_action,home_magisk_title,home_magisk_icon" />
|
tools:constraint_referenced_ids="home_magisk_action,home_magisk_title,home_magisk_icon" />
|
||||||
|
|
||||||
<HorizontalScrollView
|
<HorizontalScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -118,22 +116,10 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
|
||||||
style="@style/W.Home.Card.First"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_width="wrap_content" >
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<View
|
|
||||||
style="@style/W.Home.Section"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/home_magisk_latest_version"
|
android:id="@+id/home_magisk_latest_version"
|
||||||
style="@style/W.Home.Item.Top"
|
style="@style/W.Home.Item.Top"
|
||||||
@ -185,38 +171,17 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
<androidx.constraintlayout.widget.Barrier
|
||||||
|
android:id="@+id/home_magisk_barrier"
|
||||||
<ProgressBar
|
|
||||||
style="@style/WidgetFoundation.ProgressBar"
|
|
||||||
gone="@{viewModel.stateMagiskProgress == 0 || viewModel.stateMagiskProgress == 100}"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_gravity="bottom"
|
|
||||||
android:max="100"
|
|
||||||
android:progress="@{viewModel.stateMagiskProgress}" />
|
|
||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
|
||||||
style="@style/W.Home.Card"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
app:barrierDirection="end"
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
tools:constraint_referenced_ids="home_magisk_latest_version,home_magisk_installed_version,home_magisk_mode"/>
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<View
|
|
||||||
style="@style/W.Home.Section"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/home_device_details_ab"
|
android:id="@+id/home_device_details_ab"
|
||||||
style="@style/W.Home.Item.Top"
|
style="@style/W.Home.Item.Top"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="@id/home_magisk_barrier"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -266,8 +231,6 @@
|
|||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</HorizontalScrollView>
|
</HorizontalScrollView>
|
||||||
|
@ -89,7 +89,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:barrierDirection="bottom"
|
app:barrierDirection="bottom"
|
||||||
app:constraint_referenced_ids="home_manager_action,home_manager_title,home_manager_icon" />
|
tools:constraint_referenced_ids="home_manager_action,home_manager_title,home_manager_icon" />
|
||||||
|
|
||||||
<HorizontalScrollView
|
<HorizontalScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -103,24 +103,12 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
|
||||||
style="@style/W.Home.Card.First"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<View
|
|
||||||
style="@style/W.Home.Section"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/home_manager_latest_version"
|
android:id="@+id/home_manager_latest_version"
|
||||||
style="@style/W.Home.Item.Top"
|
style="@style/W.Home.Item.Top"
|
||||||
@ -200,8 +188,6 @@
|
|||||||
android:max="100"
|
android:max="100"
|
||||||
android:progress="@{viewModel.stateManagerProgress}" />
|
android:progress="@{viewModel.stateManagerProgress}" />
|
||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</HorizontalScrollView>
|
</HorizontalScrollView>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user