optimze overview and singleclick margin

This commit is contained in:
osodebailar 2022-04-20 14:55:54 +02:00
parent b59d816a19
commit 44cc22c699
5 changed files with 30 additions and 53 deletions

View file

@ -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 {

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -24,20 +24,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/loopCard"
style="@style/Widget.MaterialComponents.CardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_marginTop="4dp"
app:cardCornerRadius="4dp"
app:contentPadding="2dp"
app:cardElevation="4dp"
app:cardUseCompatPadding="false"
android:layout_gravity="center">
<LinearLayout
android:id="@+id/loop_layout"
android:layout_width="match_parent"
@ -75,8 +61,6 @@
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/infoCard"
style="@style/Widget.MaterialComponents.CardView"
@ -87,7 +71,7 @@
android:layout_marginTop="4dp"
app:cardCornerRadius="4dp"
app:contentPadding="2dp"
app:cardElevation="4dp"
app:cardElevation="2dp"
app:cardUseCompatPadding="false"
android:layout_gravity="center">
@ -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">