a11y add bg outdated state to description

This commit is contained in:
Andries Smit 2022-01-31 23:38:39 +01:00
parent 29d5c5f76a
commit 22a1a68e95
3 changed files with 17 additions and 10 deletions

View file

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

View file

@ -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">
<ImageView
android:id="@+id/arrow"

View file

@ -1165,19 +1165,21 @@
<string name="a11y_high">heigh</string>
<string name="a11y_inrange">in range</string>
<string name="a11y_low">low</string>
<string name="a11y_arrow_double_down">down fast</string>
<string name="a11y_arrow_single_down">down</string>
<string name="a11y_arrow_forty_five_down">down trending</string>
<string name="a11y_arrow_flat">flat</string>
<string name="a11y_arrow_forty_five_up">up trending</string>
<string name="a11y_arrow_single_up">up</string>
<string name="a11y_arrow_double_up">up fast</string>
<string name="a11y_arrow_double_down">falling rapidly</string>
<string name="a11y_arrow_single_down">falling</string>
<string name="a11y_arrow_forty_five_down">falling slowly</string>
<string name="a11y_arrow_flat">stable</string>
<string name="a11y_arrow_forty_five_up">rising slowly</string>
<string name="a11y_arrow_single_up">rising</string>
<string name="a11y_arrow_double_up">rising rapidly</string>
<string name="a11y_arrow_none">none</string>
<string name="a11y_arrow_unknown">unknown</string>
<string name="a11y_graph">graph</string>
<string name="a11y_bg_quality">Blood glucose quality</string>
<string name="a11y_bg_quality">blood glucose quality</string>
<string name="a11_bg_quality_recalculated">recalculated</string>
<string name="a11_bg_quality_doubles">double entries</string>
<string name="a11y_insulin_label">insulin</string>
<string name="a11y_blood_glucose">blood glucose</string>
<string name="a11y_bg_outdated">out dated</string>
</resources>