Skip to content

Commit

Permalink
[FEAT/#206] paddingValues ์ ์šฉ
Browse files Browse the repository at this point in the history
  • Loading branch information
leeeyubin committed Sep 4, 2024
1 parent d0f394c commit 2c3ac87
Show file tree
Hide file tree
Showing 15 changed files with 134 additions and 57 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.terning.feature.filtering.filtering

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
Expand All @@ -21,6 +23,7 @@ import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar
import com.terning.core.designsystem.theme.Grey300
import com.terning.core.designsystem.theme.TerningPointTheme
import com.terning.core.designsystem.theme.TerningTheme
import com.terning.core.designsystem.theme.White
import com.terning.feature.R
import com.terning.feature.filtering.filtering.component.StatusOneRadioGroup

Expand All @@ -30,6 +33,7 @@ fun FilteringOneScreen(
onNextClick: (Int) -> Unit,
navigateUp: () -> Unit,
modifier: Modifier = Modifier,
paddingValues: PaddingValues = PaddingValues(),
onButtonClick: (Int) -> Unit = {},
) {
val isButtonValid = remember { mutableStateOf(false) }
Expand All @@ -38,6 +42,8 @@ fun FilteringOneScreen(

Column(
modifier = modifier
.padding(paddingValues)
.background(White)
) {
BackButtonTopAppBar(
onBackButtonClick = { navigateUp() }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.terning.feature.filtering.filtering

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
Expand All @@ -26,6 +28,7 @@ import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar
import com.terning.core.designsystem.theme.Grey300
import com.terning.core.designsystem.theme.TerningPointTheme
import com.terning.core.designsystem.theme.TerningTheme
import com.terning.core.designsystem.theme.White
import com.terning.core.extension.toast
import com.terning.feature.R
import java.util.Calendar
Expand All @@ -37,6 +40,7 @@ fun FilteringThreeRoute(
navigateUp: () -> Unit,
navigateToStartHome: () -> Unit,
viewModel: FilteringViewModel = hiltViewModel(),
paddingValues: PaddingValues
) {
val context = LocalContext.current
val lifecycleOwner = LocalLifecycleOwner.current
Expand Down Expand Up @@ -68,6 +72,7 @@ fun FilteringThreeRoute(
}

FilteringThreeScreen(
paddingValues = paddingValues,
navigateUp = { navigateUp() },
chosenYear = chosenYear,
chosenMonth = chosenMonth,
Expand All @@ -80,6 +85,7 @@ fun FilteringThreeRoute(
@Composable
fun FilteringThreeScreen(
modifier: Modifier = Modifier,
paddingValues: PaddingValues = PaddingValues(),
navigateUp: () -> Unit,
chosenYear: Int,
chosenMonth: Int,
Expand All @@ -88,7 +94,9 @@ fun FilteringThreeScreen(
onNextClick: () -> Unit,
) {
Column(
modifier = modifier,
modifier = modifier
.padding(paddingValues)
.background(White),
) {
BackButtonTopAppBar(
onBackButtonClick = { navigateUp() }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.terning.feature.filtering.filtering

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
Expand All @@ -21,6 +23,7 @@ import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar
import com.terning.core.designsystem.theme.Grey300
import com.terning.core.designsystem.theme.TerningPointTheme
import com.terning.core.designsystem.theme.TerningTheme
import com.terning.core.designsystem.theme.White
import com.terning.feature.R
import com.terning.feature.filtering.filtering.component.StatusTwoRadioGroup

Expand All @@ -30,6 +33,7 @@ fun FilteringTwoScreen(
onNextClick: (Int, Int) -> Unit,
navigateUp: () -> Unit,
modifier: Modifier = Modifier,
paddingValues: PaddingValues = PaddingValues(),
onButtonClick: (Int) -> Unit = {},
) {
val isButtonValid = remember { mutableStateOf(false) }
Expand All @@ -38,6 +42,8 @@ fun FilteringTwoScreen(

Column(
modifier = modifier
.padding(paddingValues)
.background(White)
) {
BackButtonTopAppBar(
onBackButtonClick = { navigateUp() }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.terning.feature.filtering.filtering.navigation

import androidx.compose.foundation.layout.PaddingValues
import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavHostController
Expand All @@ -21,11 +22,13 @@ fun NavController.navigateFilteringOne(
}

fun NavGraphBuilder.filteringOneNavGraph(
paddingValues: PaddingValues,
navHostController: NavHostController
) {
composable<FilteringOne> {
val args = it.toRoute<FilteringOne>()
FilteringOneScreen(
paddingValues = paddingValues,
name = args.name,
onNextClick = { grade -> navHostController.navigateFilteringTwo(grade) },
navigateUp = { navHostController.navigateUp() }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.terning.feature.filtering.filtering.navigation

import androidx.compose.foundation.layout.PaddingValues
import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavHostController
Expand All @@ -23,11 +24,13 @@ fun NavController.navigateFilteringThree(
}

fun NavGraphBuilder.filteringThreeNavGraph(
paddingValues: PaddingValues,
navHostController: NavHostController
) {
composable<FilteringThree> {
val args = it.toRoute<FilteringThree>()
FilteringThreeRoute(
paddingValues = paddingValues,
grade = args.grade,
workingPeriod = args.workingPeriod,
navigateUp = { navHostController.navigateUp() },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.terning.feature.filtering.filtering.navigation

import androidx.compose.foundation.layout.PaddingValues
import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavHostController
Expand All @@ -21,11 +22,13 @@ fun NavController.navigateFilteringTwo(
}

fun NavGraphBuilder.filteringTwoNavGraph(
paddingValues: PaddingValues,
navHostController: NavHostController
) {
composable<FilteringTwo> {
val args = it.toRoute<FilteringTwo>()
FilteringTwoScreen(
paddingValues = paddingValues,
grade = args.grade,
onNextClick = { _, workingPeriod ->
navHostController.navigateFilteringThree(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package com.terning.feature.filtering.startfiltering

import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.fadeIn
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
Expand All @@ -27,12 +29,14 @@ import com.terning.core.designsystem.component.button.RectangleButton
import com.terning.core.designsystem.component.image.TerningImage
import com.terning.core.designsystem.theme.TerningPointTheme
import com.terning.core.designsystem.theme.TerningTheme
import com.terning.core.designsystem.theme.White
import com.terning.feature.R
import kotlinx.coroutines.delay

@Composable
fun StartFilteringScreen(
modifier: Modifier = Modifier,
paddingValues: PaddingValues = PaddingValues(),
onNextClick: () -> Unit
) {
var isVisible by remember { mutableStateOf(false) }
Expand All @@ -46,7 +50,10 @@ fun StartFilteringScreen(
}

Box(
modifier = modifier.fillMaxSize()
modifier = modifier
.fillMaxSize()
.padding(paddingValues)
.background(White)
) {
Column(
modifier = Modifier.fillMaxSize(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.terning.feature.filtering.startfiltering.navigation

import androidx.compose.foundation.layout.PaddingValues
import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavHostController
Expand All @@ -22,11 +23,13 @@ fun NavController.navigateStartFiltering(
}

fun NavGraphBuilder.startFilteringNavGraph(
paddingValues: PaddingValues,
navHostController: NavHostController
) {
composable<StartFiltering> {
val args = it.toRoute<StartFiltering>()
StartFilteringScreen(
paddingValues = paddingValues,
onNextClick = {
navHostController.navigateFilteringOne(args.name)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package com.terning.feature.filtering.starthome

import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.fadeIn
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxSize
Expand All @@ -24,26 +26,21 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.navigation.NavController
import androidx.navigation.NavOptions
import androidx.navigation.compose.rememberNavController
import com.airbnb.lottie.compose.LottieAnimation
import com.airbnb.lottie.compose.LottieCompositionSpec
import com.airbnb.lottie.compose.LottieConstants
import com.airbnb.lottie.compose.rememberLottieComposition
import com.terning.core.designsystem.component.button.RectangleButton
import com.terning.core.designsystem.theme.TerningPointTheme
import com.terning.core.designsystem.theme.TerningTheme
import com.terning.core.designsystem.theme.White
import com.terning.feature.R
import com.terning.feature.home.home.navigation.navigateHome
import com.terning.feature.main.MainNavigator
import com.terning.feature.main.rememberMainNavigator
import com.terning.feature.onboarding.signin.navigation.SignIn
import kotlinx.coroutines.delay

@Composable
fun StartHomeScreen(
modifier: Modifier = Modifier,
paddingValues: PaddingValues = PaddingValues(),
navigateToHome: () -> Unit
) {
var isVisible by remember { mutableStateOf(false) }
Expand All @@ -57,7 +54,10 @@ fun StartHomeScreen(
}

Box(
modifier = modifier.fillMaxSize()
modifier = modifier
.fillMaxSize()
.padding(paddingValues)
.background(White)
) {
Column(
modifier = Modifier.fillMaxSize(),
Expand Down Expand Up @@ -95,7 +95,7 @@ fun StartHomeScreen(
}
}

private const val DELAY : Long = 1000
private const val DELAY: Long = 1000

@Composable
fun StartHomeLottieAnimation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.terning.feature.filtering.starthome.navigation

import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExitTransition
import androidx.compose.foundation.layout.PaddingValues
import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavHostController
Expand All @@ -21,6 +22,7 @@ fun NavController.navigateStartHome(navOptions: NavOptions? = null) {
}

fun NavGraphBuilder.startHomeNavGraph(
paddingValues: PaddingValues,
navHostController: NavHostController
) {
composable<StartHome>(
Expand All @@ -37,14 +39,16 @@ fun NavGraphBuilder.startHomeNavGraph(
ExitTransition.None
}
) {
StartHomeScreen(navigateToHome = {
navHostController.navigateHome(
navOptions = NavOptions.Builder().setPopUpTo(
route = SignIn,
inclusive = true
).build()
)
}
StartHomeScreen(
paddingValues = paddingValues,
navigateToHome = {
navHostController.navigateHome(
navOptions = NavOptions.Builder().setPopUpTo(
route = SignIn,
inclusive = true
).build()
)
}
)
}
}
Expand Down
Loading

0 comments on commit 2c3ac87

Please sign in to comment.