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 @@ -3,8 +3,8 @@ package daily.dayo.presentation.screen.account
import android.annotation.SuppressLint
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.Scaffold
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
import androidx.compose.runtime.Composable
Expand All @@ -18,7 +18,7 @@ import androidx.navigation.compose.NavHost
import daily.dayo.presentation.view.dialog.getBottomSheetDialogState

@SuppressLint("UnusedMaterialScaffoldPaddingParameter")
@OptIn(ExperimentalMaterialApi::class)
@OptIn(ExperimentalMaterial3Api::class)
@Composable
internal fun AccountScreen(
navigator: AccountNavigator = rememberAccountNavigator()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.ModalBottomSheetState
import androidx.compose.material3.BottomSheetScaffoldState
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.mutableStateOf
Expand All @@ -34,12 +34,12 @@ import daily.dayo.presentation.view.dialog.getBottomSheetDialogState
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch

@OptIn(ExperimentalMaterialApi::class)
@OptIn(ExperimentalMaterial3Api::class)
@Preview
@Composable
fun SetProfileSetupView(
context: Context = LocalContext.current,
bottomSheetState: ModalBottomSheetState = getBottomSheetDialogState(),
bottomSheetState: BottomSheetScaffoldState = getBottomSheetDialogState(),
coroutineScope: CoroutineScope = rememberCoroutineScope(),
isNextButtonEnabled: MutableState<Boolean> = remember { mutableStateOf(false) },
isNextButtonClickable: MutableState<Boolean> = remember { mutableStateOf(false) },
Expand All @@ -63,7 +63,7 @@ fun SetProfileSetupView(
interactionSource = interactionSource,
indication = null,
onClick = {
coroutineScope.launch { bottomSheetState.show() }
coroutineScope.launch { bottomSheetState.bottomSheetState.expand() }
}
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package daily.dayo.presentation.screen.account

import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.ModalBottomSheetState
import androidx.compose.material3.BottomSheetScaffoldState
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.SnackbarHostState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
Expand Down Expand Up @@ -36,6 +36,7 @@ fun NavController.navigateProfileSetting() {
this.navigate(SignInRoute.profileSetting)
}

@OptIn(ExperimentalMaterial3Api::class)
fun NavGraphBuilder.signInNavGraph(
coroutineScope: CoroutineScope,
snackBarHostState: SnackbarHostState,
Expand All @@ -47,7 +48,7 @@ fun NavGraphBuilder.signInNavGraph(
navigateToSignUpEmail: () -> Unit,
navigateToRules: (RuleType) -> Unit,
navigateToProfileSetting: () -> Unit,
bottomSheetState: ModalBottomSheetState,
bottomSheetState: BottomSheetScaffoldState,
bottomSheetContent: (@Composable () -> Unit) -> Unit,
) {
composable(route = SignInRoute.route) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import androidx.compose.foundation.layout.imePadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.ModalBottomSheetState
import androidx.compose.material.Text
import androidx.compose.material3.BottomSheetScaffoldState
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHostState
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -59,8 +59,8 @@ import daily.dayo.presentation.view.TopNavigation
import daily.dayo.presentation.view.dialog.ProfileImageBottomSheetDialog
import daily.dayo.presentation.view.dialog.getBottomSheetDialogState
import daily.dayo.presentation.viewmodel.AccountViewModel
import daily.dayo.presentation.viewmodel.AccountViewModel.Companion.SIGN_UP_EMAIL_CERTIFICATE_AUTH_CODE_FAIL
import daily.dayo.presentation.viewmodel.AccountViewModel.Companion.EMAIL_CERTIFICATE_AUTH_CODE_INITIAL
import daily.dayo.presentation.viewmodel.AccountViewModel.Companion.SIGN_UP_EMAIL_CERTIFICATE_AUTH_CODE_FAIL
import daily.dayo.presentation.viewmodel.ProfileSettingViewModel
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
Expand All @@ -76,7 +76,7 @@ const val PASSWORD_PERMIT_FORMAT = "^[a-z0-9]{8,16}$"
const val IMAGE_TEMP_FILE_NAME_FORMAT = "yyyy-MM-d-HH-mm-ss-SSS"
const val IMAGE_TEMP_FILE_EXTENSION = ".jpg"

@OptIn(ExperimentalMaterialApi::class)
@OptIn(ExperimentalMaterial3Api::class)
@Composable
internal fun SignUpEmailRoute(
coroutineScope: CoroutineScope = rememberCoroutineScope(),
Expand Down Expand Up @@ -229,19 +229,19 @@ internal fun SignUpEmailRoute(
onClickProfileSelect = {
coroutineScope.launch {
showProfileGallery = true
bottomSheetState.hide()
bottomSheetState.bottomSheetState.hide()
}
},
onClickProfileCapture = {
coroutineScope.launch {
showProfileCapture = true
bottomSheetState.hide()
bottomSheetState.bottomSheetState.hide()
}
},
onClickProfileReset = {
profileImgState.value = null
coroutineScope.launch {
bottomSheetState.hide()
bottomSheetState.bottomSheetState.hide()
}
},
)
Expand Down Expand Up @@ -272,13 +272,13 @@ fun SignUpEmailTitleLayout(
}
}

@OptIn(ExperimentalMaterialApi::class)
@OptIn(ExperimentalMaterial3Api::class)
@Composable
@Preview
fun SignUpEmailScreen(
context: Context = LocalContext.current,
coroutineScope: CoroutineScope = rememberCoroutineScope(),
bottomSheetState: ModalBottomSheetState = getBottomSheetDialogState(),
bottomSheetState: BottomSheetScaffoldState = getBottomSheetDialogState(),
hideKeyboard: () -> Unit = {},
onBackClick: () -> Unit = {},
requestIsEmailDuplicate: (email: String) -> Unit = {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
package daily.dayo.presentation.screen.feed

import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.ModalBottomSheetState
import androidx.compose.material3.BottomSheetScaffoldState
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.SnackbarHostState
import androidx.compose.runtime.Composable
import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.composable

@OptIn(ExperimentalMaterialApi::class)
@OptIn(ExperimentalMaterial3Api::class)
fun NavGraphBuilder.feedNavGraph(
snackBarHostState: SnackbarHostState,
onEmptyViewClick: () -> Unit,
onPostClick: (Long) -> Unit,
onProfileClick: (String) -> Unit,
onPostLikeUsersClick: (Long) -> Unit,
onPostHashtagClick: (String) -> Unit,
bottomSheetState: ModalBottomSheetState,
bottomSheetState: BottomSheetScaffoldState,
bottomSheetContent: (@Composable () -> Unit) -> Unit,
) {
composable(FeedRoute.route) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.ModalBottomSheetState
import androidx.compose.material.pullrefresh.PullRefreshIndicator
import androidx.compose.material.pullrefresh.pullRefresh
import androidx.compose.material.pullrefresh.rememberPullRefreshState
import androidx.compose.material3.BottomSheetScaffoldState
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
Expand Down Expand Up @@ -47,7 +48,7 @@ import daily.dayo.presentation.view.FilledButton
import daily.dayo.presentation.view.TopNavigation
import daily.dayo.presentation.viewmodel.FeedViewModel

@OptIn(ExperimentalMaterialApi::class)
@OptIn(ExperimentalMaterialApi::class, ExperimentalMaterial3Api::class)
@Composable
fun FeedScreen(
snackBarHostState: SnackbarHostState,
Expand All @@ -56,7 +57,7 @@ fun FeedScreen(
onProfileClick: (String) -> Unit,
onPostLikeUsersClick: (Long) -> Unit,
onPostHashtagClick: (String) -> Unit,
bottomSheetState: ModalBottomSheetState,
bottomSheetState: BottomSheetScaffoldState,
bottomSheetContent: (@Composable () -> Unit) -> Unit,
feedViewModel: FeedViewModel = hiltViewModel()
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package daily.dayo.presentation.screen.home

import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.ModalBottomSheetState
import androidx.compose.material3.BottomSheetScaffoldState
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.runtime.Composable
import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
Expand All @@ -12,13 +14,13 @@ fun NavController.navigateHome() {
this.navigate(HomeRoute.route)
}

@OptIn(ExperimentalMaterialApi::class)
@OptIn(ExperimentalMaterial3Api::class)
fun NavGraphBuilder.homeNavGraph(
onPostClick: (Long) -> Unit,
onProfileClick: (String) -> Unit,
onSearchClick: () -> Unit,
coroutineScope: CoroutineScope,
bottomSheetState: ModalBottomSheetState,
bottomSheetState: BottomSheetScaffoldState,
bottomSheetContent: (@Composable () -> Unit) -> Unit
) {
composable(HomeRoute.route) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.ModalBottomSheetState
import androidx.compose.material3.BottomSheetScaffoldState
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
Expand Down Expand Up @@ -45,31 +45,31 @@ import kotlinx.coroutines.launch
const val HOME_DAYOPICK_PAGE_TAB_ID = 0
const val HOME_NEW_PAGE_TAB_ID = 1

@OptIn(ExperimentalMaterialApi::class)
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun HomeScreen(
onPostClick: (Long) -> Unit,
onProfileClick: (String) -> Unit,
onSearchClick: () -> Unit,
coroutineScope: CoroutineScope,
bottomSheetState: ModalBottomSheetState,
bottomSheetState: BottomSheetScaffoldState,
bottomSheetContent: (@Composable () -> Unit) -> Unit,
homeViewModel: HomeViewModel = hiltViewModel()
) {
var homeTabState by rememberSaveable { mutableIntStateOf(HOME_DAYOPICK_PAGE_TAB_ID) }
var selectedCategory by rememberSaveable { mutableStateOf(Pair(CategoryMenu.All.name, 0)) } // name, index
val onCategoryClick: () -> Unit = {
coroutineScope.launch { bottomSheetState.show() }
coroutineScope.launch { bottomSheetState.bottomSheetState.expand() }
}

val onCategorySelect: (CategoryMenu, Int) -> Unit = { categoryMenu, index ->
selectedCategory = Pair(categoryMenu.name, index)
homeViewModel.setCategory(categoryMenu.category)
coroutineScope.launch { bottomSheetState.hide() }
coroutineScope.launch { bottomSheetState.bottomSheetState.hide() }
}

BackHandler(enabled = bottomSheetState.isVisible) {
coroutineScope.launch { bottomSheetState.hide() }
BackHandler(enabled = bottomSheetState.bottomSheetState.isVisible) {
coroutineScope.launch { bottomSheetState.bottomSheetState.hide() }
}

Scaffold(
Expand Down Expand Up @@ -149,13 +149,13 @@ fun HomeScreen(
}
}

@OptIn(ExperimentalMaterialApi::class)
@OptIn(ExperimentalMaterial3Api::class)
@Composable
private fun CategoryBottomSheetDialog(
onCategorySelected: (CategoryMenu, Int) -> Unit,
selectedCategory: Pair<String, Int>,
coroutineScope: CoroutineScope,
bottomSheetState: ModalBottomSheetState
bottomSheetState: BottomSheetScaffoldState
) {
val categoryMenus = listOf(
CategoryMenu.All,
Expand Down Expand Up @@ -184,11 +184,11 @@ private fun CategoryBottomSheetDialog(
normalColor = Gray2_767B83,
checkedColor = Primary_23C882,
checkedButtonIndex = selectedCategory.second,
closeButtonAction = { coroutineScope.launch { bottomSheetState.hide() } }
closeButtonAction = { coroutineScope.launch { bottomSheetState.bottomSheetState.hide() } }
)
}

@OptIn(ExperimentalMaterialApi::class)
@OptIn(ExperimentalMaterial3Api::class)
@Composable
@Preview(showBackground = true)
private fun PreviewHomeScreen() {
Expand Down
Loading