-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 설정 화면 UI 구현 #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 11 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
ee7f669
[BOOK-113] feat: feature:settings 모듈 추가
seoyoon513 425798d
[BOOK-113] chore: settings 모듈 gradle 설정
seoyoon513 241d34a
[BOOK-113] feat: 설정 화면 UI 구현
seoyoon513 26cfd22
[BOOK-113] feat: Library 화면에서 Settings 화면으로 이동 임시 구현
seoyoon513 339b149
[BOOK-113] feat: 바텀시트 구현 및 Event, State 연동
seoyoon513 7331ee0
Merge branch 'develop' into BOOK-113-feature/#34
seoyoon513 4036244
[BOOK-113] refactor: screens 모듈 기반 네비게이션 방식 적용
seoyoon513 899d093
[BOOK-113] feat: 바텀시트 닫혔을 때 애니메이션 적용
seoyoon513 c71f6d6
[BOOK-113] feat: 바텀시트 닫혔을 때 체크박스 false로 초기화
seoyoon513 9622a78
[BOOK-113] feat: 앱 버전 정보 표시 로직 추가
seoyoon513 b5278b3
[BOOK-113] feat: 앱 버전 click 차단
seoyoon513 0ae13ed
[BOOK-113] chore: code style check success
seoyoon513 a39fea9
[BOOK-113] chore: 토끼 리뷰 반영
seoyoon513 38a9942
[BOOK-113] fix: 접두사 오타 수정 (setting -> settings)
seoyoon513 ba3de34
[BOOK-113] refactor: 앱 버전 관리 로직 UI로 이동
seoyoon513 d529b1c
[BOOK-113] refactor: 상태 변수명 개선 (Sheet -> BottomSheet)
seoyoon513 8007d56
[BOOK-113] refactor: BottomSheet 컴포넌트 분리 및 onCancelButtonClick 콜백 추가
seoyoon513 dd1a421
[BOOK-113] fix: Settings Preview 렌더링 에러 해결
seoyoon513 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
29 changes: 29 additions & 0 deletions
29
...m/src/main/kotlin/com/ninecraft/booket/core/designsystem/component/divider/ReedDivider.kt
This file contains hidden or 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,29 @@ | ||
| package com.ninecraft.booket.core.designsystem.component.divider | ||
|
|
||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Box | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import com.ninecraft.booket.core.designsystem.theme.ReedTheme | ||
|
|
||
| @Composable | ||
| fun ReedDivider(modifier: Modifier = Modifier,) { | ||
| Box( | ||
| modifier = modifier | ||
| .fillMaxWidth() | ||
| .height(8.dp) | ||
| .background(ReedTheme.colors.dividerMd), | ||
| ) | ||
| } | ||
|
|
||
| @Preview | ||
| @Composable | ||
| private fun ReedDividerPreview() { | ||
| ReedTheme { | ||
| ReedDivider() | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 @@ | ||
| /build |
This file contains hidden or 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,21 @@ | ||
| @file:Suppress("INLINE_FROM_HIGHER_PLATFORM") | ||
|
|
||
| plugins { | ||
| alias(libs.plugins.booket.android.feature) | ||
| alias(libs.plugins.kotlin.serialization) | ||
| alias(libs.plugins.kotlin.parcelize) | ||
| } | ||
|
|
||
| android { | ||
| namespace = "com.ninecraft.booket.feature.settings" | ||
| } | ||
|
|
||
| ksp { | ||
| arg("circuit.codegen.mode", "hilt") | ||
| } | ||
|
|
||
| dependencies { | ||
| implementations( | ||
| libs.logger, | ||
| ) | ||
| } |
93 changes: 93 additions & 0 deletions
93
feature/settings/src/main/kotlin/com/ninecraft/booket/feature/settings/SettingsPresenter.kt
This file contains hidden or 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,93 @@ | ||
| package com.ninecraft.booket.feature.settings | ||
|
|
||
| import android.content.Context | ||
| import android.content.pm.PackageManager | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.runtime.getValue | ||
| import androidx.compose.runtime.mutableStateOf | ||
| import androidx.compose.runtime.setValue | ||
| import com.ninecraft.booket.screens.SettingsScreen | ||
| import com.slack.circuit.codegen.annotations.CircuitInject | ||
| import com.slack.circuit.retained.rememberRetained | ||
| import com.slack.circuit.runtime.Navigator | ||
| import com.slack.circuit.runtime.presenter.Presenter | ||
| import dagger.assisted.Assisted | ||
| import dagger.assisted.AssistedFactory | ||
| import dagger.assisted.AssistedInject | ||
| import dagger.hilt.android.components.ActivityRetainedComponent | ||
| import dagger.hilt.android.qualifiers.ApplicationContext | ||
|
|
||
| class SettingsPresenter @AssistedInject constructor( | ||
| @Assisted val navigator: Navigator, | ||
| @ApplicationContext private val context: Context, | ||
| ) : Presenter<SettingsUiState> { | ||
|
|
||
| @Composable | ||
| override fun present(): SettingsUiState { | ||
| val appVersion = rememberRetained { getAppVersion(context) } | ||
| var isLogoutSheetVisible by rememberRetained { mutableStateOf(false) } | ||
| var isWithdrawSheetVisible by rememberRetained { mutableStateOf(false) } | ||
| var isWithdrawConfirmed by rememberRetained { mutableStateOf(false) } | ||
|
|
||
| fun handleEvent(event: SettingsUiEvent) { | ||
| when (event) { | ||
| is SettingsUiEvent.OnBackClick -> { | ||
| navigator.pop() | ||
| } | ||
|
|
||
| is SettingsUiEvent.OnTermDetailClick -> { | ||
| // TODO: 웹뷰 화면으로 이동 | ||
| } | ||
|
|
||
| is SettingsUiEvent.OnLogoutClick -> { | ||
| isLogoutSheetVisible = true | ||
| } | ||
|
|
||
| is SettingsUiEvent.OnWithdrawClick -> { | ||
| isWithdrawSheetVisible = true | ||
| } | ||
|
|
||
| is SettingsUiEvent.OnBottomSheetDismissed -> { | ||
| isLogoutSheetVisible = false | ||
| isWithdrawSheetVisible = false | ||
| isWithdrawConfirmed = false | ||
| } | ||
|
|
||
| is SettingsUiEvent.OnWithdrawConfirmationToggled -> { | ||
| isWithdrawConfirmed = !isWithdrawConfirmed | ||
| } | ||
|
|
||
| is SettingsUiEvent.Logout -> { | ||
| // TODO: 로그아웃 처리 -> 성공 시 로그인 화면으로 이동 | ||
| } | ||
|
|
||
| is SettingsUiEvent.Withdraw -> { | ||
| // TODO: 회원탈퇴 처리 -> 성공 시 로그인 화면으로 이동 | ||
| } | ||
| } | ||
| } | ||
| return SettingsUiState( | ||
| appVersion = appVersion, | ||
| isLogoutSheetVisible = isLogoutSheetVisible, | ||
| isWithdrawSheetVisible = isWithdrawSheetVisible, | ||
| isWithdrawConfirmed = isWithdrawConfirmed, | ||
| eventSink = ::handleEvent, | ||
| ) | ||
| } | ||
|
|
||
| @CircuitInject(SettingsScreen::class, ActivityRetainedComponent::class) | ||
| @AssistedFactory | ||
| fun interface Factory { | ||
| fun create(navigator: Navigator): SettingsPresenter | ||
| } | ||
|
|
||
| private fun getAppVersion(context: Context): String { | ||
| return try { | ||
| val packageInfo = context.packageManager.getPackageInfo(context.packageName, 0) | ||
| packageInfo.versionName ?: "" | ||
| } catch (e: PackageManager.NameNotFoundException) { | ||
| e.printStackTrace() | ||
| "" | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.