From 861ad9881ca3110554506cb8061d63bcff1de206 Mon Sep 17 00:00:00 2001 From: Viktor De Pasquale Date: Sun, 14 Apr 2019 11:51:47 +0200 Subject: [PATCH] Updated design of the front page (with removed cards and added dividers) Also updated material library and injected backported styles which were incompatible with the current UI for the most part and as it was over-carded all cards were removed and replaced with flat UI components. This change is temporary and *will* be redone to the final redesign, in other words this is sufficient for the transition period. All themers should refrain from trying to theme the app until the redesign is done. It will break your efforts with every other release. --- app/build.gradle | 2 +- app/src/main/AndroidManifest.xml | 4 +- .../com/topjohnwu/magisk/view/SafetyNet.java | 18 +- app/src/main/res/layout/fragment_magisk.xml | 779 +++++++++--------- .../main/res/layout/include_update_card.xml | 210 +++-- app/src/main/res/values/styles_new.xml | 8 +- 6 files changed, 487 insertions(+), 534 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index fc25ba0cb..488a7dc75 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -56,7 +56,7 @@ dependencies { implementation "androidx.preference:preference:${androidXVersion}" implementation "androidx.recyclerview:recyclerview:${androidXVersion}" implementation "androidx.cardview:cardview:${androidXVersion}" - implementation "com.google.android.material:material:${androidXVersion}" + implementation "com.google.android.material:material:1.1.0-alpha05" implementation 'androidx.work:work-runtime:2.0.1' implementation 'androidx.transition:transition:1.1.0-beta01' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index beb5505cd..e8ff18386 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -11,7 +11,7 @@ @@ -74,4 +74,4 @@ - \ No newline at end of file + diff --git a/app/src/main/java/com/topjohnwu/magisk/view/SafetyNet.java b/app/src/main/java/com/topjohnwu/magisk/view/SafetyNet.java index 8796bac8d..e445439d1 100644 --- a/app/src/main/java/com/topjohnwu/magisk/view/SafetyNet.java +++ b/app/src/main/java/com/topjohnwu/magisk/view/SafetyNet.java @@ -9,7 +9,12 @@ import android.view.ViewGroup; import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.TextView; - +import androidx.annotation.StringRes; +import androidx.cardview.widget.CardView; +import butterknife.BindColor; +import butterknife.BindView; +import butterknife.OnClick; +import butterknife.Unbinder; import com.topjohnwu.magisk.App; import com.topjohnwu.magisk.Const; import com.topjohnwu.magisk.R; @@ -17,23 +22,16 @@ import com.topjohnwu.magisk.utils.ISafetyNetHelper; import com.topjohnwu.magisk.view.dialogs.CustomAlertDialog; import com.topjohnwu.net.Networking; import com.topjohnwu.superuser.Shell; +import dalvik.system.DexClassLoader; import java.io.File; -import androidx.annotation.StringRes; -import androidx.cardview.widget.CardView; -import butterknife.BindColor; -import butterknife.BindView; -import butterknife.OnClick; -import butterknife.Unbinder; -import dalvik.system.DexClassLoader; - public class SafetyNet implements ISafetyNetHelper.Callback { private static final File EXT_APK = new File(App.self.getFilesDir().getParent() + "/snet", "snet.apk"); - @BindView(R.id.safetyNet_card) CardView safetyNetCard; + /*@BindView(R.id.safetyNet_card) */ CardView safetyNetCard; @BindView(R.id.safetyNet_refresh) ImageView safetyNetRefreshIcon; @BindView(R.id.safetyNet_status) TextView safetyNetStatusText; @BindView(R.id.safetyNet_check_progress) ProgressBar safetyNetProgress; diff --git a/app/src/main/res/layout/fragment_magisk.xml b/app/src/main/res/layout/fragment_magisk.xml index 10c6dd845..6e58db6cf 100644 --- a/app/src/main/res/layout/fragment_magisk.xml +++ b/app/src/main/res/layout/fragment_magisk.xml @@ -32,57 +32,49 @@ android:id="@+id/linearLayout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="vertical"> + android:orientation="vertical" + android:padding="@dimen/margin_generic"> - + android:layout_marginTop="5dp" + android:layout_marginBottom="5dp"> - + + + android:layout_gravity="center_vertical" + android:paddingTop="10dp" + android:paddingBottom="10dp" + android:text="@string/app_name" + android:textAppearance="@style/TextAppearance.AppCompat.Headline" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/icon" + app:layout_constraintTop_toTopOf="parent" /> - + - - - - - + - - + android:layout_marginTop="@dimen/margin_generic" /> - + + + + + android:layout_height="wrap_content" + android:background="?attr/selectableItemBackground" + android:minHeight="48dp"> - - - - - - - - - + android:layout_marginStart="16dp" + android:rotation="@{viewModel.isAdvancedExpanded ? 180 : 0}" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@+id/title" + app:layout_constraintTop_toTopOf="parent" + app:srcCompat="@drawable/ic_arrow" + app:tint="?attr/imageColorTint" /> - + - + - - - - - - - - - - - - - - - - - - - - - - - - - + android:checked="@={viewModel.isForceEncryption}" + android:text="@string/keep_force_encryption" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintWidth_default="wrap" + app:layout_constraintWidth_min="300dp" /> - + - + - + - - - - - - - - - - + android:layout_margin="@dimen/margin_generic" /> + + - + app:layout_constraintEnd_toStartOf="@+id/safetyNet_status" + app:layout_constraintTop_toTopOf="parent" + app:srcCompat="@drawable/ic_safetynet" /> - - - - - + app:layout_constraintStart_toEndOf="@+id/safetyNet_status" + app:layout_constraintTop_toTopOf="parent" + app:srcCompat="@drawable/ic_refresh" /> - + - - - + app:layout_constraintEnd_toStartOf="@+id/sn_status_end" + app:layout_constraintStart_toStartOf="@+id/sn_status_start" + app:layout_constraintTop_toTopOf="parent" /> - - - - - + android:orientation="vertical" + app:layout_constraintGuide_percent="0.25" /> - - - - - - - - - - - + android:orientation="vertical" + app:layout_constraintGuide_percent="0.75" /> - - - - - + android:paddingBottom="10dp"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/include_update_card.xml b/app/src/main/res/layout/include_update_card.xml index a772a4811..68c7d9f3d 100644 --- a/app/src/main/res/layout/include_update_card.xml +++ b/app/src/main/res/layout/include_update_card.xml @@ -39,123 +39,115 @@ - + android:layout_height="match_parent" + android:animateLayoutChanges="true" + android:background="?android:attr/selectableItemBackground" + android:onClick="@{() -> viewModel.cardPressed(item)}"> - + - + - + - + - + - + - - - - - - - + + diff --git a/app/src/main/res/values/styles_new.xml b/app/src/main/res/values/styles_new.xml index 66e4f51ea..cc4fa1c1e 100644 --- a/app/src/main/res/values/styles_new.xml +++ b/app/src/main/res/values/styles_new.xml @@ -14,7 +14,13 @@