From 2baa0b81871a10314e307d3d108353c939ba873d Mon Sep 17 00:00:00 2001 From: PINAKIN-KANSARA-EY Date: Wed, 20 Sep 2023 10:29:40 -0700 Subject: [PATCH] HAPP-1656 progress indicator rollback - rollback to regular progress indicator. --- .../component/HGCircularProgressIndicator.kt | 29 +++++++++++++++++++ .../ui/healthrecord/HealthRecordScreen.kt | 7 ++--- .../ca/bc/gov/bchealth/ui/home/HomeScreen.kt | 4 +-- .../manage/QuickAccessManagementScreen.kt | 4 +-- .../recommendations/RecommendationScreen.kt | 4 +-- .../bchealth/ui/services/ServicesScreen.kt | 4 +-- scripts/versions.gradle | 2 +- 7 files changed, 41 insertions(+), 13 deletions(-) create mode 100644 app/src/main/java/ca/bc/gov/bchealth/compose/component/HGCircularProgressIndicator.kt diff --git a/app/src/main/java/ca/bc/gov/bchealth/compose/component/HGCircularProgressIndicator.kt b/app/src/main/java/ca/bc/gov/bchealth/compose/component/HGCircularProgressIndicator.kt new file mode 100644 index 000000000..0cc614876 --- /dev/null +++ b/app/src/main/java/ca/bc/gov/bchealth/compose/component/HGCircularProgressIndicator.kt @@ -0,0 +1,29 @@ +package ca.bc.gov.bchealth.compose.component + +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.material.CircularProgressIndicator +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import ca.bc.gov.bchealth.compose.BasePreview +import ca.bc.gov.bchealth.compose.theme.HealthGatewayTheme + +@Composable +fun HGCircularProgressIndicator( + modifier: Modifier = Modifier +) { + Box(modifier = modifier.fillMaxSize()) { + CircularProgressIndicator( + modifier = Modifier.align(Alignment.Center), + ) + } +} + +@BasePreview +@Composable +private fun HGCircularProgressIndicatorPreview() { + HealthGatewayTheme { + HGCircularProgressIndicator() + } +} diff --git a/app/src/main/java/ca/bc/gov/bchealth/ui/healthrecord/HealthRecordScreen.kt b/app/src/main/java/ca/bc/gov/bchealth/ui/healthrecord/HealthRecordScreen.kt index 7b15f86b9..96163ccb8 100644 --- a/app/src/main/java/ca/bc/gov/bchealth/ui/healthrecord/HealthRecordScreen.kt +++ b/app/src/main/java/ca/bc/gov/bchealth/ui/healthrecord/HealthRecordScreen.kt @@ -1,5 +1,3 @@ -@file:OptIn(ExperimentalMaterialApi::class) - package ca.bc.gov.bchealth.ui.healthrecord import androidx.compose.foundation.layout.Arrangement @@ -30,7 +28,7 @@ import androidx.work.WorkManager import ca.bc.gov.bchealth.R import ca.bc.gov.bchealth.compose.BasePreview import ca.bc.gov.bchealth.compose.component.EmptyStateUI -import ca.bc.gov.bchealth.compose.component.HGProgressIndicator +import ca.bc.gov.bchealth.compose.component.HGCircularProgressIndicator import ca.bc.gov.bchealth.compose.component.HealthRecordItemUI import ca.bc.gov.bchealth.compose.component.HorizontalFilterGroupUI import ca.bc.gov.bchealth.compose.component.ImmunizationBannerUI @@ -140,6 +138,7 @@ fun HealthRecordScreen( ) } +@ExperimentalMaterialApi @Composable private fun HealthRecordScreenContent( onPullToRefresh: () -> Unit, @@ -161,7 +160,7 @@ private fun HealthRecordScreenContent( Box(modifier = Modifier.pullRefresh(pullToRefresh)) { if (uiState.isLoading) { - HGProgressIndicator() + HGCircularProgressIndicator() } else { Column( modifier = modifier diff --git a/app/src/main/java/ca/bc/gov/bchealth/ui/home/HomeScreen.kt b/app/src/main/java/ca/bc/gov/bchealth/ui/home/HomeScreen.kt index f78b468c5..b5a9c832e 100644 --- a/app/src/main/java/ca/bc/gov/bchealth/ui/home/HomeScreen.kt +++ b/app/src/main/java/ca/bc/gov/bchealth/ui/home/HomeScreen.kt @@ -37,7 +37,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import ca.bc.gov.bchealth.R import ca.bc.gov.bchealth.compose.BasePreview import ca.bc.gov.bchealth.compose.component.AnnouncementBannerUI -import ca.bc.gov.bchealth.compose.component.HGProgressIndicator +import ca.bc.gov.bchealth.compose.component.HGCircularProgressIndicator import ca.bc.gov.bchealth.compose.component.HGTextButton import ca.bc.gov.bchealth.compose.component.LoginInfoCardUI import ca.bc.gov.bchealth.compose.component.QuickAccessTileItemUI @@ -75,7 +75,7 @@ fun HomeScreen( } if (uiState.isLoading) { - HGProgressIndicator(modifier) + HGCircularProgressIndicator(modifier) } else { uiState.launchCheckStatus?.let { when (it) { diff --git a/app/src/main/java/ca/bc/gov/bchealth/ui/home/manage/QuickAccessManagementScreen.kt b/app/src/main/java/ca/bc/gov/bchealth/ui/home/manage/QuickAccessManagementScreen.kt index e7241c7cd..59cec498a 100644 --- a/app/src/main/java/ca/bc/gov/bchealth/ui/home/manage/QuickAccessManagementScreen.kt +++ b/app/src/main/java/ca/bc/gov/bchealth/ui/home/manage/QuickAccessManagementScreen.kt @@ -28,7 +28,7 @@ import ca.bc.gov.bchealth.compose.BasePreview import ca.bc.gov.bchealth.compose.MyHealthTheme import ca.bc.gov.bchealth.compose.MyHealthTypography import ca.bc.gov.bchealth.compose.bold -import ca.bc.gov.bchealth.compose.component.HGProgressIndicator +import ca.bc.gov.bchealth.compose.component.HGCircularProgressIndicator import ca.bc.gov.bchealth.compose.theme.primaryBlue import ca.bc.gov.bchealth.compose.theme.statusBlue import ca.bc.gov.bchealth.compose.theme.white @@ -47,7 +47,7 @@ fun QuickAccessManagementScreen( } if (uiState.isLoading) { - HGProgressIndicator(modifier) + HGCircularProgressIndicator(modifier) } else { QuickAccessManagementContent(uiState.featureWithQuickAccessItems, onClickItem = onClickItem) } diff --git a/app/src/main/java/ca/bc/gov/bchealth/ui/recommendations/RecommendationScreen.kt b/app/src/main/java/ca/bc/gov/bchealth/ui/recommendations/RecommendationScreen.kt index dad0746da..07a71a443 100644 --- a/app/src/main/java/ca/bc/gov/bchealth/ui/recommendations/RecommendationScreen.kt +++ b/app/src/main/java/ca/bc/gov/bchealth/ui/recommendations/RecommendationScreen.kt @@ -20,7 +20,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.work.WorkManager import ca.bc.gov.bchealth.R import ca.bc.gov.bchealth.compose.BasePreview -import ca.bc.gov.bchealth.compose.component.HGProgressIndicator +import ca.bc.gov.bchealth.compose.component.HGCircularProgressIndicator import ca.bc.gov.bchealth.compose.theme.HealthGatewayTheme import ca.bc.gov.bchealth.compose.theme.grey import ca.bc.gov.bchealth.ui.custom.MyHealthClickableText @@ -51,7 +51,7 @@ fun RecommendationScreen( } if (uiState.isLoading) { - HGProgressIndicator(modifier) + HGCircularProgressIndicator(modifier) } else { RecommendationScreenContent( modifier, diff --git a/app/src/main/java/ca/bc/gov/bchealth/ui/services/ServicesScreen.kt b/app/src/main/java/ca/bc/gov/bchealth/ui/services/ServicesScreen.kt index 4de5692e3..2aef35462 100644 --- a/app/src/main/java/ca/bc/gov/bchealth/ui/services/ServicesScreen.kt +++ b/app/src/main/java/ca/bc/gov/bchealth/ui/services/ServicesScreen.kt @@ -35,7 +35,7 @@ import ca.bc.gov.bchealth.R import ca.bc.gov.bchealth.compose.BasePreview import ca.bc.gov.bchealth.compose.MyHealthTheme import ca.bc.gov.bchealth.compose.MyHealthTypography -import ca.bc.gov.bchealth.compose.component.HGProgressIndicator +import ca.bc.gov.bchealth.compose.component.HGCircularProgressIndicator import ca.bc.gov.common.model.services.OrganDonorStatusDto @Composable @@ -107,7 +107,7 @@ private fun ServiceScreenContent( Spacer(modifier = Modifier.height(16.dp)) if (onLoading || organDonorRegistrationDetail == null) { - HGProgressIndicator(modifier) + HGCircularProgressIndicator(modifier) } else { OrganDonor(organDonorRegistrationDetail, organDonorFileStatus, onRegisterOnUpdateDecisionClicked = { url -> onRegisterOnUpdateDecisionClicked(url) diff --git a/scripts/versions.gradle b/scripts/versions.gradle index b17032335..0b106cfef 100644 --- a/scripts/versions.gradle +++ b/scripts/versions.gradle @@ -7,7 +7,7 @@ versions.compileSdkVersion = 33 //App versions.versionName = '2.0.0' -versions.versionCode = 211 +versions.versionCode = 212 versions.localApiVersion = 2 //Tools & Libs