From ff378579c4d3108ce7775e09e3e7b258d1aab402 Mon Sep 17 00:00:00 2001 From: osodebailar Date: Wed, 27 Jul 2022 09:45:09 +0200 Subject: [PATCH] fix button style --- .../androidaps/plugins/general/actions/ActionsFragment.kt | 2 +- .../androidaps/plugins/general/overview/OverviewFragment.kt | 2 +- core/src/main/res/values-night/styles.xml | 2 ++ core/src/main/res/values/attrs.xml | 2 ++ core/src/main/res/values/styles.xml | 2 ++ 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt index 92002eab4d..ff3fc89a4a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt @@ -312,7 +312,7 @@ class ActionsFragment : DaggerFragment() { for (customAction in customActions) { if (!customAction.isEnabled) continue - val btn = SingleClickButton(currentContext, null, android.R.attr.buttonStyle) + val btn = SingleClickButton(currentContext, null, R.attr.customBtnStyle) btn.text = rh.gs(customAction.name) val layoutParams = LinearLayout.LayoutParams( diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt index 8ecba9d5ad..d6ca34ab63 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt @@ -582,7 +582,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList for (event in events) if (event.isEnabled && event.trigger.shouldRun()) context?.let { context -> - SingleClickButton(context).also { + SingleClickButton(context, null, R.attr.customBtnStyle).also { it.setTextColor(rh.gac(context, R.attr.treatmentButton)) it.setTextSize(TypedValue.COMPLEX_UNIT_SP, 10f) it.layoutParams = LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.MATCH_PARENT, 0.5f).also { l -> diff --git a/core/src/main/res/values-night/styles.xml b/core/src/main/res/values-night/styles.xml index 3a9fe781b5..dfd244db24 100644 --- a/core/src/main/res/values-night/styles.xml +++ b/core/src/main/res/values-night/styles.xml @@ -248,6 +248,8 @@ @color/white @style/CommonSpinnerItemStyle + + @style/GrayButton diff --git a/core/src/main/res/values/attrs.xml b/core/src/main/res/values/attrs.xml index 0c9e53b9b7..5c5146e42d 100644 --- a/core/src/main/res/values/attrs.xml +++ b/core/src/main/res/values/attrs.xml @@ -218,4 +218,6 @@ + + \ No newline at end of file diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index b831de330c..a471a947dc 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -249,6 +249,8 @@ @color/white @style/CommonSpinnerItemStyle + + @style/GrayButton