From 38bc3be5b7f6f127dde55d1c0a2526052a065ebb Mon Sep 17 00:00:00 2001 From: darken Date: Mon, 24 Jan 2022 15:10:30 +0100 Subject: [PATCH] Improve layouts --- .../cards/pods/DualApplePodsCardVH.kt | 6 +- .../monitor_notification_dual_pods_small.xml | 16 ++--- ...r_notification_single_pods_basic_small.xml | 2 +- ...monitor_notification_single_pods_small.xml | 6 +- .../layout/overview_pods_apple_dual_item.xml | 62 +++++++++---------- .../overview_pods_apple_single_basic_item.xml | 4 +- .../overview_pods_apple_single_item.xml | 12 ++-- app/src/main/res/values/styles.xml | 6 +- 8 files changed, 61 insertions(+), 53 deletions(-) diff --git a/app/src/main/java/eu/darken/capod/main/ui/overview/cards/pods/DualApplePodsCardVH.kt b/app/src/main/java/eu/darken/capod/main/ui/overview/cards/pods/DualApplePodsCardVH.kt index 76c25759..c193e379 100644 --- a/app/src/main/java/eu/darken/capod/main/ui/overview/cards/pods/DualApplePodsCardVH.kt +++ b/app/src/main/java/eu/darken/capod/main/ui/overview/cards/pods/DualApplePodsCardVH.kt @@ -79,11 +79,15 @@ class DualApplePodsCardVH(parent: ViewGroup) : podCaseChargingIcon.isInvisible = !isCaseCharging podCaseChargingLabel.isInvisible = !isCaseCharging - podCaseLidLabel.text = when (device.caseLidState) { + podCaseLidLabel.text = when (caseLidState) { LidState.OPEN -> context.getString(R.string.pods_case_status_open_label) LidState.CLOSED -> context.getString(R.string.pods_case_status_closed_label) else -> context.getString(R.string.general_value_unknown_label) } + + val hideInfo = !listOf(LidState.OPEN, LidState.CLOSED).contains(caseLidState) + podCaseLidIcon.isInvisible = hideInfo + podCaseLidLabel.isInvisible = hideInfo } status.apply { diff --git a/app/src/main/res/layout/monitor_notification_dual_pods_small.xml b/app/src/main/res/layout/monitor_notification_dual_pods_small.xml index ff9626c6..e5b80484 100644 --- a/app/src/main/res/layout/monitor_notification_dual_pods_small.xml +++ b/app/src/main/res/layout/monitor_notification_dual_pods_small.xml @@ -18,7 +18,7 @@ @@ -52,7 +52,7 @@ @@ -81,7 +81,7 @@ diff --git a/app/src/main/res/layout/monitor_notification_single_pods_basic_small.xml b/app/src/main/res/layout/monitor_notification_single_pods_basic_small.xml index c8adecf7..00f46d63 100644 --- a/app/src/main/res/layout/monitor_notification_single_pods_basic_small.xml +++ b/app/src/main/res/layout/monitor_notification_single_pods_basic_small.xml @@ -21,7 +21,7 @@ diff --git a/app/src/main/res/layout/overview_pods_apple_dual_item.xml b/app/src/main/res/layout/overview_pods_apple_dual_item.xml index fc621ac8..42767d0f 100644 --- a/app/src/main/res/layout/overview_pods_apple_dual_item.xml +++ b/app/src/main/res/layout/overview_pods_apple_dual_item.xml @@ -94,7 +94,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="16dp" - android:layout_marginEnd="8dp" + android:layout_marginEnd="4dp" android:minHeight="108dp" app:layout_constraintBottom_toTopOf="@id/barrier_bottom" app:layout_constraintEnd_toStartOf="@id/pod_case_container" @@ -104,7 +104,7 @@ 8dp - + + \ No newline at end of file