-
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.
Browse files
Browse the repository at this point in the history
* [FIX] #26 기존 bottomSheet에서 close animation이 제대로 동작하지 않던 문제 수정 * [FEATURE+FIX] #26 단일 버튼 BottomSheet 구현 및 기존 RemoveItemBottomSheet를 TwoButtonBottomSheet로 변경 * [CHORE] #26 ktlint 적용 * [CHORE] #26 코드 리뷰 피드백 반영
- Loading branch information
Showing
16 changed files
with
377 additions
and
272 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
76 changes: 76 additions & 0 deletions
76
...ons/pokit/core/ui/components/template/onebuttonbottomsheet/OneButtonBottomSheetContent.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,76 @@ | ||
package pokitmons.pokit.core.ui.components.template.onebuttonbottomsheet | ||
|
||
import androidx.compose.foundation.layout.Column | ||
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.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.text.style.TextAlign | ||
import androidx.compose.ui.unit.dp | ||
import pokitmons.pokit.core.ui.R | ||
import pokitmons.pokit.core.ui.components.atom.button.PokitButton | ||
import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitButtonShape | ||
import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitButtonSize | ||
import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitButtonStyle | ||
import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitButtonType | ||
import pokitmons.pokit.core.ui.theme.PokitTheme | ||
|
||
@Composable | ||
fun OneButtonBottomSheetContent( | ||
title: String, | ||
subText: String? = null, | ||
buttonText: String = stringResource(id = R.string.confirmation), | ||
onClickButton: () -> Unit = {}, | ||
) { | ||
Column( | ||
modifier = Modifier.fillMaxWidth() | ||
) { | ||
Spacer(modifier = Modifier.height(36.dp)) | ||
|
||
Text( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(horizontal = 20.dp), | ||
text = title, | ||
textAlign = TextAlign.Center, | ||
style = PokitTheme.typography.title2.copy(color = PokitTheme.colors.textPrimary) | ||
) | ||
|
||
subText?.let { subText -> | ||
Spacer(modifier = Modifier.height(8.dp)) | ||
|
||
Text( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(horizontal = 20.dp), | ||
text = subText, | ||
textAlign = TextAlign.Center, | ||
style = PokitTheme.typography.body2Medium.copy(color = PokitTheme.colors.textSecondary) | ||
) | ||
} | ||
|
||
Spacer(modifier = Modifier.height(20.dp)) | ||
|
||
Row( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(top = 16.dp, start = 20.dp, end = 20.dp, bottom = 28.dp) | ||
) { | ||
PokitButton( | ||
text = buttonText, | ||
icon = null, | ||
onClick = onClickButton, | ||
shape = PokitButtonShape.RECTANGLE, | ||
type = PokitButtonType.PRIMARY, | ||
size = PokitButtonSize.LARGE, | ||
style = PokitButtonStyle.FILLED, | ||
modifier = Modifier.weight(1f) | ||
) | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
...src/main/java/pokitmons/pokit/core/ui/components/template/onebuttonbottomsheet/Preview.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,39 @@ | ||
package pokitmons.pokit.core.ui.components.template.onebuttonbottomsheet | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.material3.HorizontalDivider | ||
import androidx.compose.material3.Surface | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import pokitmons.pokit.core.ui.theme.PokitTheme | ||
|
||
@Preview(showBackground = true) | ||
@Composable | ||
private fun Preview() { | ||
PokitTheme { | ||
Surface(modifier = Modifier.fillMaxSize()) { | ||
Column( | ||
modifier = Modifier.fillMaxWidth() | ||
) { | ||
OneButtonBottomSheetContent( | ||
title = "로그인 오류", | ||
subText = "현재 서버 오류로 로그인에 실패했습니다.\n잠시 후에 다시 시도해 주세요." | ||
) | ||
|
||
HorizontalDivider( | ||
modifier = Modifier.height(16.dp).background(PokitTheme.colors.borderTertiary) | ||
) | ||
|
||
OneButtonBottomSheetContent( | ||
title = "여기에 타이틀이 들어갑니다" | ||
) | ||
} | ||
} | ||
} | ||
} |
30 changes: 24 additions & 6 deletions
30
...rc/main/java/pokitmons/pokit/core/ui/components/template/removeItemBottomSheet/Preview.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,23 +1,41 @@ | ||
package pokitmons.pokit.core.ui.components.template.removeItemBottomSheet | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.material3.HorizontalDivider | ||
import androidx.compose.material3.Surface | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import pokitmons.pokit.core.ui.components.template.removeItemBottomSheet.attributes.RemoveItemType | ||
import androidx.compose.ui.unit.dp | ||
import pokitmons.pokit.core.ui.theme.PokitTheme | ||
|
||
@Preview(showBackground = true) | ||
@Composable | ||
private fun RemoveItemBottomSheetContentPreview() { | ||
PokitTheme { | ||
Surface(modifier = Modifier.fillMaxSize()) { | ||
RemoveItemBottomSheetContent( | ||
removeItemType = RemoveItemType.LINK, | ||
onClickCancel = {}, | ||
onClickRemove = {} | ||
) | ||
Column(modifier = Modifier.fillMaxWidth()) { | ||
TwoButtonBottomSheetContent( | ||
title = "포킷을 정말 삭제하시겠습니까?", | ||
subText = "함께 저장한 모든 링크가 삭제되며,\n복구하실 수 없습니다.", | ||
onClickLeftButton = {}, | ||
onClickRightButton = {} | ||
) | ||
|
||
HorizontalDivider( | ||
modifier = Modifier.height(16.dp).background(PokitTheme.colors.borderTertiary) | ||
) | ||
|
||
TwoButtonBottomSheetContent( | ||
title = "로그아웃 하시겠습니까?", | ||
onClickLeftButton = {}, | ||
onClickRightButton = {} | ||
) | ||
} | ||
} | ||
} | ||
} |
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
14 changes: 0 additions & 14 deletions
14
...mons/pokit/core/ui/components/template/removeItemBottomSheet/attributes/RemoveItemType.kt
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.