-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] #66 미지원 브랜드 QR 스캔 시 대응 기능 구현 #67
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 all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c7a63ac
[feat] #66: SingleButtonWithTextButtonAlertDialog 구현
ikseong00 511d9fd
[feat] #66: QR 스캔 결과 미지원 브랜드 판별 시 대응 로직 구현
ikseong00 27d7720
[feat] #66: QR 스캔 시 브랜드 지원 여부 확인 로직 뷰모델로 이동
ikseong00 d531680
[chore] #66: 다이얼로그 너비가 작아지는 현상 수정
ikseong00 f98bbed
[style] #66: detekt `FunctionOnlyReturningConstant` 규칙 비활성화
ikseong00 f426c6f
[fix] #66: 테스트용 코드 제거
ikseong00 83f1312
[chore] #66: 디자인 시스템 터치 범위 반영
ikseong00 5b7a0fe
[fix] #66: QR 다운로드 팝업 버튼 클릭 시 다이얼로그 닫기 로직 추가
ikseong00 7d9ef96
[refactor] #66: `Uri.parse()`를 `String.toUri()` 확장 함수로 변경
ikseong00 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
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
128 changes: 128 additions & 0 deletions
128
...n/java/com/neki/android/core/designsystem/dialog/SingleButtonWithTextButtonAlertDialog.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,128 @@ | ||
| package com.neki.android.core.designsystem.dialog | ||
|
|
||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.layout.widthIn | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.material3.Icon | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.draw.clip | ||
| import androidx.compose.ui.graphics.Color | ||
| import androidx.compose.ui.graphics.vector.ImageVector | ||
| import androidx.compose.ui.res.vectorResource | ||
| import androidx.compose.ui.text.style.TextAlign | ||
| import androidx.compose.ui.text.style.TextDecoration | ||
| import androidx.compose.ui.unit.dp | ||
| import androidx.compose.ui.window.Dialog | ||
| import androidx.compose.ui.window.DialogProperties | ||
| import com.neki.android.core.designsystem.ComponentPreview | ||
| import com.neki.android.core.designsystem.R | ||
| import com.neki.android.core.designsystem.button.CTAButtonPrimary | ||
| import com.neki.android.core.designsystem.modifier.clickableSingle | ||
| import com.neki.android.core.designsystem.ui.theme.NekiTheme | ||
|
|
||
| @Composable | ||
| fun SingleButtonWithTextButtonAlertDialog( | ||
| title: String, | ||
| content: String, | ||
| buttonText: String, | ||
| textButtonText: String, | ||
| onDismissRequest: () -> Unit, | ||
| onButtonClick: () -> Unit, | ||
| onTextButtonClick: () -> Unit, | ||
| enabled: Boolean = true, | ||
| properties: DialogProperties = DialogProperties( | ||
| usePlatformDefaultWidth = false, | ||
| dismissOnBackPress = false, | ||
| dismissOnClickOutside = false, | ||
| ), | ||
| ) { | ||
| Dialog( | ||
| onDismissRequest = onDismissRequest, | ||
| properties = properties, | ||
| ) { | ||
| Column( | ||
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .padding(horizontal = 20.dp) | ||
| .widthIn(max = 400.dp) | ||
| .clip(RoundedCornerShape(20.dp)) | ||
| .background(NekiTheme.colorScheme.white) | ||
| .padding(top = 20.dp), | ||
| horizontalAlignment = Alignment.CenterHorizontally, | ||
| verticalArrangement = Arrangement.spacedBy(12.dp), | ||
| ) { | ||
| Icon( | ||
| imageVector = ImageVector.vectorResource(R.drawable.icon_dialog_alert), | ||
| tint = Color.Unspecified, | ||
| contentDescription = null, | ||
| ) | ||
| Column( | ||
| modifier = Modifier.padding(horizontal = 24.dp), | ||
| verticalArrangement = Arrangement.spacedBy(2.dp), | ||
| horizontalAlignment = Alignment.CenterHorizontally, | ||
| ) { | ||
| Text( | ||
| text = title, | ||
| style = NekiTheme.typography.title18Bold, | ||
| color = NekiTheme.colorScheme.gray900, | ||
| textAlign = TextAlign.Center, | ||
| ) | ||
| Text( | ||
| text = content, | ||
| style = NekiTheme.typography.body14Regular, | ||
| color = NekiTheme.colorScheme.gray500, | ||
| textAlign = TextAlign.Center, | ||
| ) | ||
| } | ||
| Column( | ||
| modifier = Modifier.padding(vertical = 12.dp), | ||
| horizontalAlignment = Alignment.CenterHorizontally, | ||
| verticalArrangement = Arrangement.spacedBy(8.dp), | ||
| ) { | ||
| CTAButtonPrimary( | ||
| text = buttonText, | ||
| onClick = onButtonClick, | ||
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .padding(horizontal = 12.dp), | ||
| enabled = enabled, | ||
| ) | ||
| Text( | ||
| modifier = Modifier | ||
| .padding( | ||
| vertical = 4.dp, | ||
| horizontal = 56.dp, | ||
| ) | ||
| .clickableSingle(onClick = onTextButtonClick), | ||
| text = textButtonText, | ||
| style = NekiTheme.typography.body14Regular, | ||
| color = NekiTheme.colorScheme.primary600, | ||
| textDecoration = TextDecoration.Underline, | ||
| ) | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @ComponentPreview | ||
| @Composable | ||
| private fun SingleButtonWithTextButtonAlertDialogPreview() { | ||
| NekiTheme { | ||
| SingleButtonWithTextButtonAlertDialog( | ||
| title = "메인 텍스트가 들어가는 곳", | ||
| content = "보조 설명 텍스트가 들어가는 공간입니다", | ||
| buttonText = "텍스트", | ||
| textButtonText = "텍스트 공간", | ||
| onDismissRequest = {}, | ||
| onButtonClick = {}, | ||
| onTextButtonClick = {}, | ||
| ) | ||
| } | ||
| } | ||
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
6 changes: 6 additions & 0 deletions
6
.../photo-upload/api/src/main/java/com/neki/android/feature/photo_upload/api/QRScanResult.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,6 @@ | ||
| package com.neki.android.feature.photo_upload.api | ||
|
|
||
| sealed interface QRScanResult { | ||
| data class QRCodeScanned(val imageUrl: String) : QRScanResult | ||
| data object OpenGallery : QRScanResult | ||
| } |
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
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.