Magisk/app/src/main/res/layout/fragment_home_md2.xml

377 lines
19 KiB
XML
Raw Normal View History

2019-10-03 15:31:45 +00:00
<?xml version="1.0" encoding="utf-8"?>
<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">
<data>
<import type="com.topjohnwu.magisk.ui.home.MagiskState" />
2019-10-03 15:31:45 +00:00
<variable
name="viewModel"
type="com.topjohnwu.magisk.redesign.home.HomeViewModel" />
</data>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:padding="@dimen/l1"
tools:layout_marginTop="24dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/l1">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/home_magisk_wrapper"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
2019-10-03 15:31:45 +00:00
app:layout_constraintEnd_toStartOf="@+id/home_manager_wrapper"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatImageView
2019-10-04 16:03:06 +00:00
android:id="@+id/home_magisk_icon"
2019-10-03 17:08:35 +00:00
style="?styleIconPrimary"
isEnabled="@{viewModel.stateMagisk != MagiskState.LOADING}"
onSelectClick="@{() -> viewModel.onDeletePressed()}"
onSelectReset="@{10000L}"
2019-10-04 15:56:30 +00:00
android:padding="@dimen/l_25"
2019-10-03 15:31:45 +00:00
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_magisk_delete"
app:tint="@color/color_primary_delete_transient" />
2019-10-03 15:31:45 +00:00
<androidx.appcompat.widget.AppCompatTextView
2019-10-04 16:03:06 +00:00
android:id="@+id/home_magisk_title"
2019-10-03 15:31:45 +00:00
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
android:text="Magisk"
android:textAppearance="?appearanceTextTitleNormal"
2019-10-04 16:03:06 +00:00
app:layout_constraintBottom_toTopOf="@+id/home_magisk_status"
2019-10-03 15:31:45 +00:00
app:layout_constraintEnd_toEndOf="parent"
2019-10-04 16:03:06 +00:00
app:layout_constraintStart_toEndOf="@+id/home_magisk_icon"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed" />
2019-10-03 15:31:45 +00:00
2019-10-04 15:56:30 +00:00
<TextSwitcher
2019-10-04 16:03:06 +00:00
android:id="@+id/home_magisk_status"
2019-10-04 15:56:30 +00:00
textCaptionVariant="@{viewModel.stateTextMagisk}"
2019-10-03 15:31:45 +00:00
android:layout_width="0dp"
android:layout_height="wrap_content"
2019-10-04 16:03:06 +00:00
app:layout_constraintBottom_toBottomOf="@+id/home_magisk_icon"
app:layout_constraintEnd_toEndOf="@+id/home_magisk_title"
app:layout_constraintStart_toStartOf="@+id/home_magisk_title"
app:layout_constraintTop_toBottomOf="@+id/home_magisk_title" />
2019-10-03 15:31:45 +00:00
<FrameLayout
gone="@{viewModel.stateMagisk == MagiskState.LOADING}"
2019-10-03 15:31:45 +00:00
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/l1"
android:animateLayoutChanges="true"
2019-10-03 15:31:45 +00:00
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
2019-10-04 16:03:06 +00:00
app:layout_constraintTop_toBottomOf="@+id/home_magisk_status">
2019-10-03 15:31:45 +00:00
<com.google.android.material.button.MaterialButton
style="?styleButtonDefault"
gone="@{viewModel.stateMagisk != MagiskState.OBSOLETE}"
2019-10-03 15:31:45 +00:00
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/update"
app:icon="@drawable/ic_update_md2"
app:iconGravity="textEnd"
app:iconPadding="@dimen/l_50"
app:iconSize="18dp"
tools:visibility="gone" />
<com.google.android.material.button.MaterialButton
style="?styleButtonText"
gone="@{viewModel.stateMagisk == MagiskState.OBSOLETE}"
2019-10-03 15:31:45 +00:00
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/install"
app:icon="@drawable/ic_install"
app:iconGravity="textEnd"
app:iconPadding="@dimen/l_50"
app:iconSize="18dp" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/home_manager_wrapper"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/home_magisk_wrapper"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatImageView
2019-10-04 16:03:06 +00:00
android:id="@+id/home_manager_icon"
2019-10-03 17:08:35 +00:00
style="?styleIconPrimary"
android:padding="@dimen/l_50"
2019-10-03 15:31:45 +00:00
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
2019-10-03 17:08:35 +00:00
app:srcCompat="@drawable/ic_manager" />
2019-10-03 15:31:45 +00:00
<androidx.appcompat.widget.AppCompatTextView
2019-10-04 16:03:06 +00:00
android:id="@+id/home_manager_title"
2019-10-03 15:31:45 +00:00
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
android:text="Manager"
android:textAppearance="?appearanceTextTitleNormal"
2019-10-04 16:03:06 +00:00
app:layout_constraintBottom_toTopOf="@+id/home_manager_status"
2019-10-03 15:31:45 +00:00
app:layout_constraintEnd_toEndOf="parent"
2019-10-04 16:03:06 +00:00
app:layout_constraintStart_toEndOf="@+id/home_manager_icon"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed" />
2019-10-03 15:31:45 +00:00
2019-10-04 15:56:30 +00:00
<TextSwitcher
2019-10-04 16:03:06 +00:00
android:id="@+id/home_manager_status"
2019-10-04 15:56:30 +00:00
textCaptionVariant="@{viewModel.stateTextManager}"
2019-10-03 15:31:45 +00:00
android:layout_width="0dp"
android:layout_height="wrap_content"
2019-10-04 16:03:06 +00:00
app:layout_constraintBottom_toBottomOf="@+id/home_manager_icon"
app:layout_constraintEnd_toEndOf="@+id/home_manager_title"
app:layout_constraintStart_toStartOf="@+id/home_manager_title"
app:layout_constraintTop_toBottomOf="@+id/home_manager_title" />
2019-10-03 15:31:45 +00:00
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/l1"
gone="@{viewModel.stateManager == MagiskState.LOADING}"
2019-10-04 16:03:06 +00:00
app:layout_constraintTop_toBottomOf="@+id/home_manager_status">
2019-10-03 15:31:45 +00:00
<com.google.android.material.button.MaterialButton
style="?styleButtonDefault"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/update"
gone="@{viewModel.stateManager != MagiskState.OBSOLETE}"
2019-10-03 15:31:45 +00:00
app:icon="@drawable/ic_update_md2"
app:iconGravity="textEnd"
app:iconPadding="@dimen/l_50"
app:iconSize="18dp" />
<com.google.android.material.button.MaterialButton
style="?styleButtonText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/install"
gone="@{viewModel.stateManager == MagiskState.OBSOLETE}"
2019-10-03 15:31:45 +00:00
app:icon="@drawable/ic_install"
app:iconGravity="textEnd"
app:iconPadding="@dimen/l_50"
app:iconSize="18dp"
tools:visibility="gone" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="@dimen/l2"
android:layout_marginBottom="@dimen/l2"
android:background="?colorSurfaceVariant" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/support_icon_john"
style="?styleIconNormal"
android:padding="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tint="@null"
tools:src="@tools:sample/avatars" />
<com.google.android.material.card.MaterialCardView
style="?styleCardNormal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/support_icon_john"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/l1">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-black"
android:textAppearance="?appearanceTextCaptionNormal"
android:textStyle="bold"
tools:text="\@topjohnwu" />
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:fadingEdgeLength="@dimen/l1"
android:orientation="horizontal"
android:paddingTop="@dimen/l1"
android:requiresFadingEdge="horizontal"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_developer" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/l1"
tools:visibility="gone">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/support_icon_dia"
style="?styleIconNormal"
android:padding="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tint="@null"
tools:src="@tools:sample/avatars" />
<com.google.android.material.card.MaterialCardView
style="?styleCardNormal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/l1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/support_icon_dia"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/l1">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:fontFamily="sans-serif-black"
android:textAppearance="?appearanceTextCaptionNormal"
android:textStyle="bold"
tools:text="\@diareuse" />
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:fadingEdgeLength="@dimen/l1"
android:orientation="horizontal"
android:paddingTop="@dimen/l1"
android:requiresFadingEdge="horizontal"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:reverseLayout="true"
tools:listitem="@layout/item_developer" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="@dimen/l1"
android:layout_marginBottom="@dimen/l1"
android:background="?colorSurfaceVariant" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/support_icon_common"
style="?styleIconNormal"
android:padding="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tint="@null"
tools:src="@tools:sample/avatars" />
<com.google.android.material.card.MaterialCardView
style="?styleCardNormal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/support_icon_common"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/l1">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-black"
android:textAppearance="?appearanceTextCaptionNormal"
android:textStyle="bold"
tools:text="Project links" />
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:fadingEdgeLength="@dimen/l1"
android:orientation="horizontal"
android:paddingTop="@dimen/l1"
android:requiresFadingEdge="horizontal"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_developer" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</layout>