Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -86,6 +87,8 @@ fun AddContentScreen(
var contentToDelete by remember { mutableStateOf<SearchContentItemModel?>(null) }
val lazyRowState = rememberLazyListState()

val keyboardController = LocalSoftwareKeyboardController.current

LaunchedEffect(selectedContents.size) {
if (selectedContents.isNotEmpty()) {
lazyRowState.scrollToItem(selectedContents.size - 1)
Expand Down Expand Up @@ -120,9 +123,7 @@ fun AddContentScreen(
onClearAction = {},
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Search),
keyboardActions = KeyboardActions(
onSearch = {
// TODO: 검색 진행
}
onSearch = { keyboardController?.hide() }
),
modifier = Modifier
.fillMaxWidth()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ fun CollectionCreateScreen(
verticalAlignment = Alignment.CenterVertically,
) {
Text(
text = "최대 10개까지 추가할 수 있어요",
text = "작품을 2개 이상 추가해주세요.",
color = FlintTheme.colors.gray200,
style = FlintTheme.typography.body2R14,
)
Expand Down Expand Up @@ -314,6 +314,7 @@ fun CollectionCreateScreen(
}
}
}

FlintLargeButton(
text = "완료",
state = if (uiState.isFinishButtonEnabled) FlintButtonState.Able else FlintButtonState.Disable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ class CollectionCreateViewModel @Inject constructor(
viewModelScope.launch {
val requestModel = CollectionCreateRequestModel(
imageUrl = "",
title = uiState.value.title.ifBlank { "더미 컬렉션 제목" },
description = uiState.value.description.ifBlank { "더미 설명" },
title = uiState.value.title,
description = uiState.value.description.ifBlank { "" },
isPublic = uiState.value.isPublic ?: true,
contentList = uiState.value.selectedContents.map { content ->
val detail = uiState.value.contentDetailsMap[content.id] ?: ContentDetail()
CollectionCreateContentModel(
contentId = content.id,
isSpoiler = detail.isSpoiler,
reason = detail.reason.ifBlank { "추천합니다" },
reason = detail.reason.ifBlank { "" },
)
},
)
Expand Down
45 changes: 31 additions & 14 deletions app/src/main/java/com/flint/presentation/main/MainScreen.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
package com.flint.presentation.main

import androidx.compose.foundation.gestures.detectTapGestures
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.platform.LocalFocusManager
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.flint.core.designsystem.theme.FlintTheme
import com.flint.presentation.main.component.MainBottomBar
Expand All @@ -12,21 +18,32 @@ import kotlinx.collections.immutable.toImmutableList
fun MainScreen(navigator: MainNavigator) {
val isBottomBarVisible by navigator.isBottomBarVisible.collectAsStateWithLifecycle()
val currentTab by navigator.currentTab.collectAsStateWithLifecycle()
val focusManager = LocalFocusManager.current

Scaffold(
containerColor = FlintTheme.colors.background,
bottomBar = {
MainBottomBar(
visible = isBottomBarVisible,
tabs = MainTab.entries.toImmutableList(),
currentTab = currentTab,
onTabSelected = navigator::navigate,
Box(
modifier = Modifier
.fillMaxSize()
.pointerInput(Unit) {
detectTapGestures(onTap = {
focusManager.clearFocus()
})
}
) {
Scaffold(
containerColor = FlintTheme.colors.background,
bottomBar = {
MainBottomBar(
visible = isBottomBarVisible,
tabs = MainTab.entries.toImmutableList(),
currentTab = currentTab,
onTabSelected = navigator::navigate,
)
},
) { paddingValues ->
MainNavHost(
navigator = navigator,
paddingValues = paddingValues,
)
},
) { paddingValues ->
MainNavHost(
navigator = navigator,
paddingValues = paddingValues,
)
}
}
}