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 29 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 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
368d4df
Boolti-343 선물 완료, 티켓선택 바텀시트 대응
mangbaam Jan 11, 2025
9e17789
Boolti-343 공연 상세 버튼의 그라데이션 UI 컴포넌트화
mangbaam Jan 11, 2025
53a6e85
Boolti-343 로그인 화면 대응
mangbaam Jan 11, 2025
e395ff2
Boolti-343 예매 화면 stateless 컴포저블 분리
mangbaam Jan 11, 2025
06d9515
Boolti-343 결제 화면 대응
mangbaam Jan 11, 2025
63369ec
Boolti-343 선물 화면 대응
mangbaam Jan 11, 2025
abcc82a
Boolti-343 링크, sns 화면 대응
mangbaam Jan 11, 2025
ed8f98c
Boolti-343 여러 페이지 하단 마진 수정
mangbaam Jan 11, 2025
eb28c2c
Merge branch 'refs/heads/develop' into feature/Boolti-343
mangbaam Jan 11, 2025
3ac8ae4
Boolti-343 develop 머지 충돌 해결
mangbaam Jan 11, 2025
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,88 @@
package com.nexters.boolti.presentation.component

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
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.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.nexters.boolti.presentation.extension.toDp
import com.nexters.boolti.presentation.theme.BooltiTheme
import com.nexters.boolti.presentation.theme.marginHorizontal

@Composable
fun TopGradientBackground(
modifier: Modifier = Modifier,
bgColor: Color = MaterialTheme.colorScheme.background,
gradientHeight: Dp = 16.dp,
onHeightChanged: (Dp) -> Unit = {},
content: @Composable () -> Unit,
) {
val density = LocalDensity.current
var contentWidthDp by remember { mutableStateOf(0.dp) }

Column(
modifier = modifier.onGloballyPositioned {
onHeightChanged(it.size.height.toDp(density))
},
) {
Box(
Modifier
.width(contentWidthDp)
.height(gradientHeight)
.background(
brush = Brush.verticalGradient(listOf(Color.Transparent, bgColor))
)
)
Box(
Modifier
.onGloballyPositioned { contentWidthDp = it.size.width.toDp(density) }
.background(bgColor),
) {
content()
}
}
}

@Preview
@Composable
private fun TopGradientBackgroundPreview() {
BooltiTheme {
Surface(
color = Color.White,
) {
Box(
modifier = Modifier.fillMaxSize(),
) {
TopGradientBackground(
modifier = Modifier
.align(Alignment.BottomCenter),
) {
SecondaryButton(
modifier = Modifier
.padding(horizontal = marginHorizontal)
.padding(bottom = 20.dp),
label = "예매하기",
) { }
}
}
}
}
}
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 @@ -9,7 +9,9 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
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 +76,7 @@ fun ReservationDetailScreen(
}

Scaffold(
modifier = modifier,
modifier = modifier.navigationBarsPadding(),
topBar = {
BtBackAppBar(
title = stringResource(id = R.string.reservation_detail),
Expand Down Expand Up @@ -143,7 +145,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 All @@ -159,6 +162,8 @@ fun ReservationDetailScreen(
}
)
}

Spacer(Modifier.size(32.dp))
}

if (showRefundDialog) {
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.compositionLocalOf
Expand Down Expand Up @@ -65,6 +65,7 @@ val LocalNavController = compositionLocalOf<NavHostController> {
error("No NavController provided")
}

@SuppressLint("UnusedMaterial3ScaffoldPaddingParameter")
@Composable
fun Main(onClickQrScan: (showId: String, showName: String) -> Unit) {
val modifier = Modifier.fillMaxSize()
Expand All @@ -73,27 +74,25 @@ fun Main(onClickQrScan: (showId: String, showName: String) -> Unit) {
val rootNavController = rememberNavControllerWithLog()

BooltiTheme {
Surface(modifier) {
Scaffold(
snackbarHost = {
ToastSnackbarHost(
modifier = Modifier.padding(bottom = 80.dp),
hostState = snackbarHostState,
)
},
) { innerPadding ->
CompositionLocalProvider(
LocalSnackbarController provides SnackbarController(
snackbarHostState,
scope,
),
LocalNavController provides rootNavController,
) {
MainNavigation(
modifier = modifier.padding(innerPadding),
onClickQrScan = onClickQrScan,
)
}
Scaffold(
snackbarHost = {
ToastSnackbarHost(
modifier = Modifier.padding(bottom = 80.dp),
hostState = snackbarHostState,
)
},
) {
CompositionLocalProvider(
LocalSnackbarController provides SnackbarController(
snackbarHostState,
scope,
),
LocalNavController provides rootNavController,
) {
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 @@ -26,8 +26,6 @@ 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.Brush
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
Expand All @@ -45,6 +43,7 @@ import com.nexters.boolti.presentation.component.BusinessInformation
import com.nexters.boolti.presentation.component.MainButton
import com.nexters.boolti.presentation.component.PolicyBottomSheet
import com.nexters.boolti.presentation.component.ShowItem
import com.nexters.boolti.presentation.component.TopGradientBackground
import com.nexters.boolti.presentation.screen.ticketing.InputRow
import com.nexters.boolti.presentation.screen.ticketing.OrderAgreementSection
import com.nexters.boolti.presentation.screen.ticketing.PaymentFailureDialog
Expand Down Expand Up @@ -73,6 +72,7 @@ fun GiftScreen(
var showTicketSoldOutDialog by remember { mutableStateOf(false) }
var showPaymentFailureDialog by remember { mutableStateOf(false) }
var policyPageUrl: String? by remember { mutableStateOf(null) }
var bottomButtonHeight by remember { mutableStateOf(0.dp) }

val paymentLauncher =
rememberLauncherForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
Expand Down Expand Up @@ -231,26 +231,13 @@ fun GiftScreen(
modifier = Modifier.fillMaxWidth(),
onClick = navigateToBusiness
)
Spacer(modifier = Modifier.height(120.dp))
Spacer(modifier = Modifier.height(bottomButtonHeight))
}

Column(
modifier = Modifier.align(Alignment.BottomCenter)
TopGradientBackground(
modifier = Modifier.align(Alignment.BottomCenter),
onHeightChanged = { bottomButtonHeight = it },
) {
Box(
modifier = Modifier
.fillMaxWidth()
.height(16.dp)
.background(
brush = Brush.verticalGradient(
colors = listOf(
MaterialTheme.colorScheme.background.copy(alpha = 0F),
MaterialTheme.colorScheme.background,
)
),
shape = RectangleShape,
)
)
MainButton(
modifier = Modifier
.fillMaxWidth()
Expand Down
Loading
Loading