Commit 861ad988 authored by Viktor De Pasquale's avatar Viktor De Pasquale

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.
parent 3101c538
...@@ -56,7 +56,7 @@ dependencies { ...@@ -56,7 +56,7 @@ dependencies {
implementation "androidx.preference:preference:${androidXVersion}" implementation "androidx.preference:preference:${androidXVersion}"
implementation "androidx.recyclerview:recyclerview:${androidXVersion}" implementation "androidx.recyclerview:recyclerview:${androidXVersion}"
implementation "androidx.cardview:cardview:${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.work:work-runtime:2.0.1'
implementation 'androidx.transition:transition:1.1.0-beta01' implementation 'androidx.transition:transition:1.1.0-beta01'
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<application <application
android:allowBackup="true" android:allowBackup="true"
android:name="a.e" android:name="a.e"
android:theme="@style/AppTheme" android:theme="@style/MagiskTheme"
android:usesCleartextTraffic="true" android:usesCleartextTraffic="true"
tools:ignore="UnusedAttribute,GoogleAppIndexingWarning"> tools:ignore="UnusedAttribute,GoogleAppIndexingWarning">
......
...@@ -9,7 +9,12 @@ import android.view.ViewGroup; ...@@ -9,7 +9,12 @@ import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.TextView; 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.App;
import com.topjohnwu.magisk.Const; import com.topjohnwu.magisk.Const;
import com.topjohnwu.magisk.R; import com.topjohnwu.magisk.R;
...@@ -17,23 +22,16 @@ import com.topjohnwu.magisk.utils.ISafetyNetHelper; ...@@ -17,23 +22,16 @@ import com.topjohnwu.magisk.utils.ISafetyNetHelper;
import com.topjohnwu.magisk.view.dialogs.CustomAlertDialog; import com.topjohnwu.magisk.view.dialogs.CustomAlertDialog;
import com.topjohnwu.net.Networking; import com.topjohnwu.net.Networking;
import com.topjohnwu.superuser.Shell; import com.topjohnwu.superuser.Shell;
import dalvik.system.DexClassLoader;
import java.io.File; 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 { public class SafetyNet implements ISafetyNetHelper.Callback {
private static final File EXT_APK = private static final File EXT_APK =
new File(App.self.getFilesDir().getParent() + "/snet", "snet.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_refresh) ImageView safetyNetRefreshIcon;
@BindView(R.id.safetyNet_status) TextView safetyNetStatusText; @BindView(R.id.safetyNet_status) TextView safetyNetStatusText;
@BindView(R.id.safetyNet_check_progress) ProgressBar safetyNetProgress; @BindView(R.id.safetyNet_check_progress) ProgressBar safetyNetProgress;
......
This diff is collapsed.
...@@ -39,27 +39,16 @@ ...@@ -39,27 +39,16 @@
</data> </data>
<androidx.cardview.widget.CardView
style="?attr/cardStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="4dp"
android:foreground="?android:attr/selectableItemBackground"
android:onClick="@{() -> viewModel.cardPressed(item)}"
app:cardCornerRadius="@dimen/card_corner_radius"
app:cardElevation="@dimen/card_elevation">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingTop="12dp" android:animateLayoutChanges="true"
android:paddingBottom="12dp"> android:background="?android:attr/selectableItemBackground"
android:onClick="@{() -> viewModel.cardPressed(item)}">
<androidx.appcompat.widget.AppCompatButton <com.google.android.material.button.MaterialButton
android:id="@+id/install" android:id="@+id/install"
style="@style/Widget.Button.Text"
gone="@{state == MagiskState.LOADING}" gone="@{state == MagiskState.LOADING}"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -79,14 +68,15 @@ ...@@ -79,14 +68,15 @@
android:layout_height="25dp" android:layout_height="25dp"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
app:tint="@{state == MagiskState.UP_TO_DATE ? @color/colorCorrect : (state == MagiskState.OBSOLETE ? @color/colorUpdate : @color/colorError)}"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/status" app:layout_constraintEnd_toStartOf="@+id/status"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent"
app:tint="@{state == MagiskState.UP_TO_DATE ? @color/colorCorrect : (state == MagiskState.OBSOLETE ? @color/colorUpdate : @color/colorError)}" />
<ProgressBar <ProgressBar
android:id="@+id/progress" android:id="@+id/progress"
style="@style/Widget.Progress"
gone="@{state != MagiskState.LOADING}" gone="@{state != MagiskState.LOADING}"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
...@@ -95,6 +85,25 @@ ...@@ -95,6 +85,25 @@
app:layout_constraintStart_toStartOf="@+id/status_icon" app:layout_constraintStart_toStartOf="@+id/status_icon"
app:layout_constraintTop_toTopOf="@+id/status_icon" /> app:layout_constraintTop_toTopOf="@+id/status_icon" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/status"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:maxLines="1"
android:paddingTop="3dp"
android:paddingBottom="3dp"
android:text="@{text}"
android:textAppearance="?android:attr/textAppearanceMedium"
app:autoSizeMinTextSize="1sp"
app:autoSizeTextType="uniform"
app:layout_constraintBottom_toTopOf="@+id/current_version"
app:layout_constraintEnd_toStartOf="@+id/install"
app:layout_constraintStart_toEndOf="@+id/status_icon"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="Magisk is up to date" />
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/current_version" android:id="@+id/current_version"
android:layout_width="0dp" android:layout_width="0dp"
...@@ -103,6 +112,7 @@ ...@@ -103,6 +112,7 @@
android:text="@{state != MagiskState.LOADING ? currentVersion : @string/checking_for_updates}" android:text="@{state != MagiskState.LOADING ? currentVersion : @string/checking_for_updates}"
app:autoSizeMinTextSize="1sp" app:autoSizeMinTextSize="1sp"
app:autoSizeTextType="uniform" app:autoSizeTextType="uniform"
app:layout_constraintBottom_toTopOf="@+id/latest_version"
app:layout_constraintEnd_toEndOf="@+id/status" app:layout_constraintEnd_toEndOf="@+id/status"
app:layout_constraintStart_toStartOf="@+id/status" app:layout_constraintStart_toStartOf="@+id/status"
app:layout_constraintTop_toBottomOf="@+id/status" app:layout_constraintTop_toBottomOf="@+id/status"
...@@ -117,6 +127,7 @@ ...@@ -117,6 +127,7 @@
android:text="@{state != MagiskState.LOADING ? latestVersion : @string/checking_for_updates}" android:text="@{state != MagiskState.LOADING ? latestVersion : @string/checking_for_updates}"
app:autoSizeMinTextSize="1sp" app:autoSizeMinTextSize="1sp"
app:autoSizeTextType="uniform" app:autoSizeTextType="uniform"
app:layout_constraintBottom_toTopOf="@+id/additional"
app:layout_constraintEnd_toEndOf="@+id/status" app:layout_constraintEnd_toEndOf="@+id/status"
app:layout_constraintStart_toStartOf="@+id/status" app:layout_constraintStart_toStartOf="@+id/status"
app:layout_constraintTop_toBottomOf="@+id/current_version" app:layout_constraintTop_toBottomOf="@+id/current_version"
...@@ -131,31 +142,12 @@ ...@@ -131,31 +142,12 @@
android:text="@{additionalInfo}" android:text="@{additionalInfo}"
app:autoSizeMinTextSize="1sp" app:autoSizeMinTextSize="1sp"
app:autoSizeTextType="uniform" app:autoSizeTextType="uniform"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/status" app:layout_constraintEnd_toEndOf="@+id/status"
app:layout_constraintStart_toStartOf="@+id/status" app:layout_constraintStart_toStartOf="@+id/status"
app:layout_constraintTop_toBottomOf="@+id/latest_version" app:layout_constraintTop_toBottomOf="@+id/latest_version"
tools:text="@string/checking_for_updates" /> tools:text="@string/checking_for_updates" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/status"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:maxLines="1"
android:paddingTop="3dp"
android:paddingBottom="3dp"
android:text="@{text}"
android:textAppearance="?android:attr/textAppearanceMedium"
app:autoSizeMinTextSize="1sp"
app:autoSizeTextType="uniform"
app:layout_constraintEnd_toStartOf="@+id/install"
app:layout_constraintStart_toEndOf="@+id/status_icon"
app:layout_constraintTop_toTopOf="parent"
tools:text="Magisk is up to date" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</layout> </layout>
...@@ -14,7 +14,13 @@ ...@@ -14,7 +14,13 @@
<style name="ThemeFoundation.Colored.ExtraProps" /> <style name="ThemeFoundation.Colored.ExtraProps" />
<style name="MagiskTheme" parent="ThemeFoundation.Colored.ExtraProps" /> <style name="MagiskTheme" parent="ThemeFoundation.Colored.ExtraProps">
<!--All of these attributes are deprecated and will be removed-->
<item name="cardStyle">@style/CardViewStyle.Light</item>
<item name="imageColorTint">@color/icon_grey</item>
<item name="colorControl">?android:attr/textColorSecondary</item>
<item name="colorAccentFallback">@color/accentFallback</item>
</style>
<style name="MagiskTheme.Flashing" parent="Theme.MaterialComponents.NoActionBar"> <style name="MagiskTheme.Flashing" parent="Theme.MaterialComponents.NoActionBar">
<item name="colorPrimary">@android:color/black</item> <item name="colorPrimary">@android:color/black</item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment