Skip to content
Snippets Groups Projects
Unverified Commit ef9ed485 authored by Oliver Zimmerman's avatar Oliver Zimmerman Committed by GitHub
Browse files

Removed 'Button' announcement on risk card (EXPOSUREAPP-1542) (#945)


* removed button announcement entirely

* removed assosciated test

* removed unneccesarry tests

Co-authored-by: default avatarJakob Möller <jakob.moeller@sap.com>
Co-authored-by: default avatarharambasicluka <64483219+harambasicluka@users.noreply.github.com>
parent 2a70f1a6
No related branches found
No related tags found
No related merge requests found
......@@ -329,35 +329,6 @@ fun formatNextUpdate(
}
}
/**
* Formats the risk card content description of time when diagnosis keys will be updated
* from server again when applicable but appends the word button at the end for screen reader accessibility reasons
*
* @param riskLevelScore
* @param isBackgroundJobEnabled
* @return
*/
fun formatNextUpdateContentDescription(
riskLevelScore: Int?,
isBackgroundJobEnabled: Boolean?
): String {
val appContext = CoronaWarnApplication.getAppContext()
return if (isBackgroundJobEnabled != true) {
""
} else {
return when (riskLevelScore) {
RiskLevelConstants.UNKNOWN_RISK_INITIAL,
RiskLevelConstants.LOW_LEVEL_RISK,
RiskLevelConstants.INCREASED_RISK -> appContext.getString(
R.string.risk_card_body_next_update
) + " " + appContext.getString(
R.string.accessibility_button
)
else -> ""
}
}
}
/**
* Formats the risk details text display for each risk level
*
......
......@@ -227,7 +227,6 @@
android:layout_width="@dimen/match_constraint"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_small"
android:contentDescription="@{FormatterRiskHelper.formatNextUpdateContentDescription(tracingViewModel.riskLevel, settingsViewModel.isBackgroundJobEnabled())}"
android:text="@{FormatterRiskHelper.formatNextUpdate(tracingViewModel.riskLevel, settingsViewModel.isBackgroundJobEnabled())}"
android:textColor="@{FormatterRiskHelper.formatStableTextColor(tracingViewModel.riskLevel)}"
app:layout_constraintEnd_toEndOf="parent"
......
......@@ -173,24 +173,6 @@ class FormatterRiskHelperTest {
)
}
private fun formatNextUpdateContentDescriptionBase(
iRiskLevelScore: Int?,
bIsBackgroundJobEnabled: Boolean?,
sValue: String
) {
every { context.getString(R.string.risk_card_body_next_update) } returns R.string.risk_card_body_next_update.toString()
every { context.getString(R.string.accessibility_button) } returns R.string.accessibility_button.toString()
val result =
formatNextUpdateContentDescription(
riskLevelScore = iRiskLevelScore,
isBackgroundJobEnabled = bIsBackgroundJobEnabled
)
assertThat(
result, `is`(sValue)
)
}
private fun formatRiskDetailsRiskLevelBodyBase(
iRiskLevelScore: Int?,
iDaysSinceLastExposure: Int?,
......@@ -980,79 +962,6 @@ class FormatterRiskHelperTest {
)
}
@Test
fun formatNextUpdateContentDescription() {
formatNextUpdateContentDescriptionBase(
iRiskLevelScore = null,
bIsBackgroundJobEnabled = null,
sValue = ""
)
formatNextUpdateContentDescriptionBase(
iRiskLevelScore = RiskLevelConstants.INCREASED_RISK,
bIsBackgroundJobEnabled = null,
sValue = ""
)
formatNextUpdateContentDescriptionBase(
iRiskLevelScore = RiskLevelConstants.UNKNOWN_RISK_OUTDATED_RESULTS,
bIsBackgroundJobEnabled = null,
sValue = ""
)
formatNextUpdateContentDescriptionBase(
iRiskLevelScore = RiskLevelConstants.NO_CALCULATION_POSSIBLE_TRACING_OFF,
bIsBackgroundJobEnabled = null,
sValue = ""
)
formatNextUpdateContentDescriptionBase(
iRiskLevelScore = RiskLevelConstants.LOW_LEVEL_RISK,
bIsBackgroundJobEnabled = null,
sValue = ""
)
formatNextUpdateContentDescriptionBase(
iRiskLevelScore = RiskLevelConstants.UNKNOWN_RISK_INITIAL,
bIsBackgroundJobEnabled = null,
sValue = ""
)
formatNextUpdateContentDescriptionBase(
iRiskLevelScore = null,
bIsBackgroundJobEnabled = true,
sValue = ""
)
formatNextUpdateContentDescriptionBase(
iRiskLevelScore = RiskLevelConstants.INCREASED_RISK,
bIsBackgroundJobEnabled = true,
sValue = context.getString(
R.string.risk_card_body_next_update
) + " " + context.getString(
R.string.accessibility_button
)
)
formatNextUpdateContentDescriptionBase(
iRiskLevelScore = RiskLevelConstants.UNKNOWN_RISK_OUTDATED_RESULTS,
bIsBackgroundJobEnabled = true,
sValue = ""
)
formatNextUpdateContentDescriptionBase(
iRiskLevelScore = RiskLevelConstants.LOW_LEVEL_RISK,
bIsBackgroundJobEnabled = true,
sValue = context.getString(
R.string.risk_card_body_next_update
) + " " + context.getString(
R.string.accessibility_button
)
)
formatNextUpdateContentDescriptionBase(
iRiskLevelScore = RiskLevelConstants.UNKNOWN_RISK_INITIAL,
bIsBackgroundJobEnabled = true,
sValue = context.getString(
R.string.risk_card_body_next_update
) + " " + context.getString(
R.string.accessibility_button
)
)
}
@Test
fun formatRiskDetailsRiskLevelBody() {
formatRiskDetailsRiskLevelBodyBase(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment