-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor : pass modifier * feat : add SelectCharacterDialog * feat : Add character change to settings * refactor : use string resources for button text * refactor : lint * feat : review * feat : contentDesc * refactor : en res
- Loading branch information
Showing
12 changed files
with
165 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="select_character_title">Please select your running mate</string> | ||
<string name="all_complete">Start</string> | ||
<string name="bird_character_description">Nagging Bird</string> | ||
<string name="rabbit_character_description">Empathetic Lucky Rabbit</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="select_character_title">함께 할 러닝메이트를\n선택해 주세요</string> | ||
<string name="all_complete">시작하기</string> | ||
<string name="bird_character_description">마구 쪼는 잔소리무새</string> | ||
<string name="rabbit_character_description">공감 만점 럭키 토끼</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
feature/setting/src/main/kotlin/com/chipichipi/dobedobe/feature/setting/SettingUiState.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
package com.chipichipi.dobedobe.feature.setting | ||
|
||
import com.chipichipi.dobedobe.core.model.CharacterType | ||
|
||
sealed interface SettingUiState { | ||
data object Loading : SettingUiState | ||
|
||
data class Success( | ||
val isGoalNotificationEnabled: Boolean, | ||
val characterType: CharacterType, | ||
) : SettingUiState | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
...rc/main/kotlin/com/chipichipi/dobedobe/feature/setting/component/SelectCharacterDialog.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
package com.chipichipi.dobedobe.feature.setting.component | ||
|
||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.filled.Cancel | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.IconButton | ||
import androidx.compose.material3.Surface | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.saveable.rememberSaveable | ||
import androidx.compose.runtime.setValue | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.window.Dialog | ||
import androidx.compose.ui.window.DialogProperties | ||
import com.chipichipi.dobedobe.core.designsystem.component.ThemePreviews | ||
import com.chipichipi.dobedobe.core.designsystem.theme.DobeDobeTheme | ||
import com.chipichipi.dobedobe.core.model.CharacterType | ||
import com.chipichipi.dobedobe.core.ui.SelectCharacterScreen | ||
import com.chipichipi.dobedobe.feature.setting.R | ||
|
||
@Composable | ||
internal fun SelectCharacterDialog( | ||
onDismissRequest: () -> Unit, | ||
characterType: CharacterType, | ||
onCharacterChangeCompleted: (CharacterType) -> Unit, | ||
) { | ||
var selectedCharacterType by rememberSaveable { mutableStateOf(characterType) } | ||
|
||
Dialog( | ||
onDismissRequest = onDismissRequest, | ||
properties = DialogProperties( | ||
usePlatformDefaultWidth = false, | ||
), | ||
) { | ||
Surface( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(horizontal = 24.dp), | ||
shape = RoundedCornerShape(16.dp), | ||
color = DobeDobeTheme.colors.white, | ||
) { | ||
Column( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(top = 10.dp, bottom = 32.dp), | ||
) { | ||
IconButton( | ||
modifier = Modifier.align(Alignment.End), | ||
onClick = onDismissRequest, | ||
) { | ||
Icon( | ||
imageVector = Icons.Filled.Cancel, | ||
contentDescription = "close", | ||
) | ||
} | ||
|
||
SelectCharacterScreen( | ||
selectedCharacter = selectedCharacterType, | ||
onCompleted = { | ||
onCharacterChangeCompleted(selectedCharacterType) | ||
onDismissRequest() | ||
}, | ||
onCharacterToggled = { | ||
selectedCharacterType = if (selectedCharacterType == CharacterType.Rabbit) { | ||
CharacterType.Bird | ||
} else { | ||
CharacterType.Rabbit | ||
} | ||
}, | ||
buttonText = R.string.feature_setting_change_character_completed, | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(horizontal = 24.dp), | ||
) | ||
} | ||
} | ||
} | ||
} | ||
|
||
@ThemePreviews | ||
@Composable | ||
private fun SelectCharacterDialogPreview() { | ||
DobeDobeTheme { | ||
SelectCharacterDialog( | ||
onDismissRequest = {}, | ||
characterType = CharacterType.Rabbit, | ||
onCharacterChangeCompleted = {}, | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters