From 44cc22c6997cf630a08152f512bb7cb2eff5b399 Mon Sep 17 00:00:00 2001 From: osodebailar Date: Wed, 20 Apr 2022 14:55:54 +0200 Subject: [PATCH 1/3] optimze overview and singleclick margin --- .../nightscout/androidaps/skins/SkinLowRes.kt | 7 ---- app/src/main/res/layout/dialog_loop.xml | 32 +++++++++---------- app/src/main/res/layout/dialog_temptarget.xml | 6 ++-- .../res/layout/overview_buttons_layout.xml | 14 ++++---- app/src/main/res/layout/overview_fragment.xml | 24 +++----------- 5 files changed, 30 insertions(+), 53 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/skins/SkinLowRes.kt b/app/src/main/java/info/nightscout/androidaps/skins/SkinLowRes.kt index ce7c8a7581..03206a0d46 100644 --- a/app/src/main/java/info/nightscout/androidaps/skins/SkinLowRes.kt +++ b/app/src/main/java/info/nightscout/androidaps/skins/SkinLowRes.kt @@ -42,13 +42,6 @@ class SkinLowRes @Inject constructor(private val config: Config) : SkinInterface if (!config.NSCLIENT && isLandscape) moveButtonsLayout(binding.root) binding.apply { - loopCard.elevation = 0F - loopCard.radius = 0F - val param = (loopCard.layoutParams as ViewGroup.MarginLayoutParams).apply { - setMargins(0,0,0,0) - } - loopCard.layoutParams = param - infoCard.elevation = 0F infoCard.radius = 0F val paramInfo = (infoCard.layoutParams as ViewGroup.MarginLayoutParams).apply { diff --git a/app/src/main/res/layout/dialog_loop.xml b/app/src/main/res/layout/dialog_loop.xml index 5f0cad9ba3..7977f50c1c 100644 --- a/app/src/main/res/layout/dialog_loop.xml +++ b/app/src/main/res/layout/dialog_loop.xml @@ -75,7 +75,7 @@ android:layout_width="0dp" android:layout_height="fill_parent" android:layout_gravity="center" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:paddingStart="10dp" android:paddingEnd="10dp" @@ -91,7 +91,7 @@ android:layout_width="0dp" android:layout_height="fill_parent" android:layout_gravity="center" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:paddingStart="10dp" android:paddingEnd="10dp" @@ -107,7 +107,7 @@ android:layout_width="0dp" android:layout_height="fill_parent" android:layout_gravity="center" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:paddingStart="10dp" android:paddingEnd="10dp" @@ -123,7 +123,7 @@ android:layout_width="0dp" android:layout_height="fill_parent" android:layout_gravity="center" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:paddingStart="10dp" android:paddingEnd="10dp" @@ -139,7 +139,7 @@ android:layout_width="0dp" android:layout_height="fill_parent" android:layout_gravity="center" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:paddingStart="10dp" android:paddingEnd="10dp" @@ -182,7 +182,7 @@ android:layout_width="wrap_content" android:layout_height="0dp" android:layout_gravity="center" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:drawableTop="@drawable/ic_loop_resume" android:paddingStart="10dp" @@ -204,7 +204,7 @@ style="@style/ButtonSmallFontStyle" android:layout_width="0px" android:layout_height="fill_parent" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:paddingStart="5dp" android:paddingEnd="5dp" @@ -218,7 +218,7 @@ style="@style/ButtonSmallFontStyle" android:layout_width="0px" android:layout_height="fill_parent" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:paddingStart="5dp" android:paddingEnd="5dp" @@ -232,7 +232,7 @@ style="@style/ButtonSmallFontStyle" android:layout_width="0px" android:layout_height="fill_parent" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:paddingStart="5dp" android:paddingEnd="5dp" @@ -246,7 +246,7 @@ style="@style/ButtonSmallFontStyle" android:layout_width="0px" android:layout_height="fill_parent" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:paddingStart="5dp" android:paddingEnd="5dp" @@ -289,7 +289,7 @@ android:layout_width="wrap_content" android:layout_height="0dp" android:layout_gravity="center" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:drawableTop="@drawable/ic_loop_reconnect" android:paddingStart="10dp" @@ -311,7 +311,7 @@ style="@style/ButtonSmallFontStyle" android:layout_width="0px" android:layout_height="fill_parent" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:paddingStart="5dp" android:paddingEnd="5dp" @@ -325,7 +325,7 @@ style="@style/ButtonSmallFontStyle" android:layout_width="0px" android:layout_height="fill_parent" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:paddingStart="5dp" android:paddingEnd="5dp" @@ -339,7 +339,7 @@ style="@style/ButtonSmallFontStyle" android:layout_width="0px" android:layout_height="fill_parent" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:paddingStart="5dp" android:paddingEnd="5dp" @@ -353,7 +353,7 @@ style="@style/ButtonSmallFontStyle" android:layout_width="0px" android:layout_height="fill_parent" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:paddingStart="5dp" android:paddingEnd="5dp" @@ -367,7 +367,7 @@ style="@style/ButtonSmallFontStyle" android:layout_width="0px" android:layout_height="fill_parent" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:paddingStart="5dp" android:paddingEnd="5dp" diff --git a/app/src/main/res/layout/dialog_temptarget.xml b/app/src/main/res/layout/dialog_temptarget.xml index 3fc766f916..91e3adcdec 100644 --- a/app/src/main/res/layout/dialog_temptarget.xml +++ b/app/src/main/res/layout/dialog_temptarget.xml @@ -143,7 +143,7 @@ style="@style/ButtonSmallFontStyle" android:layout_width="0px" android:layout_height="fill_parent" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:drawableTop="@drawable/ic_target_cancel" android:paddingStart="5dp" @@ -158,7 +158,7 @@ style="@style/ButtonSmallFontStyle" android:layout_width="0px" android:layout_height="fill_parent" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:drawableTop="@drawable/ic_target_eatingsoon" android:paddingStart="5dp" @@ -173,7 +173,7 @@ style="@style/ButtonSmallFontStyle" android:layout_width="0px" android:layout_height="fill_parent" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:drawableTop="@drawable/ic_target_activity" android:paddingStart="5dp" diff --git a/app/src/main/res/layout/overview_buttons_layout.xml b/app/src/main/res/layout/overview_buttons_layout.xml index aaab5175ca..06f20ef9fc 100644 --- a/app/src/main/res/layout/overview_buttons_layout.xml +++ b/app/src/main/res/layout/overview_buttons_layout.xml @@ -41,7 +41,7 @@ style="@style/ButtonSmallFontStyle" android:layout_width="0px" android:layout_height="fill_parent" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:drawableTop="@drawable/icon_insulin_carbs" android:text="@string/overview_treatment_label" @@ -55,7 +55,7 @@ style="@style/ButtonSmallFontStyle" android:layout_width="0px" android:layout_height="fill_parent" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:drawableTop="@drawable/ic_bolus" android:text="@string/overview_insulin_label" @@ -68,7 +68,7 @@ style="@style/ButtonSmallFontStyle" android:layout_width="0px" android:layout_height="fill_parent" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:drawableTop="@drawable/ic_cp_bolus_carbs" android:text="@string/treatments_wizard_carbs_label" @@ -81,7 +81,7 @@ style="@style/ButtonSmallFontStyle" android:layout_width="0px" android:layout_height="fill_parent" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:drawableTop="@drawable/ic_calculator" android:text="@string/overview_calculator_label" @@ -94,7 +94,7 @@ style="@style/ButtonSmallFontStyle" android:layout_width="0px" android:layout_height="fill_parent" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:drawableTop="@drawable/ic_calibration" android:text="@string/overview_calibration" @@ -108,7 +108,7 @@ style="@style/ButtonSmallFontStyle" android:layout_width="0px" android:layout_height="fill_parent" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:drawableTop="@drawable/ic_xdrip" android:text="@string/overview_cgm" @@ -122,7 +122,7 @@ style="@style/ButtonSmallFontStyle" android:layout_width="0px" android:layout_height="fill_parent" - android:layout_marginEnd="-4dp" + android:layout_marginEnd="-2dp" android:layout_weight="0.5" android:drawableTop="@drawable/ic_quick_wizard" android:text="@string/quickwizard" diff --git a/app/src/main/res/layout/overview_fragment.xml b/app/src/main/res/layout/overview_fragment.xml index 20884ff07c..f2b69855b7 100644 --- a/app/src/main/res/layout/overview_fragment.xml +++ b/app/src/main/res/layout/overview_fragment.xml @@ -24,20 +24,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" /> - - - - @@ -107,7 +91,7 @@ android:layout_marginTop="4dp" app:cardCornerRadius="4dp" app:contentPadding="2dp" - app:cardElevation="4dp" + app:cardElevation="2dp" app:cardUseCompatPadding="false" android:layout_gravity="center"> @@ -127,7 +111,7 @@ android:layout_marginTop="4dp" app:cardCornerRadius="4dp" app:contentPadding="2dp" - app:cardElevation="4dp" + app:cardElevation="2dp" app:cardUseCompatPadding="false" android:layout_gravity="center"> @@ -188,7 +172,7 @@ android:layout_marginBottom="4dp" app:cardCornerRadius="4dp" app:contentPadding="2dp" - app:cardElevation="4dp" + app:cardElevation="2dp" app:cardUseCompatPadding="false" android:layout_gravity="center"> From 373d1569ab5397a93868819bd1b58c1e874ab9bd Mon Sep 17 00:00:00 2001 From: osodebailar Date: Wed, 20 Apr 2022 16:47:54 +0200 Subject: [PATCH 2/3] fix camelCase --- core/src/main/res/values/colors.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/res/values/colors.xml b/core/src/main/res/values/colors.xml index 7a16d13a03..0ca2f4f175 100644 --- a/core/src/main/res/values/colors.xml +++ b/core/src/main/res/values/colors.xml @@ -60,7 +60,7 @@ #FF000000 #C803A9F4 #FFFF5555 - #666666 + #666666 @color/white From cabc418116bd9f9b792c899662311788e862a8e9 Mon Sep 17 00:00:00 2001 From: osodebailar Date: Wed, 20 Apr 2022 17:40:05 +0200 Subject: [PATCH 3/3] fix color entry --- core/src/main/res/values-night/styles.xml | 2 +- core/src/main/res/values/styles.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/res/values-night/styles.xml b/core/src/main/res/values-night/styles.xml index f600c7701f..ad87401b60 100644 --- a/core/src/main/res/values-night/styles.xml +++ b/core/src/main/res/values-night/styles.xml @@ -242,7 +242,7 @@ @style/DatePicker @style/DatePicker - @color/defaulttext + @color/defaultText