summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2020-04-06 16:27:03 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2020-04-06 19:56:53 +0530
commitd6e5fd9301d6eb4381684180f9a7ee929b33515f (patch)
tree9071110501b60106b281776092c9a2858071d06d
parent2c625f56fdebd0877d5c7dfca5261c0b594d588e (diff)
ui: tweak cards to make them nicer on the eyes
Surprisingly-requested-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
-rw-r--r--ui/src/main/res/layout/tunnel_detail_fragment.xml4
-rw-r--r--ui/src/main/res/layout/tunnel_detail_peer.xml6
-rw-r--r--ui/src/main/res/layout/tunnel_editor_fragment.xml6
-rw-r--r--ui/src/main/res/layout/tunnel_editor_peer.xml6
-rw-r--r--ui/src/main/res/values-v21/styles.xml1
-rw-r--r--ui/src/main/res/values-v27/styles.xml1
-rw-r--r--ui/src/main/res/values/styles.xml8
7 files changed, 13 insertions, 19 deletions
diff --git a/ui/src/main/res/layout/tunnel_detail_fragment.xml b/ui/src/main/res/layout/tunnel_detail_fragment.xml
index 33ecd839..0bb3558c 100644
--- a/ui/src/main/res/layout/tunnel_detail_fragment.xml
+++ b/ui/src/main/res/layout/tunnel_detail_fragment.xml
@@ -40,10 +40,6 @@
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
- app:cardBackgroundColor="?attr/elevationOverlayColor"
- app:cardCornerRadius="0dp"
- app:cardElevation="2dp"
- app:contentPadding="8dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
diff --git a/ui/src/main/res/layout/tunnel_detail_peer.xml b/ui/src/main/res/layout/tunnel_detail_peer.xml
index af939d9b..a73716d7 100644
--- a/ui/src/main/res/layout/tunnel_detail_peer.xml
+++ b/ui/src/main/res/layout/tunnel_detail_peer.xml
@@ -15,11 +15,7 @@
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_margin="8dp"
- app:cardBackgroundColor="?attr/elevationOverlayColor"
- app:cardCornerRadius="0dp"
- app:cardElevation="2dp"
- app:contentPadding="8dp">
+ android:layout_margin="8dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
diff --git a/ui/src/main/res/layout/tunnel_editor_fragment.xml b/ui/src/main/res/layout/tunnel_editor_fragment.xml
index 5f84e5f7..dffc9d97 100644
--- a/ui/src/main/res/layout/tunnel_editor_fragment.xml
+++ b/ui/src/main/res/layout/tunnel_editor_fragment.xml
@@ -45,11 +45,7 @@
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
- android:layout_marginBottom="16dp"
- app:cardBackgroundColor="?attr/elevationOverlayColor"
- app:cardCornerRadius="0dp"
- app:cardElevation="2dp"
- app:contentPadding="8dp">
+ android:layout_marginBottom="16dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
diff --git a/ui/src/main/res/layout/tunnel_editor_peer.xml b/ui/src/main/res/layout/tunnel_editor_peer.xml
index d17378f2..f4d64e23 100644
--- a/ui/src/main/res/layout/tunnel_editor_peer.xml
+++ b/ui/src/main/res/layout/tunnel_editor_peer.xml
@@ -27,11 +27,7 @@
android:layout_marginStart="8dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="8dp"
- android:layout_marginBottom="4dp"
- app:cardBackgroundColor="?attr/elevationOverlayColor"
- app:cardCornerRadius="0dp"
- app:cardElevation="2dp"
- app:contentPadding="8dp">
+ android:layout_marginBottom="4dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
diff --git a/ui/src/main/res/values-v21/styles.xml b/ui/src/main/res/values-v21/styles.xml
index c29f2df5..7119a147 100644
--- a/ui/src/main/res/values-v21/styles.xml
+++ b/ui/src/main/res/values-v21/styles.xml
@@ -22,5 +22,6 @@
<item name="materialAlertDialogTheme">@style/AppTheme.Dialog</item>
<item name="actionBarPopupTheme">@style/ThemeOverlay.MaterialComponents.ActionBar</item>
<item name="textInputStyle">@style/TextInputLayoutBase</item>
+ <item name="materialCardViewStyle">@style/AppTheme.MaterialCardView</item>
</style>
</resources>
diff --git a/ui/src/main/res/values-v27/styles.xml b/ui/src/main/res/values-v27/styles.xml
index dcdf974f..03f0da86 100644
--- a/ui/src/main/res/values-v27/styles.xml
+++ b/ui/src/main/res/values-v27/styles.xml
@@ -25,5 +25,6 @@
<item name="materialAlertDialogTheme">@style/AppTheme.Dialog</item>
<item name="actionBarPopupTheme">@style/ThemeOverlay.MaterialComponents.ActionBar</item>
<item name="textInputStyle">@style/TextInputLayoutBase</item>
+ <item name="materialCardViewStyle">@style/AppTheme.MaterialCardView</item>
</style>
</resources>
diff --git a/ui/src/main/res/values/styles.xml b/ui/src/main/res/values/styles.xml
index bfde4366..067c10b3 100644
--- a/ui/src/main/res/values/styles.xml
+++ b/ui/src/main/res/values/styles.xml
@@ -21,6 +21,14 @@
<item name="materialAlertDialogTheme">@style/AppTheme.Dialog</item>
<item name="actionBarPopupTheme">@style/ThemeOverlay.MaterialComponents.ActionBar</item>
<item name="textInputStyle">@style/TextInputLayoutBase</item>
+ <item name="materialCardViewStyle">@style/AppTheme.MaterialCardView</item>
+ </style>
+
+ <style name="AppTheme.MaterialCardView" parent="Widget.MaterialComponents.CardView">
+ <item name="cornerRadius">4dp</item>
+ <item name="cardElevation">4dp</item>
+ <item name="contentPadding">8dp</item>
+ <item name="cardBackgroundColor">?attr/elevationOverlayColor</item>
</style>
<style name="AppTheme.Dialog" parent="Theme.MaterialComponents.DayNight.Dialog.Alert">