Skip to content

Commit

Permalink
Harmonize sync status files.
Browse files Browse the repository at this point in the history
Signed-off-by: Lentumunai-Mark <[email protected]>
  • Loading branch information
Lentumunai-Mark committed Dec 13, 2024
1 parent e642ec0 commit 4646b49
Showing 1 changed file with 35 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,48 +354,49 @@ fun SyncStatusView(
fontWeight = FontWeight.SemiBold,

Check warning on line 354 in android/quest/src/main/java/org/smartregister/fhircore/quest/ui/shared/components/SyncStatusView.kt

View check run for this annotation

Codecov / codecov/patch

android/quest/src/main/java/org/smartregister/fhircore/quest/ui/shared/components/SyncStatusView.kt#L353-L354

Added lines #L353 - L354 were not covered by tests
)

Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.padding(start = 16.dp),
) {
if (currentSyncJobStatus is CurrentSyncJobStatus.Running) {
LineSpinFadeLoaderProgressIndicator(
color = Color.White,
lineLength = 8f,
innerRadius = 12f,
)
}
if (
(currentSyncJobStatus is CurrentSyncJobStatus.Failed ||
currentSyncJobStatus is CurrentSyncJobStatus.Running) && !minimized
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.padding(start = 16.dp),
) {
Text(
text =
stringResource(
if (currentSyncJobStatus is CurrentSyncJobStatus.Failed) {
org.smartregister.fhircore.engine.R.string.retry
} else {
org.smartregister.fhircore.engine.R.string.cancel
if (currentSyncJobStatus is CurrentSyncJobStatus.Running) {
LineSpinFadeLoaderProgressIndicator(
color = Color.White,
lineLength = 8f,
innerRadius = 12f,
)
}
if (
(currentSyncJobStatus is CurrentSyncJobStatus.Failed ||
currentSyncJobStatus is CurrentSyncJobStatus.Running) && !minimized
) {
Text(
text =
stringResource(
if (currentSyncJobStatus is CurrentSyncJobStatus.Failed) {
org.smartregister.fhircore.engine.R.string.retry
} else {
org.smartregister.fhircore.engine.R.string.cancel
},
),
modifier =
Modifier.padding(start = 16.dp).clickable {
if (currentSyncJobStatus is CurrentSyncJobStatus.Failed) {
onRetry()
} else {
onCancel()
}
},
),
modifier =
Modifier.padding(start = 16.dp).clickable {
if (currentSyncJobStatus is CurrentSyncJobStatus.Failed) {
onRetry()
} else {
onCancel()
}
},
color = MaterialTheme.colors.primary,
fontWeight = FontWeight.SemiBold,
)
color = MaterialTheme.colors.primary,
fontWeight = FontWeight.SemiBold,
)
}
}
}
}
}

@Composable
private fun SyncStatusTitle(
fun SyncStatusTitle(
text: String,
color: Color = Color.Unspecified,
minimized: Boolean,
Expand Down

0 comments on commit 4646b49

Please sign in to comment.