Updated card design on homepage
This commit is contained in:
parent
700c51f95c
commit
ff24bc0b68
8
app/src/main/res/drawable/bg_card.xml
Normal file
8
app/src/main/res/drawable/bg_card.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<gradient
|
||||||
|
android:angle="45"
|
||||||
|
android:endColor="?colorSurface"
|
||||||
|
android:startColor="?colorSurfaceVariant" />
|
||||||
|
</shape>
|
@ -38,13 +38,23 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="@dimen/l1">
|
android:paddingTop="@dimen/l1">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<com.google.android.material.card.MaterialCardView
|
||||||
android:id="@+id/home_magisk_wrapper"
|
android:id="@+id/home_magisk_wrapper"
|
||||||
android:layout_width="0dp"
|
style="?styleCardVariant"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxWidth="200dp"
|
||||||
|
app:layout_constrainedWidth="true"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/home_manager_wrapper"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:animateLayoutChanges="true"
|
android:animateLayoutChanges="true"
|
||||||
android:paddingStart="@dimen/l1"
|
android:background="@drawable/bg_card"
|
||||||
android:paddingEnd="@dimen/l1"
|
android:padding="@dimen/l1"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/home_manager_wrapper"
|
app:layout_constraintEnd_toStartOf="@+id/home_manager_wrapper"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
@ -94,7 +104,7 @@
|
|||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
gone="@{viewModel.stateMagisk == MagiskState.LOADING || !viewModel.isConnected}"
|
gone="@{viewModel.stateMagisk == MagiskState.LOADING || !viewModel.isConnected}"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/l1"
|
android:layout_marginTop="@dimen/l1"
|
||||||
android:animateLayoutChanges="true"
|
android:animateLayoutChanges="true"
|
||||||
@ -135,24 +145,25 @@
|
|||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<View
|
</com.google.android.material.card.MaterialCardView>
|
||||||
android:layout_width="1dp"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_marginTop="@dimen/l2"
|
|
||||||
android:layout_marginBottom="@dimen/l2"
|
|
||||||
android:background="?colorSurfaceVariant"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/home_manager_wrapper"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/home_magisk_wrapper"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<com.google.android.material.card.MaterialCardView
|
||||||
android:id="@+id/home_manager_wrapper"
|
android:id="@+id/home_manager_wrapper"
|
||||||
android:layout_width="0dp"
|
style="?styleCardVariant"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/l1"
|
android:layout_marginStart="@dimen/l1"
|
||||||
android:paddingStart="@dimen/l1"
|
android:maxWidth="200dp"
|
||||||
android:paddingEnd="@dimen/l1"
|
app:layout_constrainedWidth="true"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/home_magisk_wrapper"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/bg_card"
|
||||||
|
android:padding="@dimen/l1"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/home_magisk_wrapper"
|
app:layout_constraintStart_toEndOf="@+id/home_magisk_wrapper"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
@ -235,19 +246,14 @@
|
|||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_marginStart="@dimen/l1"
|
|
||||||
android:layout_marginTop="@dimen/l2"
|
|
||||||
android:layout_marginEnd="@dimen/l1"
|
|
||||||
android:layout_marginBottom="@dimen/l2"
|
|
||||||
android:background="?colorSurfaceVariant" />
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_marginTop="@dimen/l2"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
@ -436,10 +442,10 @@
|
|||||||
tools:text="7.3.4 (12345)" />
|
tools:text="7.3.4 (12345)" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
gone="@{Info.magiskVersionCode < 0}"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
gone="@{Info.magiskVersionCode < 0}"
|
|
||||||
android:text="@{String.format(`%s (%s)`, Info.magiskVersionString, Info.magiskVersionCode)}"
|
android:text="@{String.format(`%s (%s)`, Info.magiskVersionString, Info.magiskVersionCode)}"
|
||||||
android:textAppearance="?appearanceTextCaptionVariant"
|
android:textAppearance="?appearanceTextCaptionVariant"
|
||||||
tools:text="19.5 (12345)" />
|
tools:text="19.5 (12345)" />
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
<!--Card-->
|
<!--Card-->
|
||||||
<attr name="styleCardNormal" format="reference" />
|
<attr name="styleCardNormal" format="reference" />
|
||||||
|
<attr name="styleCardVariant" format="reference" />
|
||||||
<attr name="styleCardElevated" format="reference" />
|
<attr name="styleCardElevated" format="reference" />
|
||||||
<attr name="styleCardOnPrimary" format="reference" />
|
<attr name="styleCardOnPrimary" format="reference" />
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
<item name="styleToolbar">@style/WidgetFoundation.Toolbar</item>
|
<item name="styleToolbar">@style/WidgetFoundation.Toolbar</item>
|
||||||
|
|
||||||
<item name="styleCardNormal">@style/WidgetFoundation.Card</item>
|
<item name="styleCardNormal">@style/WidgetFoundation.Card</item>
|
||||||
|
<item name="styleCardVariant">@style/WidgetFoundation.Card.Variant</item>
|
||||||
<item name="styleCardElevated">@style/WidgetFoundation.Card.Elevated</item>
|
<item name="styleCardElevated">@style/WidgetFoundation.Card.Elevated</item>
|
||||||
<item name="styleCardOnPrimary">@style/WidgetFoundation.Card.OnPrimary</item>
|
<item name="styleCardOnPrimary">@style/WidgetFoundation.Card.OnPrimary</item>
|
||||||
|
|
||||||
|
@ -30,6 +30,11 @@ variant. Make sure to use style referenced by attribute defined it attrs.xml.
|
|||||||
<item name="cardPreventCornerOverlap">true</item>
|
<item name="cardPreventCornerOverlap">true</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="WidgetFoundation.Card.Variant">
|
||||||
|
<item name="cardBackgroundColor">?colorSurface</item>
|
||||||
|
<item name="strokeColor">?colorSurfaceVariant</item>
|
||||||
|
<item name="strokeWidth">1dp</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<style name="WidgetFoundation.Card.Elevated" parent="Widget.MaterialComponents.CardView">
|
<style name="WidgetFoundation.Card.Elevated" parent="Widget.MaterialComponents.CardView">
|
||||||
<item name="cardBackgroundColor">?colorSurface</item>
|
<item name="cardBackgroundColor">?colorSurface</item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user