Skip to content

Commit

Permalink
Merge pull request #266 from School-of-Company/refactor/265-use-remem…
Browse files Browse the repository at this point in the history
…berSaveable

🔀 :: (#265) - Use rememberSaveable
  • Loading branch information
audgns10 authored Aug 14, 2024
2 parents 4a865ad + 1ec579f commit 78694b2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusManager
import androidx.compose.ui.input.pointer.pointerInput
Expand Down Expand Up @@ -65,7 +65,7 @@ internal fun AddCertificationScreen(
selectedDate: LocalDate?,
onAddClicked: (name: String, acquisitionDate: LocalDate) -> Unit
) {
val (isDate, setIsDate) = remember { mutableStateOf(selectedDate) }
val (isDate, setIsDate) = rememberSaveable { mutableStateOf(selectedDate) }

BitgoeulAndroidTheme { colors, _ ->
Box(
Expand Down
5 changes: 2 additions & 3 deletions feature/club/src/main/java/com/msg/club/ClubScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.material3.IconButton
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
Expand Down Expand Up @@ -97,7 +96,7 @@ internal fun ClubScreen(
onSettingClicked: (String) -> Unit,
onItemClicked: (Long) -> Unit
) {
val (isDialogOpened, setIsDialogOpened) = remember { mutableStateOf(false) }
val (isDialogOpened, setIsDialogOpened) = rememberSaveable { mutableStateOf(false) }
val schoolList = HighSchool.entries.getSchoolNameFromEnum()

BitgoeulAndroidTheme { colors, typography ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ internal fun EmailSendInformRoute(
)
}




private suspend fun getEmailAuthenticateStatus(
viewModel: EmailViewModel,
onSuccess: (data: GetEmailAuthenticateStatusEntity) -> Unit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -78,7 +78,7 @@ internal fun MyPageScreen(
data: GetMyPageEntity,
modifier: Modifier = Modifier
) {
val (isDialogOpen, setIsDialogOpen) = remember { mutableStateOf(false) }
val (isDialogOpen, setIsDialogOpen) = rememberSaveable { mutableStateOf(false) }

BitgoeulAndroidTheme { colors, typography ->
Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusManager
Expand Down Expand Up @@ -76,10 +76,10 @@ internal fun PasswordChangeScreen(
onSuccessScreenButtonClicked: () -> Unit,
onBackClicked: () -> Unit
) {
val isWrongPassword by remember { mutableStateOf(false) }
var isSamePassword by remember { mutableStateOf(true) }
val isWrongPassword by rememberSaveable { mutableStateOf(false) }
var isSamePassword by rememberSaveable { mutableStateOf(true) }

val (isShowSuccessScreen, setIsShowSuccessScreen) = remember { mutableStateOf(false) }
val (isShowSuccessScreen, setIsShowSuccessScreen) = rememberSaveable { mutableStateOf(false) }

BitgoeulAndroidTheme { colors, typography ->
Surface(
Expand Down

0 comments on commit 78694b2

Please sign in to comment.