From 22a1a68e958d30fd246d8230ad98e65a2b335891 Mon Sep 17 00:00:00 2001 From: Andries Smit Date: Mon, 31 Jan 2022 23:38:39 +0100 Subject: [PATCH] a11y add bg outdated state to description --- .../general/overview/OverviewFragment.kt | 7 ++++++- .../main/res/layout/overview_info_layout.xml | 2 +- app/src/main/res/values/strings.xml | 18 ++++++++++-------- 3 files changed, 17 insertions(+), 10 deletions(-) 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 fd5201ee2f..8748624e2d 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 @@ -751,7 +751,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList binding.infoLayout.bg.setTextColor(overviewData.lastBgColor) binding.infoLayout.arrow.setImageResource(trendCalculator.getTrendArrow(overviewData.lastBg).directionToIcon()) binding.infoLayout.arrow.setColorFilter(overviewData.lastBgColor) - binding.infoLayout.arrow.contentDescription = trendCalculator.getTrendDescription(overviewData.lastBg) + " " + overviewData.lastBgDescription + binding.infoLayout.arrow.contentDescription = overviewData.lastBgDescription + " " + rh.gs(R.string.and) + " " + trendCalculator.getTrendDescription(overviewData.lastBg) val glucoseStatus = glucoseStatusProvider.glucoseStatusData if (glucoseStatus != null) { @@ -771,6 +771,11 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList binding.infoLayout.bg.paintFlags = if (!overviewData.isActualBg) binding.infoLayout.bg.paintFlags or Paint.STRIKE_THRU_TEXT_FLAG else binding.infoLayout.bg.paintFlags and Paint.STRIKE_THRU_TEXT_FLAG.inv() + + val outDate = (if (!overviewData.isActualBg) rh.gs(R.string.a11y_bg_outdated) else "") + binding.infoLayout.bg.contentDescription = + rh.gs(R.string.a11y_blood_glucose) + " " + binding.infoLayout.bg.text.toString() + " " + overviewData.lastBgDescription + " " + outDate + binding.infoLayout.timeAgo.text = dateUtil.minAgo(rh, overviewData.lastBg?.timestamp) binding.infoLayout.timeAgo.contentDescription = dateUtil.minAgoLong(rh, overviewData.lastBg?.timestamp) binding.infoLayout.timeAgoShort.text = "(" + dateUtil.minAgoShort(overviewData.lastBg?.timestamp) + ")" diff --git a/app/src/main/res/layout/overview_info_layout.xml b/app/src/main/res/layout/overview_info_layout.xml index 2a8d2acab9..1cd5866c92 100644 --- a/app/src/main/res/layout/overview_info_layout.xml +++ b/app/src/main/res/layout/overview_info_layout.xml @@ -53,7 +53,7 @@ app:layout_constraintStart_toEndOf="@+id/delta_large" app:layout_constraintTop_toTopOf="parent" tools:ignore="UseCompoundDrawables" - android:screenReaderFocusable="true"> + android:focusable="true"> heigh in range low - down fast - down - down trending - flat - up trending - up - up fast + falling rapidly + falling + falling slowly + stable + rising slowly + rising + rising rapidly none unknown graph - Blood glucose quality + blood glucose quality recalculated double entries insulin + blood glucose + out dated