Skip to content

Commit

Permalink
fix: change bottom sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
ansehoon1999 committed Dec 3, 2023
1 parent 0e7b22c commit eb4ba5c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
package com.uliga.app.view.budget

import android.os.Build
import android.util.Log
import androidx.annotation.RequiresApi
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Arrangement
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.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.Text
import androidx.compose.material.TextField
import androidx.compose.material.TextFieldDefaults
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ModalBottomSheet
import androidx.compose.material3.SheetState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
Expand All @@ -31,21 +24,20 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.hilt.navigation.compose.hiltViewModel
import com.holix.android.bottomsheetdialog.compose.BottomSheetBehaviorProperties
import com.holix.android.bottomsheetdialog.compose.BottomSheetDialog
import com.holix.android.bottomsheetdialog.compose.BottomSheetDialogProperties
import com.uliga.app.ui.theme.CustomGrey200
import com.uliga.app.ui.theme.Grey400
import com.uliga.app.ui.theme.Grey500
import com.uliga.app.ui.theme.Grey700
import com.uliga.app.ui.theme.Primary
import com.uliga.app.ui.theme.Secondary
import com.uliga.app.ui.theme.UligaTheme
import com.uliga.app.ui.theme.White
import com.uliga.app.utils.TestTags
import com.uliga.app.view.component.BasicTextField
import com.uliga.app.view.component.HorizontalSpacer
Expand All @@ -56,6 +48,7 @@ import com.uliga.app.view.home.HomeViewModel
import org.orbitmvi.orbit.compose.collectAsState
import org.orbitmvi.orbit.compose.collectSideEffect
import java.time.LocalDate
import kotlin.math.abs

@RequiresApi(Build.VERSION_CODES.Q)
@OptIn(ExperimentalMaterial3Api::class, ExperimentalMaterialApi::class)
Expand All @@ -81,12 +74,13 @@ fun BudgetSettingBottomSheet(
}
}

ModalBottomSheet(
BottomSheetDialog(
onDismissRequest = {
onDismissRequest()
},
sheetState = sheetState,
containerColor = White
properties = BottomSheetDialogProperties(
behaviorProperties = BottomSheetBehaviorProperties()
)
)
{

Expand Down Expand Up @@ -218,7 +212,7 @@ fun BudgetSettingBottomSheet(
horizontalArrangement = Arrangement.End
) {
Text(
text = "${kotlin.math.abs(beforeMonthResult)}",
text = "${abs(beforeMonthResult)}",
color = Primary,
style = UligaTheme.typography.body12,
overflow = TextOverflow.Ellipsis,
Expand Down Expand Up @@ -252,7 +246,8 @@ fun BudgetSettingBottomSheet(
vertical = 16.dp
),
onClick = {
val currentAccountBookBudget = state.currentMonthAccountBookAsset?.budget?.value ?: return@PositiveButton
val currentAccountBookBudget =
state.currentMonthAccountBookAsset?.budget?.value ?: return@PositiveButton

if (currentAccountBookBudget == 0L) {
viewModel.postAccountBookBudget(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ fun InvitationBottomSheet(
onDismissRequest()
},
properties = BottomSheetDialogProperties(
behaviorProperties = BottomSheetBehaviorProperties(

)
behaviorProperties = BottomSheetBehaviorProperties()
)
) {
Surface {
Expand Down

0 comments on commit eb4ba5c

Please sign in to comment.