Skip to content

Commit

Permalink
[CHORE] #93 : Indicator 컴포넌트 불리
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongjaino committed Jan 8, 2024
1 parent de4e6f4 commit 5d5897c
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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,
)
}
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,
)
}

0 comments on commit 5d5897c

Please sign in to comment.