-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de4e6f4
commit 5d5897c
Showing
2 changed files
with
63 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
...a/com/wap/wapp/feature/management/survey/registration/SurveyRegistrationStateIndicator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
) | ||
} |