Updated action cards to be more colorful

This commit is contained in:
Viktor De Pasquale
2019-11-25 16:58:57 +01:00
parent cc7e47bbb6
commit cb59cc92a3
10 changed files with 199 additions and 184 deletions
@@ -28,7 +28,7 @@
<com.google.android.material.card.MaterialCardView
android:id="@+id/settings_card_redesign"
style="@style/WidgetFoundation.Card"
style="@style/WidgetFoundation.Card.Variant.Secondary"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/l1"
@@ -51,7 +51,7 @@
android:gravity="start"
android:paddingStart="@dimen/l1"
android:text="Redesign"
android:textAppearance="@style/AppearanceFoundation.Body"
android:textAppearance="@style/AppearanceFoundation.Body.Secondary"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/settings_card_redesign_switch"
@@ -75,7 +75,7 @@
<com.google.android.material.card.MaterialCardView
android:id="@+id/settings_card_theme"
style="@style/WidgetFoundation.Card"
style="@style/WidgetFoundation.Card.Variant.Secondary"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
@@ -91,7 +91,7 @@
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/settings_card_theme_dark_icon"
style="@style/WidgetFoundation.Icon"
style="@style/WidgetFoundation.Icon.Secondary"
android:background="@null"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -100,7 +100,7 @@
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/settings_card_theme_dark_pointer"
style="@style/WidgetFoundation.Icon"
style="@style/WidgetFoundation.Icon.Secondary"
android:background="@null"
android:rotation="180"
app:layout_constraintBottom_toBottomOf="parent"
@@ -116,7 +116,7 @@
android:gravity="start|center_vertical"
android:singleLine="true"
android:text="@string/section_theme"
android:textAppearance="@style/AppearanceFoundation.Body"
android:textAppearance="@style/AppearanceFoundation.Body.Secondary"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/settings_card_theme_dark_pointer"
@@ -13,176 +13,51 @@
</data>
<androidx.core.widget.NestedScrollView
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:fillViewport="true"
android:paddingTop="@{viewModel.insets.top + (int) @dimen/internal_action_bar_size}"
android:paddingBottom="@{viewModel.insets.bottom + (int) @dimen/l2}"
tools:layout_marginTop="24dp"
tools:paddingTop="@dimen/l1">
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.recyclerview.widget.RecyclerView
dividerHorizontal="@{R.drawable.divider_l1}"
dividerVertical="@{R.drawable.divider_l1}"
goneUnless="@{viewModel.loaded || !viewModel.items.empty}"
itemBinding="@{viewModel.itemBinding}"
items="@{viewModel.items}"
nestedScrollingEnabled="@{false}"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:orientation="vertical"
android:paddingStart="@dimen/l1"
android:paddingTop="@{viewModel.insets.top + (int) @dimen/internal_action_bar_size + (int) @dimen/l1}"
android:paddingBottom="@{viewModel.insets.bottom + (int) @dimen/l2}"
app:layoutManager="androidx.recyclerview.widget.StaggeredGridLayoutManager"
app:spanCount="2"
tools:layout_marginTop="24dp"
tools:listitem="@layout/item_policy_md2"
tools:paddingTop="@dimen/l1" />
<LinearLayout
goneUnless="@{viewModel.loading &amp;&amp; viewModel.items.empty}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="@dimen/l1">
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<com.google.android.material.card.MaterialCardView
android:id="@+id/superuser_hide"
style="@style/WidgetFoundation.Card"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
android:layout_marginEnd="@dimen/l1"
android:onClick="@{() -> viewModel.hidePressed()}"
app:layout_constraintEnd_toStartOf="@+id/superuser_safetynet"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/superuser_hide_icon"
style="@style/WidgetFoundation.Icon"
android:background="@null"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_hide_md2" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:requiresFadingEdge="horizontal"
android:singleLine="true"
android:text="@string/magisk_hide_md2"
android:textAppearance="@style/AppearanceFoundation.Body"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/superuser_hide_icon_pointer"
app:layout_constraintStart_toEndOf="@+id/superuser_hide_icon"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/superuser_hide_icon_pointer"
style="@style/WidgetFoundation.Icon"
android:background="@null"
android:rotation="180"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_back_md2" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/superuser_safetynet"
style="@style/WidgetFoundation.Card"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/l1"
android:onClick="@{() -> viewModel.safetynetPressed()}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/superuser_hide"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/superuser_safetynet_icon"
style="@style/WidgetFoundation.Icon"
android:background="@null"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_safetynet_md2" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:requiresFadingEdge="horizontal"
android:singleLine="true"
android:text="@string/safetyNet"
android:textAppearance="@style/AppearanceFoundation.Body"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/superuser_safetynet_icon_pointer"
app:layout_constraintStart_toEndOf="@+id/superuser_safetynet_icon"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/superuser_safetynet_icon_pointer"
style="@style/WidgetFoundation.Icon"
android:background="@null"
android:rotation="180"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_back_md2" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<androidx.constraintlayout.widget.Barrier
android:id="@+id/superuser_top_barrier"
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="superuser_hide,superuser_safetynet" />
android:text="@string/safetynet_attest_loading"
android:textAppearance="@style/AppearanceFoundation.Title"
android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView
dividerHorizontal="@{R.drawable.divider_l1}"
dividerVertical="@{R.drawable.divider_l1}"
goneUnless="@{viewModel.loaded || !viewModel.items.empty}"
itemBinding="@{viewModel.itemBinding}"
items="@{viewModel.items}"
nestedScrollingEnabled="@{false}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:orientation="vertical"
android:paddingStart="@dimen/l1"
android:paddingTop="@dimen/l1"
android:paddingBottom="@dimen/l1"
app:layoutManager="androidx.recyclerview.widget.StaggeredGridLayoutManager"
app:layout_constraintTop_toBottomOf="@+id/superuser_top_barrier"
app:spanCount="2"
tools:listitem="@layout/item_policy_md2" />
<ProgressBar
style="@style/WidgetFoundation.ProgressBar.Indeterminate"
android:layout_marginTop="@dimen/l1" />
<LinearLayout
goneUnless="@{viewModel.loading &amp;&amp; viewModel.items.empty}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/superuser_top_barrier">
</LinearLayout>
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/safetynet_attest_loading"
android:textAppearance="@style/AppearanceFoundation.Title"
android:textStyle="bold" />
<ProgressBar
style="@style/WidgetFoundation.ProgressBar.Indeterminate"
android:layout_marginTop="@dimen/l1" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
</FrameLayout>
</layout>
@@ -31,7 +31,7 @@
<com.google.android.material.card.MaterialCardView
android:id="@+id/theme_card_dark"
style="@style/WidgetFoundation.Card"
style="@style/WidgetFoundation.Card.Variant.Secondary"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:onClick="@{() -> viewModel.darkModePressed()}"
@@ -46,7 +46,7 @@
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/settings_card_dark_icon"
style="@style/WidgetFoundation.Icon"
style="@style/WidgetFoundation.Icon.Secondary"
android:background="@null"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -55,7 +55,7 @@
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/settings_card_dark_pointer"
style="@style/WidgetFoundation.Icon"
style="@style/WidgetFoundation.Icon.Secondary"
android:background="@null"
android:rotation="180"
app:layout_constraintBottom_toBottomOf="parent"
@@ -71,7 +71,7 @@
android:gravity="start|center_vertical"
android:singleLine="true"
android:text="@string/settings_dark_mode_title"
android:textAppearance="@style/AppearanceFoundation.Body"
android:textAppearance="@style/AppearanceFoundation.Body.Secondary"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/settings_card_dark_pointer"
@@ -0,0 +1,67 @@
<?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>
<variable
name="item"
type="com.topjohnwu.magisk.model.entity.recycler.TappableHeadlineItem" />
<variable
name="listener"
type="com.topjohnwu.magisk.model.entity.recycler.TappableHeadlineItem.Listener" />
</data>
<com.google.android.material.card.MaterialCardView
style="@style/WidgetFoundation.Card.Variant.Secondary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="@{() -> listener.onItemPressed(item)}"
tools:layout_gravity="center">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/tappable_icon"
style="@style/WidgetFoundation.Icon.Secondary"
android:background="@null"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@{item.icon}"
tools:srcCompat="@drawable/ic_hide_md2" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:requiresFadingEdge="horizontal"
android:singleLine="true"
android:text="@{item.title}"
android:textAppearance="@style/AppearanceFoundation.Body.Secondary"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/headline_icon_pointer"
app:layout_constraintStart_toEndOf="@+id/tappable_icon"
app:layout_constraintTop_toTopOf="parent"
tools:text="@string/magisk_hide_md2" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/headline_icon_pointer"
style="@style/WidgetFoundation.Icon.Secondary"
android:background="@null"
android:rotation="180"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_back_md2" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
</layout>