From b90e0430f8e9c0d647e1cd15e524149e25c40cb0 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Thu, 27 Feb 2020 01:43:00 -0800 Subject: [PATCH] Don't do layered cards --- .../topjohnwu/magisk/ui/home/HomeFragment.kt | 2 + .../topjohnwu/magisk/ui/home/HomeViewModel.kt | 4 - .../main/res/layout/include_home_magisk.xml | 233 ++++++++---------- .../main/res/layout/include_home_manager.xml | 142 +++++------ 4 files changed, 164 insertions(+), 217 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt index 83a0f5631..bd1d2318f 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt @@ -31,6 +31,8 @@ class HomeFragment : BaseUIFragment() { // Set barrier reference IDs in code, since resource IDs will be stripped in release mode binding.homeMagiskWrapper.homeMagiskTitleBarrier.referencedIds = 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 = intArrayOf(R.id.home_manager_action, R.id.home_manager_title, R.id.home_manager_icon) diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt index ab9696973..d39bfb49f 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt @@ -13,7 +13,6 @@ import com.topjohnwu.magisk.core.model.ManagerJson import com.topjohnwu.magisk.core.model.UpdateInfo import com.topjohnwu.magisk.data.repository.MagiskRepository 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.recycler.DeveloperItem import com.topjohnwu.magisk.model.entity.recycler.HomeItem @@ -48,7 +47,6 @@ class HomeViewModel( val stateMagiskInstalledVersion get() = "${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 stateMagiskProgress = KObservableField(0) val stateManagerRemoteVersion = KObservableField(R.string.loading.res()) val stateManagerInstalledVersion = Info.stub?.let { @@ -70,8 +68,6 @@ class HomeViewModel( init { RemoteFileService.progressBroadcast.observeForever { 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() } } diff --git a/app/src/main/res/layout/include_home_magisk.xml b/app/src/main/res/layout/include_home_magisk.xml index 823768fb9..d672e32dc 100644 --- a/app/src/main/res/layout/include_home_magisk.xml +++ b/app/src/main/res/layout/include_home_magisk.xml @@ -76,7 +76,6 @@ + tools:constraint_referenced_ids="home_magisk_action,home_magisk_title,home_magisk_icon" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + android:layout_height="wrap_content" + app:barrierDirection="end" + tools:constraint_referenced_ids="home_magisk_latest_version,home_magisk_installed_version,home_magisk_mode"/> - + - + - + - + - + - + - + - + - + - + - + - + - - - - - + diff --git a/app/src/main/res/layout/include_home_manager.xml b/app/src/main/res/layout/include_home_manager.xml index 225047be0..d01d461bd 100644 --- a/app/src/main/res/layout/include_home_manager.xml +++ b/app/src/main/res/layout/include_home_manager.xml @@ -89,7 +89,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" 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" /> + android:orientation="vertical"> - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - +