Updated flash screen with new arch

This commit is contained in:
Viktor De Pasquale
2019-04-24 20:28:41 +02:00
parent 07eb7dda2d
commit 14ff22fbcd
21 changed files with 445 additions and 348 deletions
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@color/colorText"
android:pathData="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" />
</vector>
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#000"
android:pathData="M12,4C14.1,4 16.1,4.8 17.6,6.3C20.7,9.4 20.7,14.5 17.6,17.6C15.8,19.5 13.3,20.2 10.9,19.9L11.4,17.9C13.1,18.1 14.9,17.5 16.2,16.2C18.5,13.9 18.5,10.1 16.2,7.7C15.1,6.6 13.5,6 12,6V10.6L7,5.6L12,0.6V4M6.3,17.6C3.7,15 3.3,11 5.1,7.9L6.6,9.4C5.5,11.6 5.9,14.4 7.8,16.2C8.3,16.7 8.9,17.1 9.6,17.4L9,19.4C8,19 7.1,18.4 6.3,17.6Z" />
</vector>
+137 -48
View File
@@ -1,61 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/flashing_background_color"
android:orientation="vertical">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<include layout="@layout/toolbar" />
<data>
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<variable
name="viewModel"
type="com.topjohnwu.magisk.ui.flash.FlashViewModel" />
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="wrap_content"
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppBarLayoutTheme.Flashing">
<androidx.appcompat.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
app:popupTheme="@style/ToolbarPopupTheme.Flashing">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true">
<FrameLayout
invisibleScale="@{viewModel.loading}"
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackgroundBorderless"
android:onClick="@{() -> viewModel.backPressed()}"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintLeft_toLeftOf="parent">
<androidx.appcompat.widget.AppCompatImageView
style="@style/Widget.Icon"
android:layout_gravity="center"
android:background="@android:color/transparent"
app:srcCompat="@drawable/ic_back"
app:tint="@android:color/white" />
</FrameLayout>
<androidx.appcompat.widget.AppCompatTextView
style="@style/Widget.Text.Emphasize"
movieBehavior="@{viewModel.loading}"
movieBehaviorText="@{viewModel.behaviorText}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="monospace"
android:textColor="@android:color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Flashing..." />
<FrameLayout
invisibleScale="@{viewModel.loading}"
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackgroundBorderless"
android:onClick="@{() -> viewModel.savePressed()}"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintRight_toRightOf="parent">
<androidx.appcompat.widget.AppCompatImageView
style="@style/Widget.Icon"
android:layout_gravity="center"
android:background="@android:color/transparent"
app:srcCompat="@drawable/ic_save"
app:tint="@android:color/white" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="8dp"
android:paddingEnd="8dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
app:layout_behavior="@string/appbar_scrolling_view_behavior">
</HorizontalScrollView>
<androidx.recyclerview.widget.RecyclerView
itemBinding="@{viewModel.itemBinding}"
items="@{viewModel.items}"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_console" />
<LinearLayout
android:id="@+id/button_panel"
style="?android:buttonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:visibility="gone">
<com.google.android.material.card.MaterialCardView
invisibleScale="@{!viewModel.loaded || !viewModel.canShowReboot}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_generic"
app:cardBackgroundColor="@color/colorSecondary"
app:cardCornerRadius="26dp"
app:cardPreventCornerOverlap="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent">
<Button
android:id="@+id/close"
style="?android:borderlessButtonStyle"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_weight="1"
android:text="@string/close" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
android:background="?attr/selectableItemBackground"
android:gravity="center"
android:onClick="@{() -> viewModel.restartPressed()}"
android:padding="@dimen/margin_generic_half">
<Button
android:id="@+id/save_logs"
style="?android:borderlessButtonStyle"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_weight="1"
android:text="@string/menuSaveLog" />
<androidx.appcompat.widget.AppCompatImageView
style="@style/Widget.Icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
app:srcCompat="@drawable/ic_restart"
app:tint="@color/colorTextTinted" />
<Button
android:id="@+id/reboot"
style="?android:borderlessButtonStyle"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_weight="1"
android:text="@string/reboot" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/Widget.Text.Emphasize.Tinted"
gone="@{!viewModel.showRestartTitle}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_generic_half"
android:paddingRight="@dimen/margin_generic_half"
android:text="@string/reboot" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>
+3 -1
View File
@@ -99,7 +99,9 @@
<string name="dtbo_patched_title">DTBO was patched!</string>
<string name="dtbo_patched_reboot">Magisk Manager has patched dtbo.img. Please reboot.</string>
<string name="flashing">Flashing</string>
<string name="flashing">Flashing</string>
<string name="done">Done!</string>
<string name="failure">Failed</string>
<string name="hide_manager_title">Hiding Magisk Manager…</string>
<string name="hide_manager_fail_toast">Hide Magisk Manager failed.</string>
<string name="open_link_failed_toast">No application found to open the link.</string>