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

Window Insets 적용 및 네비게이션 바 패딩값 수정 #158

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ android {
isDebuggable = true
applicationIdSuffix = ".dev"
manifestPlaceholders += mapOf(
"appName" to "@string/app_name_dev"
"appName" to "@string/app_name_dev",
)
}

getByName("release") {
isDebuggable = false
signingConfig = signingConfigs.getByName("release")
manifestPlaceholders += mapOf(
"appName" to "@string/app_name"
"appName" to "@string/app_name",
)
}
}
Expand All @@ -49,7 +49,6 @@ android {
}

dependencies {
coreLibraryDesugaring(libs.desugar.jdk)
implementations(
projects.core.data,
projects.core.datastore,
Expand All @@ -66,10 +65,11 @@ dependencies {
libs.androidx.startup,
libs.androidx.core,
libs.androidx.splash,
libs.androidx.activity.compose,
libs.timber,
libs.bundles.androidx.compose,
platform(libs.firebase.bom),
libs.firebase.analytics,
libs.firebase.crashlytics
libs.firebase.crashlytics,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.nexters.bandalart.android
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import com.nexters.bandalart.android.core.designsystem.theme.BandalartTheme
import com.nexters.bandalart.android.ui.BandalartApp
Expand All @@ -12,8 +13,11 @@ import dagger.hilt.android.AndroidEntryPoint
class MainActivity : ComponentActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
installSplashScreen()
super.onCreate(savedInstanceState)

enableEdgeToEdge()

setContent {
BandalartTheme {
BandalartApp()
Expand Down
1 change: 1 addition & 0 deletions build-logic/src/main/kotlin/internal/android.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ internal fun Project.configureAndroid(extension: CommonExtension<*, *, *, *, *>)
}

dependencies.add("detektPlugins", libs.findLibrary("detekt-plugin-formatting").get())
dependencies.add("coreLibraryDesugaring", libs.findLibrary("desugar-jdk").get())

buildTypes {
getByName("debug") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,8 @@ fun BandalartTheme(
darkTheme -> DarkColorScheme
else -> LightColorScheme
}

val view = LocalView.current
if (!view.isInEditMode) {
SideEffect {
val window = (view.context as Activity).window
window.statusBarColor = colorScheme.primary.toArgb()
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme
}
}

SideEffect {
val window = (view.context as Activity).window
Expand Down
1 change: 0 additions & 1 deletion core/ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ android {
}

dependencies {
coreLibraryDesugaring(libs.desugar.jdk)
implementations(
projects.core.designsystem,
projects.core.util,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ val StatusBarAndActionBarHeightDp
// https://stackoverflow.com/questions/75123079/how-do-i-detect-which-type-of-navigation-bar-is-active
@Composable
fun getNavigationBarPadding(): Dp {
return if (NavigationBarHeightDp == 0.dp) 32.dp else NavigationBarHeightDp - 16.dp
return if (NavigationBarHeightDp == 0.dp) 64.dp
else NavigationBarHeightDp
}
1 change: 0 additions & 1 deletion feature/home/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ android {
}

dependencies {
coreLibraryDesugaring(libs.desugar.jdk)
implementations(
projects.core.designsystem,
projects.core.domain,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
Expand Down Expand Up @@ -69,7 +70,6 @@ import com.nexters.bandalart.android.core.designsystem.theme.Gray400
import com.nexters.bandalart.android.core.designsystem.theme.Gray700
import com.nexters.bandalart.android.core.designsystem.theme.White
import com.nexters.bandalart.android.core.ui.ComponentPreview
import com.nexters.bandalart.android.core.ui.NavigationBarHeightDp
import com.nexters.bandalart.android.core.ui.ObserveAsEvents
import com.nexters.bandalart.android.core.ui.R
import com.nexters.bandalart.android.core.ui.ThemeColor
Expand Down Expand Up @@ -252,14 +252,16 @@ fun BandalartBottomSheetContent(
modifier = modifier
.wrapContentSize()
.statusBarsPadding()
.navigationBarsPadding()
.noRippleClickable { },
sheetState = bottomSheetState,
dragHandle = null,
// https://stackoverflow.com/questions/69560253/modal-bottom-sheet-scrim-color-is-not-shown-in-status-bar-in-jetpack-compose
windowInsets = WindowInsets(0, 0, 0, 66),
) {
Column(
modifier = Modifier
.background(White)
.navigationBarsPadding()
.noRippleClickable { focusManager.clearFocus() },
) {
Spacer(modifier = Modifier.height(20.dp))
Expand Down Expand Up @@ -404,6 +406,7 @@ fun BandalartBottomSheetContent(
}
if (isMainCell && uiState.isCellDataCopied) {
Spacer(modifier = Modifier.height(22.dp))
Spacer(modifier = Modifier.height(if (uiState.isEmojiPickerOpened) (-32).dp else 0.dp))
BottomSheetSubTitleText(text = stringResource(R.string.bottomsheet_color))
BandalartColorPicker(
initColor = ThemeColor(
Expand Down Expand Up @@ -581,7 +584,7 @@ fun BandalartBottomSheetContent(
modifier = Modifier.weight(1f),
)
}
Spacer(modifier = Modifier.height(NavigationBarHeightDp + getNavigationBarPadding()))
Spacer(modifier = Modifier.height(getNavigationBarPadding()))
}
if (scrollState.value > 0) {
Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package com.nexters.bandalart.android.feature.home.ui.bandalart

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ModalBottomSheet
Expand Down Expand Up @@ -33,6 +34,7 @@ fun BandalartEmojiBottomSheet(
modifier = modifier.wrapContentSize(),
sheetState = bottomSheetState,
dragHandle = null,
windowInsets = WindowInsets(0, 0, 0, 0),
) {
Column {
BandalartEmojiPicker(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Card
Expand All @@ -34,7 +32,6 @@ import com.nexters.bandalart.android.core.designsystem.theme.Gray100
import com.nexters.bandalart.android.core.designsystem.theme.Gray400
import com.nexters.bandalart.android.core.designsystem.theme.White
import com.nexters.bandalart.android.core.ui.ComponentPreview
import com.nexters.bandalart.android.core.ui.NavigationBarHeightDp
import com.nexters.bandalart.android.core.ui.component.EmojiText
import kotlinx.coroutines.launch

Expand Down Expand Up @@ -139,7 +136,6 @@ fun BandalartEmojiPicker(
}
}
}
Spacer(modifier = Modifier.height(NavigationBarHeightDp))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ 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.WindowInsets
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
Expand Down Expand Up @@ -43,7 +44,6 @@ import com.nexters.bandalart.android.core.designsystem.theme.Gray800
import com.nexters.bandalart.android.core.designsystem.theme.Gray900
import com.nexters.bandalart.android.core.designsystem.theme.White
import com.nexters.bandalart.android.core.ui.ComponentPreview
import com.nexters.bandalart.android.core.ui.NavigationBarHeightDp
import com.nexters.bandalart.android.core.ui.R
import com.nexters.bandalart.android.core.ui.component.FixedSizeText
import com.nexters.bandalart.android.core.ui.getNavigationBarPadding
Expand Down Expand Up @@ -74,6 +74,7 @@ fun BandalartListBottomSheet(
onDismissRequest = onCancelClicked,
sheetState = bottomSheetState,
dragHandle = null,
windowInsets = WindowInsets(0, 0, 0, 0),
) {
Column(
modifier = Modifier
Expand Down Expand Up @@ -116,7 +117,7 @@ fun BandalartListBottomSheet(
LazyColumn(
modifier = Modifier.padding(horizontal = 20.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
contentPadding = PaddingValues(bottom = NavigationBarHeightDp + getNavigationBarPadding()),
contentPadding = PaddingValues(bottom = 20.dp),
) {
items(
count = bandalartList.size,
Expand All @@ -136,36 +137,34 @@ fun BandalartListBottomSheet(
onCancelClicked = onCancelClicked,
)
}
item {
Spacer(modifier = Modifier.height(20.dp))
}
Row {
Button(
modifier = Modifier
.weight(1f)
.height(56.dp)
.padding(horizontal = 24.dp),
onClick = createBandalart,
colors = ButtonDefaults.buttonColors(containerColor = Gray200),
) {
Row {
Button(
modifier = Modifier
.weight(1f)
.height(56.dp)
.padding(horizontal = 24.dp),
onClick = createBandalart,
colors = ButtonDefaults.buttonColors(containerColor = Gray200),
) {
Row {
Icon(
imageVector = Icons.Default.Add,
contentDescription = stringResource(R.string.add_descrption),
tint = Gray600,
modifier = Modifier.size(20.dp),
)
Spacer(modifier = Modifier.padding(start = 4.dp))
FixedSizeText(
text = stringResource(R.string.bandalart_list_add),
color = Gray800,
fontSize = 16.sp,
fontWeight = FontWeight.W600,
)
}
}
Icon(
imageVector = Icons.Default.Add,
contentDescription = stringResource(R.string.add_descrption),
tint = Gray600,
modifier = Modifier.size(20.dp),
)
Spacer(modifier = Modifier.padding(start = 4.dp))
FixedSizeText(
text = stringResource(R.string.bandalart_list_add),
color = Gray800,
fontSize = 16.sp,
fontWeight = FontWeight.W600,
)
}
}
}
Spacer(modifier = Modifier.height(getNavigationBarPadding()))
}
}
}
Expand Down
36 changes: 18 additions & 18 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
[versions]

android-gradle-plugin = "8.1.4"
android-gradle-plugin = "8.2.2"
gradle-dependency-handler-extensions = "1.1.0"

google-secrets = "2.0.1"
google-service = "4.4.0"
google-service = "4.4.1"

kotlin-core = "1.9.20"
kotlin-detekt = "1.23.3"
kotlin-core = "1.9.22"
kotlin-detekt = "1.23.5"
kotlin-ktlint-gradle = "11.6.1"
kotlin-ktlint-source = "0.49.1"
kotlin-ktlint-source = "0.50.0"

kotlinx-coroutines = "1.7.3"
kotlinx-coroutines = "1.8.0"
kotlinx-datetime = "0.4.0"
kotlinx-serialization = "1.6.2"
kotlinx-serialization-converter = "1.0.0"
kotlinx-collections-immutable = "0.3.6"
kotlinx-collections-immutable = "0.3.7"

android-hilt = "2.49"
android-hilt = "2.50"

androidx-core = "1.12.0"
androidx-datastore = "1.0.0"
androidx-lifecycle-runtime = "2.6.2"
androidx-lifecycle-runtime = "2.7.0"
androidx-splash = "1.0.1"
androidx-startup = "1.1.1"
androidx-activity-compose = "1.8.1"
androidx-compose-compiler = "1.5.4"
androidx-compose-bom = "2023.10.01"
androidx-compose-material3 = "1.2.0-alpha12"
androidx-activity-compose = "1.8.2"
androidx-compose-compiler = "1.5.8"
androidx-compose-bom = "2024.02.00"
androidx-compose-material3 = "1.2.0"
androidx-compose-runtime-tracing = "1.0.0-beta01"
androidx-compose-constraintlayout = "1.0.1"
androidx-compose-navigation = "2.7.5"
androidx-compose-navigation = "2.7.7"
androidx-hilt-navigation-compose = "1.1.0"

desugar-jdk = "2.0.4"
javax-inject = "1"
ktor-client = "2.3.5"
ktor-client = "2.3.8"
retrofit = "2.9.0"
okhttp = "5.0.0-alpha.11"
okhttp = "5.0.0-alpha.12"
lottie-compose = "5.2.0"
timber = "5.0.1"
facebook-shimmer = "0.5.0"
firebase-bom = "32.6.0"
firebase-bom = "32.7.2"
firebase-crashlytics = "2.9.9"
ksp = "1.9.20-1.0.14"
ksp = "1.9.22-1.0.17"

test-kotest = "5.8.0"

Expand Down
Loading