-
Notifications
You must be signed in to change notification settings - Fork 494
Refactor riskcard & states; Chapter1 (EXPOSUREAPP-4049, EXPOSUREAPP-3834) #1751
Conversation
Replaced RiskLevel and RiskLevelConstants with RiskState { LOW; HIGH, FAILED }.
# Conflicts: # Corona-Warn-App/src/main/java/de/rki/coronawarnapp/risk/storage/BaseRiskLevelStorage.kt # Corona-Warn-App/src/test/java/de/rki/coronawarnapp/risk/storage/internal/PersistedRiskResultDaoTest.kt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some suggestions on how to make is easier to understand
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/risk/RiskLevelChangeDetector.kt
Outdated
Show resolved
Hide resolved
...a-Warn-App/src/main/java/de/rki/coronawarnapp/risk/storage/legacy/RiskLevelResultMigrator.kt
Show resolved
Hide resolved
...a-Warn-App/src/main/java/de/rki/coronawarnapp/risk/storage/legacy/RiskLevelResultMigrator.kt
Outdated
Show resolved
Hide resolved
@@ -26,28 +29,26 @@ data class TracingDetailsState( | |||
* in all cases when risk level is not increased | |||
*/ | |||
fun isBehaviorNormalVisible(): Boolean = | |||
riskLevelScore != RiskLevelConstants.INCREASED_RISK | |||
riskState != INCREASED_RISK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why we do not simply call it HIGH_RISK? (independent of the wording we use to display it to the user) As far as I understand, it's either low = green or high = red
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had it previously named like that and @harambasicluka expressed the desire to keep it INCREASED_RISK
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to have it consistently used in our app and as I think it's called increased risk in the protobuff files and since the beginning I would stick to increased risk.
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/tracing/details/TracingDetailsState.kt
Show resolved
Hide resolved
) | ||
|
||
val isRestartButtonEnabled = !isBackgroundJobEnabled || latestCalc.riskState == RiskState.CALCULATION_FAILED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here isBackgroundJosDisabled instead of negation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we would have to negate isAutoModeEnabled
and negate it again in other places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about having both, like val isBackgroundJobDisabled with get() =!isBackgroundJobEnabled, but it's just a suggestion
Corona-Warn-App/src/test/java/de/rki/coronawarnapp/risk/RiskLevelChangeDetectorTest.kt
Outdated
Show resolved
Hide resolved
# Conflicts: # Corona-Warn-App/src/main/java/de/rki/coronawarnapp/risk/RiskLevelChangeDetector.kt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coding LGTM, just one question, we did you choose such a dramatic title with: ... Chapter1
? :D
Will do device testing.
The implementation is still not where it should be. It's still one multipurpose card doing everything, and I want to have separate cards and layouts, the home screen should be using a list with dynamic elements. Time did not allow me yet to do this, so |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did some serious device testing! Great work. Works very smoothly.
Kudos, SonarCloud Quality Gate passed! |
I deactivated wifi during downloading got in the correct state, also disabled tracing and this was visible. Then I enabled tracing and wifi and the download started. as it was showing the download it turned from the failure to green, but still was in the loading state and displaying that it's downloading and the second state of the loading state for the calculation was visible but seemed to be executes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have noted down some follow up tasks:
- card flickering: tracingrepository.refreshRisklevel
- color change before apparent risk calculation
- string singular high risk
I would propose: OT: What is the beautiful 'Corona-C' inside the |
Thank's for your proposal, we currently discussing it with our User Assistance colleagues :) But I think we'll stick to the structure, even if I would prefer your idea :)
It's one of our notifications, so that's one of my test devices not sure if I got an reminder to update the more more frequently or my risk changed from low to high :) Both is already in production ;) |
Let's see, I found UA being quite exact wrt language, maybe they'll also see the need for a change :)
Ha, never saw a notification yet, that's why I d didn't get it immediately ;) |
RiskLevelConstants
which we not useful anymore and just unnecessary complicatedRiskLevel
toRiskState
which just has 3 states nowINCREASED_RISK
,LOW_RISK
,FAILED
TODO
Testing