-
Notifications
You must be signed in to change notification settings - Fork 0
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
[PC-300] 약관 디테일 화면 구현 #27
Merged
Merged
Changes from 6 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
6730a62
[PC-300] PieceTopBar에 높이 60dp 고정값 삽입
tgyuuAn 425fafd
[PC-300] 서비스 이용약관 상세 페이지 UI 레이아웃 구현
tgyuuAn f6cdd2d
[PC-300] PieceWebView 추가
tgyuuAn af0dddd
[PC-300] PieceWebView 설정 화면에서도 사용되는 것을 고려하여 DesignSystem으로 이동
tgyuuAn 0adf576
[PC-300] 하드 코딩된 String Strings.xml 로 분리
tgyuuAn 072731d
[PC-300] 불필요한 코드 제거
tgyuuAn ced86ca
[PC-300] termId -> id 변경 및 분해 선언을 위임으로 변경
tgyuuAn d0fd7a0
[PC-300] kotlinXSerialization BuildLogic Android에서 Feature로 이동
tgyuuAn b57f260
[PC-300] LocalDataSource getTerms -> retrieveTerms로 변경
tgyuuAn 3c5ffa1
[PC-300] Room clearAndInsertTemrs -> replaceTerms로 변경
tgyuuAn 13c81b1
[PC-300] MutableMap -> Map으로 변경
tgyuuAn b4e3fb0
[PC-300] Resolve Conflict
tgyuuAn 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 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
36 changes: 36 additions & 0 deletions
36
core/designsystem/src/main/java/com/puzzle/designsystem/component/WebView.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,36 @@ | ||
package com.puzzle.designsystem.component | ||
|
||
import android.webkit.WebChromeClient | ||
import android.webkit.WebView | ||
import android.webkit.WebViewClient | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.setValue | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.platform.LocalContext | ||
import androidx.compose.ui.viewinterop.AndroidView | ||
|
||
@Composable | ||
fun PieceWebView( | ||
url: String, | ||
modifier: Modifier = Modifier, | ||
) { | ||
val context = LocalContext.current | ||
var webView by remember { mutableStateOf<WebView?>(null) } | ||
|
||
AndroidView( | ||
factory = { | ||
webView = WebView(context).apply { | ||
settings.javaScriptEnabled = true | ||
webViewClient = object : WebViewClient() {} | ||
webChromeClient = object : WebChromeClient() {} | ||
} | ||
webView!! | ||
}, | ||
update = { it.loadUrl(url) }, | ||
onRelease = { webView?.destroy() }, | ||
modifier = modifier, | ||
) | ||
} |
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
47 changes: 45 additions & 2 deletions
47
feature/auth/src/main/java/com/puzzle/auth/graph/registration/RegistrationDetailScreen.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,8 +1,51 @@ | ||
package com.puzzle.auth.graph.registration | ||
|
||
import androidx.activity.compose.BackHandler | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.unit.dp | ||
import com.puzzle.designsystem.R | ||
import com.puzzle.designsystem.component.PieceSolidButton | ||
import com.puzzle.designsystem.component.PieceSubBackTopBar | ||
import com.puzzle.designsystem.component.PieceWebView | ||
import com.puzzle.domain.model.terms.Term | ||
|
||
@Composable | ||
internal fun RegistrationDetailScreen() { | ||
internal fun RegistrationDetailScreen( | ||
term: Term, | ||
onBackClick: () -> Unit, | ||
onAgreeClick: () -> Unit, | ||
) { | ||
BackHandler { onBackClick() } | ||
|
||
} | ||
Column( | ||
modifier = Modifier | ||
.fillMaxSize() | ||
.padding(horizontal = 20.dp), | ||
) { | ||
PieceSubBackTopBar( | ||
title = term.title, | ||
onBackClick = onBackClick, | ||
) | ||
|
||
PieceWebView( | ||
url = term.content, | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.weight(1f), | ||
) | ||
|
||
PieceSolidButton( | ||
label = stringResource(R.string.agree), | ||
onClick = onAgreeClick, | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(top = 12.dp, bottom = 10.dp), | ||
) | ||
} | ||
} |
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selectedTerm을 위임이 아니라 분해 선언을 하신 이유가 궁금합니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selectedTerm
프로퍼티로 위임해서 사용하고 있었는데,약관 상세에서 다시 이전화면으로 돌아갈 때
이라는 코드가 약간 어색하게(?) 느껴져서 setSelectedTerm() 이라는 메서드를 사용하고 싶어서 분해하였습니다 ㅎㅎ,,
이 부분 코드 일관성을 위해서 그냥 위임하는게 나을까요 ?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
앗 아뇨 충분히 좋은 접근이라고 생각합니다....!! 일관성도 가독성을 위한 것이라 생각하기 때문에, setSelectedTerm으로 분리해서 쓰신 이유가 가독성이라면 굳이 일관성을 위해 다시 수정할 필요는 없을 것 같아요!