diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyRegistrationScreen.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyRegistrationScreen.kt index 94b24d46..b434cc1d 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyRegistrationScreen.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyRegistrationScreen.kt @@ -2,18 +2,13 @@ package com.wap.wapp.feature.management.survey.registration import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.LinearProgressIndicator import androidx.compose.material3.Scaffold import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHostState -import androidx.compose.material3.Text import androidx.compose.material3.rememberTimePickerState import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect @@ -22,10 +17,7 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.StrokeCap -import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import com.wap.designsystem.WappTheme @@ -176,49 +168,3 @@ internal fun SurveyRegistrationScreen( } } } - -@Composable -private fun SurveyRegistrationStateIndicator( - surveyRegistrationState: SurveyRegistrationState, -) { - Column( - horizontalAlignment = Alignment.CenterHorizontally, - verticalArrangement = Arrangement.spacedBy(8.dp), - ) { - SurveyRegistrationStateProgressBar(surveyRegistrationState.progress) - SurveyRegistrationStateText(surveyRegistrationState.page) - } -} - -@Composable -private fun SurveyRegistrationStateText( - currentRegistrationPage: String, -) { - Row { - Text( - text = currentRegistrationPage, - style = WappTheme.typography.contentMedium, - color = WappTheme.colors.yellow34, - ) - Text( - text = stringResource(R.string.survey_registration_total_page), - style = WappTheme.typography.contentMedium, - color = WappTheme.colors.white, - ) - } -} - -@Composable -private fun SurveyRegistrationStateProgressBar( - currentRegistrationProgress: Float, -) { - LinearProgressIndicator( - modifier = Modifier - .fillMaxWidth() - .height(10.dp), - color = WappTheme.colors.yellow34, - trackColor = WappTheme.colors.white, - progress = currentRegistrationProgress, - strokeCap = StrokeCap.Round, - ) -} diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyRegistrationStateIndicator.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyRegistrationStateIndicator.kt new file mode 100644 index 00000000..f09abc2b --- /dev/null +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyRegistrationStateIndicator.kt @@ -0,0 +1,63 @@ +package com.wap.wapp.feature.management.survey.registration + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.material3.LinearProgressIndicator +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.StrokeCap +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import com.wap.designsystem.WappTheme +import com.wap.wapp.feature.management.survey.R + +@Composable +internal fun SurveyRegistrationStateIndicator( + surveyRegistrationState: SurveyRegistrationState, +) { + Column( + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.spacedBy(8.dp), + ) { + SurveyRegistrationStateProgressBar(surveyRegistrationState.progress) + SurveyRegistrationStateText(surveyRegistrationState.page) + } +} + +@Composable +private fun SurveyRegistrationStateText( + currentRegistrationPage: String, +) { + Row { + Text( + text = currentRegistrationPage, + style = WappTheme.typography.contentMedium, + color = WappTheme.colors.yellow34, + ) + Text( + text = stringResource(R.string.survey_registration_total_page), + style = WappTheme.typography.contentMedium, + color = WappTheme.colors.white, + ) + } +} + +@Composable +private fun SurveyRegistrationStateProgressBar( + currentRegistrationProgress: Float, +) { + LinearProgressIndicator( + modifier = Modifier + .fillMaxWidth() + .height(10.dp), + color = WappTheme.colors.yellow34, + trackColor = WappTheme.colors.white, + progress = currentRegistrationProgress, + strokeCap = StrokeCap.Round, + ) +}