Skip to content

Commit

Permalink
Merge branch 'develop' into feature/jaino/#95
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongjaino authored Feb 13, 2024
2 parents b7b9a2e + dadd9ab commit 282df0e
Show file tree
Hide file tree
Showing 17 changed files with 158 additions and 104 deletions.
1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ android {
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
signingConfig = signingConfigs.getByName("debug")
}
}
}
Expand Down
34 changes: 21 additions & 13 deletions app/src/main/java/com/wap/wapp/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
package com.wap.wapp

import android.content.res.Resources
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.SystemBarStyle
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.systemBars
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.dp
import androidx.navigation.NavController
import androidx.navigation.NavGraph.Companion.findStartDestination
Expand Down Expand Up @@ -51,9 +50,10 @@ class MainActivity : ComponentActivity() {
setContent {
WappTheme {
val navController = rememberNavController()
val density = LocalDensity.current
val navigationBarHeight = getNavigationBarHeight(density)

Scaffold(
modifier = Modifier.fillMaxSize(),
containerColor = WappTheme.colors.backgroundBlack,
bottomBar = {
val navBackStackEntry by
Expand All @@ -69,11 +69,6 @@ class MainActivity : ComponentActivity() {
},
)

val systemBars = WindowInsets.systemBars
val density = LocalDensity.current
val bottomPadding =
remember { with(density) { systemBars.getBottom(this).toDp() } }

WappBottomBar(
currentRoute = currentRoute,
bottomBarState = bottomBarState,
Expand All @@ -83,11 +78,12 @@ class MainActivity : ComponentActivity() {
destination,
)
},
modifier = Modifier
.padding(bottom = bottomPadding)
.height(70.dp),
modifier = Modifier.height(70.dp),
)
},
modifier = Modifier
.padding(bottom = navigationBarHeight)
.fillMaxSize(),
) { innerPadding ->
WappNavHost(
signInUseCase = signInUseCase,
Expand Down Expand Up @@ -118,7 +114,7 @@ private fun handleBottomBarState(
ManagementSurveyRoute.surveyFormRegistrationRoute -> setBottomBarState(false)
ManagementSurveyRoute.surveyFormEditRoute("{id}") -> setBottomBarState(false)
eventRegistrationNavigationRoute -> setBottomBarState(false)
SurveyRoute.answerRoute("{id}") ->setBottomBarState(false)
SurveyRoute.answerRoute("{id}") -> setBottomBarState(false)
else -> setBottomBarState(true)
}

Expand All @@ -134,3 +130,15 @@ private fun navigateToTopLevelDestination(
restoreState = true
}
}

private fun getNavigationBarHeight(density: Density) = with(density) {
Resources.getSystem().run {
getDimensionPixelSize(
getIdentifier(
"navigation_bar_height",
"dimen",
"android",
),
).toDp()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ fun WappSubTopBarWithRightButton() {
WappSubTopBar(
modifier = Modifier
.fillMaxWidth()
.padding(16.dp),
.padding(vertical = 16.dp),
titleRes = R.string.notice,
showRightButton = true,
)
Expand All @@ -115,7 +115,7 @@ fun WappSubTopBarWithLeftButton() {
WappSubTopBar(
modifier = Modifier
.fillMaxWidth()
.padding(16.dp),
.padding(vertical = 16.dp),
titleRes = R.string.notice,
showLeftButton = true,
)
Expand All @@ -133,7 +133,7 @@ fun WappSubTopBarWithBothButton() {
WappSubTopBar(
modifier = Modifier
.fillMaxWidth()
.padding(16.dp),
.padding(vertical = 16.dp),
titleRes = R.string.notice,
showRightButton = true,
showLeftButton = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ internal fun SignUpScreen(
.padding(horizontal = 16.dp),
) {
WappSubTopBar(
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 16.dp),
modifier = Modifier.fillMaxWidth(),
titleRes = string.sign_up,
showLeftButton = true,
onClickLeftButton = { navigateToSignIn() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ internal fun EventEditScreen(
modifier = Modifier
.fillMaxSize()
.padding(paddingValues)
.padding(16.dp),
.padding(vertical = 16.dp),
) {
WappSubTopBar(
titleRes = R.string.event_edit,
Expand All @@ -187,12 +187,12 @@ internal fun EventEditScreen(

EventEditStateIndicator(
eventRegistrationState = currentEditState,
modifier = Modifier.padding(top = 16.dp),
modifier = Modifier.padding(top = 16.dp, start = 20.dp, end = 20.dp),
)

EventRegistrationContent(
eventRegistrationState = currentEditState,
modifier = Modifier.padding(top = 50.dp),
modifier = Modifier.padding(top = 50.dp, start = 20.dp, end = 20.dp),
eventTitle = title,
eventContent = content,
location = location,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private fun EventDetailsContent(
WappButton(
onClick = onNextButtonClicked,
textRes = R.string.next,
modifier = Modifier.padding(vertical = 20.dp),
modifier = Modifier.padding(top = 20.dp),
)
}
}
Expand Down Expand Up @@ -311,7 +311,6 @@ private fun EventScheduleContent(
WappButton(
onClick = onRegisterButtonClicked,
textRes = R.string.register_event,
modifier = Modifier.padding(bottom = 20.dp),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ internal fun EventRegistrationScreen(
titleRes = R.string.event_registration,
showLeftButton = true,
onClickLeftButton = onBackButtonClicked,
modifier = Modifier.padding(start = 10.dp),
)

EventRegistrationStateIndicator(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ import com.wap.designsystem.WappTheme
@Composable
internal fun SurveyFormStateIndicator(
surveyRegistrationState: SurveyFormState,
modifier: Modifier = Modifier,
) {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(8.dp),
modifier = modifier,
) {
SurveyRegistrationStateProgressBar(surveyRegistrationState.progress)
SurveyRegistrationStateText(surveyRegistrationState.page)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ internal fun SurveyRegistrationScreen(
) {
SurveyFormStateIndicator(
surveyRegistrationState = currentRegistrationState,
modifier = Modifier.padding(horizontal = 20.dp),
)

SurveyFormContent(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

package com.wap.wapp.feature.management

import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.Scaffold
Expand All @@ -15,6 +15,7 @@ import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.wap.designsystem.WappTheme
Expand Down Expand Up @@ -44,7 +45,7 @@ internal fun ManagementRoute(

viewModel.userRole.collectLatest { userRoleUiState ->
when (userRoleUiState) {
is ManagementViewModel.UserRoleUiState.Init -> { }
is ManagementViewModel.UserRoleUiState.Init -> {}
is ManagementViewModel.UserRoleUiState.Success -> {
when (userRoleUiState.userRole) {
UserRole.GUEST -> { showGuestScreen = true }
Expand All @@ -56,9 +57,7 @@ internal fun ManagementRoute(
}

viewModel.errorFlow.collectLatest { throwable ->
snackBarHostState.showSnackbar(
message = throwable.toSupportingText(),
)
snackBarHostState.showSnackbar(message = throwable.toSupportingText())
}
}

Expand Down Expand Up @@ -101,16 +100,15 @@ internal fun ManagementScreen(
Scaffold(
containerColor = WappTheme.colors.backgroundBlack,
snackbarHost = { SnackbarHost(snackBarHostState) },
contentWindowInsets = WindowInsets(0.dp),
topBar = {
WappLeftMainTopBar(
titleRes = R.string.management,
contentRes = R.string.management_content,
)
},
) { paddingValues ->
LazyColumn(
modifier = Modifier.padding(paddingValues),
) {
LazyColumn(modifier = Modifier.padding(paddingValues)) {
item {
ManagementEventCard(
eventsState = eventsState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ internal fun ManagementSurveyCard(
containerColor = WappTheme.colors.black25,
),
modifier = Modifier
.padding(top = 20.dp)
.padding(vertical = 20.dp)
.padding(horizontal = 8.dp),
) {
Column(
Expand Down
Loading

0 comments on commit 282df0e

Please sign in to comment.