Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/boolti 343 edge to edge 활성화 및 스타일 반영 #357

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
529a21b
Boolti-343 style: edge to edge 활성화
mangbaam Dec 21, 2024
8c75863
Boolti-343 style: 상태바 패딩 대응
mangbaam Dec 21, 2024
6cbbc04
Boolti-343 style: 상태바 패딩 대응
mangbaam Dec 21, 2024
e69fe71
Boolti-343 style: 상태바 패딩 대응
mangbaam Dec 25, 2024
846e074
Boolti-343 style: 상태바 패딩 대응
mangbaam Dec 25, 2024
cd2ebd1
Boolti-343 style: 홈(공연 피드) 상태바 수정
mangbaam Dec 25, 2024
dbfc584
Boolti-343 chore: Theme 에서 상태바 색상 설정 코드 제거
mangbaam Dec 25, 2024
5f5c50e
Boolti-343 refactor: 불필요한 statusBarsPadding 코드 제거
mangbaam Dec 25, 2024
e1fea49
Merge branch 'refs/heads/develop' into feature/Boolti-343
mangbaam Dec 30, 2024
82d6e8b
Boolti-343 fix: 머지 충돌 해결 후 공연 상세 UI 대응
mangbaam Dec 30, 2024
7e1749f
Boolti-343 style: QR 스캔 화면 하단 영역 패딩 추가
mangbaam Dec 30, 2024
b9dda46
Boolti-343 style: 탈퇴, 환불 사유 입력 텍스트필드 최소 높이 수정 및 환불 사유 작성 화면에서 clickab…
mangbaam Dec 30, 2024
b76355d
Boolti-343 style: 티켓 선택 바텀시트 불필요한 하단 패딩 제거
mangbaam Dec 30, 2024
32f4578
Boolti-343 style: 홈 상단 패딩 수정
mangbaam Dec 31, 2024
97897ac
feature/Boolti-343 QR 스캔 상태바 색상 변경
mangbaam Dec 31, 2024
e883189
feature/Boolti-343 티켓 선택 바텀시트 하단 패딩 수정
mangbaam Dec 31, 2024
982794a
feature/Boolti-343 결제 내역, 결제 취소 화면 하단 패딩 수정
mangbaam Dec 31, 2024
24bab96
feature/Boolti-343 티켓 상세 화면 간격 수정
mangbaam Dec 31, 2024
e08ce08
feature/Boolti-343 티켓 상세 화면 간격 수정
mangbaam Dec 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package com.nexters.boolti.presentation

import android.Manifest
import android.graphics.Color
import android.os.Bundle
import android.view.KeyEvent
import androidx.activity.ComponentActivity
import androidx.activity.SystemBarStyle
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.activity.viewModels
import androidx.core.view.isVisible
import androidx.lifecycle.Lifecycle
Expand Down Expand Up @@ -54,6 +57,8 @@ class QrScanActivity : ComponentActivity() {

requestPermission(Manifest.permission.CAMERA, 100)

enableEdgeToEdge(statusBarStyle = SystemBarStyle.dark(Color.TRANSPARENT))

setContent {
BooltiTheme {
QrScanScreen(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
Expand Down Expand Up @@ -35,12 +36,14 @@ fun BtAppBar(
modifier: Modifier = Modifier,
title: String = "",
colors: BtAppBarColors = BtAppBarDefaults.appBarColors(),
statusBarPadding: Boolean = true,
navigateButtons: @Composable (RowScope.() -> Unit)? = null,
actionButtons: @Composable (RowScope.() -> Unit)? = null,
) {
Row(
modifier = modifier
.background(color = colors.containerColor)
.let { if (statusBarPadding) it.statusBarsPadding() else it }
.fillMaxWidth()
.height(44.dp)
.padding(horizontal = 8.dp),
Expand Down Expand Up @@ -80,13 +83,15 @@ fun BtAppBar(
modifier: Modifier = Modifier,
title: String = "",
colors: BtAppBarColors = BtAppBarDefaults.appBarColors(),
statusBarPadding: Boolean = true,
navigationButtons: List<Pair<Int, () -> Unit>> = emptyList(),
actionButtons: List<Pair<Int, () -> Unit>> = emptyList(),
) {
BtAppBar(
modifier = modifier,
title = title,
colors = colors,
statusBarPadding = statusBarPadding,
navigateButtons = if (navigationButtons.isNotEmpty()) {
{
navigationButtons.forEach { (res, onClick) ->
Expand All @@ -113,6 +118,7 @@ fun BtBackAppBar(
modifier: Modifier = Modifier,
title: String = "",
colors: BtAppBarColors = BtAppBarDefaults.appBarColors(),
statusBarPadding: Boolean = true,
onClickBack: () -> Unit,
) {
BtAppBar(
Expand All @@ -125,6 +131,7 @@ fun BtBackAppBar(
)
},
colors = colors,
statusBarPadding = statusBarPadding,
)
}

Expand All @@ -133,6 +140,7 @@ fun BtCloseableAppBar(
modifier: Modifier = Modifier,
title: String = "",
colors: BtAppBarColors = BtAppBarDefaults.appBarColors(),
statusBarPadding: Boolean = true,
onClickClose: () -> Unit,
) {
BtAppBar(
Expand All @@ -146,6 +154,7 @@ fun BtCloseableAppBar(
)
},
colors = colors,
statusBarPadding = statusBarPadding,
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.nexters.boolti.presentation.component

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.statusBarsIgnoringVisibility
import androidx.compose.foundation.layout.windowInsetsTopHeight
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.zIndex

@OptIn(ExperimentalLayoutApi::class)
@Composable
fun StatusBarCover(
modifier: Modifier = Modifier,
color: Color = MaterialTheme.colorScheme.background,
) {
Box(
modifier = modifier
.zIndex(1f)
.background(color)
.fillMaxWidth()
.windowInsetsTopHeight(WindowInsets.statusBarsIgnoringVisibility),
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.rememberScrollState
Expand Down Expand Up @@ -74,7 +75,7 @@ fun ReservationDetailScreen(
}

Scaffold(
modifier = modifier,
modifier = modifier.navigationBarsPadding(),
topBar = {
BtBackAppBar(
title = stringResource(id = R.string.reservation_detail),
Expand Down Expand Up @@ -143,7 +144,8 @@ fun ReservationDetailScreen(
if (state.reservation.isRefundable) {
MainButton(
modifier = modifier
.padding(horizontal = marginHorizontal, vertical = 8.dp)
.padding(horizontal = marginHorizontal)
.padding(top = 8.dp, bottom = 20.dp)
.fillMaxWidth(),
colors = MainButtonDefaults.buttonColors(
containerColor = Grey15,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.nexters.boolti.presentation.screen

import android.annotation.SuppressLint
import android.content.Intent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.remember
Expand Down Expand Up @@ -58,33 +58,32 @@ val LocalSnackbarController = staticCompositionLocalOf {
SnackbarController(SnackbarHostState())
}

@SuppressLint("UnusedMaterial3ScaffoldPaddingParameter")
@Composable
fun Main(onClickQrScan: (showId: String, showName: String) -> Unit) {
val modifier = Modifier.fillMaxSize()
val scope = rememberCoroutineScope()
val snackbarHostState = remember { SnackbarHostState() }

BooltiTheme {
Surface(modifier) {
Scaffold(
snackbarHost = {
ToastSnackbarHost(
modifier = Modifier.padding(bottom = 80.dp),
hostState = snackbarHostState,
)
},
) { innerPadding ->
CompositionLocalProvider(
LocalSnackbarController provides SnackbarController(
snackbarHostState,
scope
)
) {
MainNavigation(
modifier = modifier.padding(innerPadding),
onClickQrScan = onClickQrScan,
)
}
Scaffold(
snackbarHost = {
ToastSnackbarHost(
modifier = Modifier.padding(bottom = 80.dp),
hostState = snackbarHostState,
)
},
) {
CompositionLocalProvider(
LocalSnackbarController provides SnackbarController(
snackbarHostState,
scope
)
) {
MainNavigation(
modifier = modifier,
onClickQrScan = onClickQrScan,
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ package com.nexters.boolti.presentation.screen
import android.Manifest
import android.app.NotificationChannel
import android.app.NotificationManager
import android.graphics.Color
import android.os.Build
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.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
Expand All @@ -26,6 +29,9 @@ import timber.log.Timber
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge(
statusBarStyle = SystemBarStyle.dark(Color.TRANSPARENT),
)
setContent {
BooltiTheme {
Surface(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ fun HomeScreen(
)
) {
ShowScreen(
modifier = modifier.padding(innerPadding),
modifier = Modifier.padding(bottom = innerPadding.calculateBottomPadding()),
onClickShowItem = onClickShowItem,
navigateToBusiness = navigateToBusiness,
navigateToShowRegistration = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.nexters.boolti.presentation.screen.qr

import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
Expand All @@ -13,6 +12,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.pager.HorizontalPager
import androidx.compose.foundation.pager.rememberPagerState
Expand Down Expand Up @@ -69,7 +69,6 @@ fun NavGraphBuilder.QrFullScreen(
}
}

@OptIn(ExperimentalFoundationApi::class)
@Composable
fun QrFullScreen(
modifier: Modifier = Modifier,
Expand All @@ -81,12 +80,17 @@ fun QrFullScreen(

Scaffold(
modifier = modifier,
topBar = { Toolbar(onClose = onClose) },
topBar = {
Toolbar(
modifier = Modifier.statusBarsPadding(),
onClose = onClose,
)
},
) { innerPadding ->
Box(
modifier = Modifier
.fillMaxSize()
.background(Color.White)
.background(White)
.padding(innerPadding),
) {
HorizontalPager(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
Expand Down Expand Up @@ -75,9 +76,20 @@ fun QrScanScreen(
val (iconId, errMessage) = when (event) {
is QrScanEvent.ScanError -> {
when (event.errorType) {
QrErrorType.ShowNotToday -> Pair(R.drawable.ic_warning, notTodayErrMessage)
QrErrorType.UsedTicket -> Pair(R.drawable.ic_error, usedTicketErrMessage)
QrErrorType.TicketNotFound -> Pair(R.drawable.ic_error, notMatchedErrMessage)
QrErrorType.ShowNotToday -> Pair(
R.drawable.ic_warning,
notTodayErrMessage
)

QrErrorType.UsedTicket -> Pair(
R.drawable.ic_error,
usedTicketErrMessage
)

QrErrorType.TicketNotFound -> Pair(
R.drawable.ic_error,
notMatchedErrMessage
)
}
}

Expand All @@ -90,6 +102,7 @@ fun QrScanScreen(
}

Scaffold(
modifier = Modifier.navigationBarsPadding(),
topBar = {
BtCloseableAppBar(
title = uiState.showName,
Expand Down Expand Up @@ -172,7 +185,10 @@ private fun EntryCodeDialog(
onDismiss: () -> Unit,
) {
BTDialog(showCloseButton = false, onDismiss = onDismiss, onClickPositiveButton = onDismiss) {
Text(text = stringResource(R.string.manager_code), style = MaterialTheme.typography.titleLarge)
Text(
text = stringResource(R.string.manager_code),
style = MaterialTheme.typography.titleLarge
)
Text(
modifier = Modifier
.padding(top = 24.dp)
Expand Down
Loading
Loading