-
Notifications
You must be signed in to change notification settings - Fork 1
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
[FIX/#239] 공고 상세 뷰 / QA 수정사항 반영 #249
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
082a7ef
[FEAT/#239] 화면에 background color 추가
arinming 2fbb25d
[FEAT/#239] 공고 상세 뷰 네비게이션 변경
arinming 5b3a6df
[FIX/#239] 공고 상세 뷰 Padding 값 조정
arinming 34f3d7a
[FEAT/#239] 스크랩 취소 다이얼로그 띄우기
arinming e177872
Merge remote-tracking branch 'origin/develop' into fix/#239-announcement
arinming 6e17227
[FEAT/#239] 스크랩 아이콘 업데이트
arinming 6f1ddc2
Merge remote-tracking branch 'origin/develop' into fix/#239-announcement
arinming 404568d
[FIX/#239] 공고 상세 페이지 데이터 구조 수정
arinming e1ef6bd
[FIX/#239] 공고 상세 페이지 다이얼로그 로직 수정
arinming 180f9f3
[FIX/#239] 웹뷰 로직 수정
arinming 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
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,11 +1,13 @@ | ||
package com.terning.feature.intern | ||
|
||
import android.view.ViewGroup | ||
import android.webkit.WebView | ||
import androidx.browser.customtabs.CustomTabsIntent | ||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxHeight | ||
import androidx.compose.foundation.layout.navigationBarsPadding | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.statusBarsPadding | ||
import androidx.compose.foundation.lazy.LazyColumn | ||
import androidx.compose.foundation.text.selection.SelectionContainer | ||
import androidx.compose.material3.Text | ||
|
@@ -16,7 +18,7 @@ import androidx.compose.ui.Modifier | |
import androidx.compose.ui.platform.LocalContext | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.viewinterop.AndroidView | ||
import androidx.core.net.toUri | ||
import androidx.hilt.navigation.compose.hiltViewModel | ||
import androidx.lifecycle.compose.LocalLifecycleOwner | ||
import androidx.lifecycle.compose.collectAsStateWithLifecycle | ||
|
@@ -27,6 +29,7 @@ import com.terning.core.designsystem.theme.CalRed | |
import com.terning.core.designsystem.theme.Grey200 | ||
import com.terning.core.designsystem.theme.Grey400 | ||
import com.terning.core.designsystem.theme.TerningTheme | ||
import com.terning.core.designsystem.theme.White | ||
import com.terning.core.extension.customShadow | ||
import com.terning.core.extension.toast | ||
import com.terning.core.state.UiState | ||
|
@@ -45,14 +48,12 @@ import java.text.DecimalFormat | |
@Composable | ||
fun InternRoute( | ||
announcementId: Long = 0, | ||
modifier: Modifier, | ||
viewModel: InternViewModel = hiltViewModel(), | ||
navController: NavHostController, | ||
) { | ||
val internState by viewModel.internUiState.collectAsStateWithLifecycle() | ||
|
||
val context = LocalContext.current | ||
val lifecycleOwner = LocalLifecycleOwner.current | ||
val internState by viewModel.internUiState.collectAsStateWithLifecycle(lifecycleOwner) | ||
|
||
LaunchedEffect(key1 = true) { | ||
viewModel.getInternInfo(announcementId) | ||
|
@@ -75,21 +76,25 @@ fun InternRoute( | |
InternScreen( | ||
announcementId = announcementId, | ||
internUiState = internState, | ||
modifier = modifier, | ||
internInfo = (internState.loadState as UiState.Success).data, | ||
navController = navController, | ||
onDismissCancelDialog = { | ||
viewModel.updateScrapCancelDialogVisibility(false) | ||
with(viewModel) { | ||
updateScrapCancelDialogVisibility(false) | ||
getInternInfo(announcementId) | ||
} | ||
}, | ||
onDismissScrapDialog = { | ||
with(viewModel) { | ||
updateInternDialogVisibility(false) | ||
getInternInfo(announcementId) | ||
} | ||
}, | ||
onDismissScrapDialog = { viewModel.updateInternDialogVisibility(false) }, | ||
onClickCancelButton = { | ||
viewModel.updateScrapCancelDialogVisibility(true) | ||
}, | ||
onClickScrapButton = { | ||
with(viewModel) { | ||
updateInternshipModel(it) | ||
updateInternDialogVisibility(true) | ||
} | ||
viewModel.updateInternDialogVisibility(true) | ||
} | ||
) | ||
} | ||
|
@@ -108,35 +113,33 @@ fun InternScreen( | |
onClickCancelButton: (InternInfo) -> Unit, | ||
onClickScrapButton: (InternInfo) -> Unit, | ||
) { | ||
val context = LocalContext.current | ||
|
||
val decimal = DecimalFormat("#,###") | ||
|
||
val internInfoList = listOf( | ||
stringResource(id = R.string.intern_info_d_day) to internInfo.deadline, | ||
stringResource(id = R.string.intern_info_working) to internInfo.workingPeriod, | ||
stringResource(id = R.string.intern_info_start_date) to internInfo.startDate, | ||
stringResource(id = R.string.intern_info_start_date) to internInfo.startYearMonth, | ||
) | ||
|
||
val qualificationList = listOf( | ||
stringResource(id = R.string.intern_recruitment_target) to internInfo.qualification, | ||
stringResource(id = R.string.intern_info_work) to internInfo.jobType, | ||
) | ||
|
||
if (internUiState.showWeb) { | ||
AndroidView( | ||
factory = { | ||
WebView(it).apply { | ||
layoutParams = ViewGroup.LayoutParams( | ||
ViewGroup.LayoutParams.MATCH_PARENT, | ||
ViewGroup.LayoutParams.MATCH_PARENT, | ||
) | ||
loadUrl(internInfo.url) | ||
} | ||
}, | ||
) | ||
LaunchedEffect(internUiState.showWeb) { | ||
if (internUiState.showWeb) { | ||
CustomTabsIntent.Builder().build().launchUrl(context, internInfo.url.toUri()) | ||
} | ||
} | ||
|
||
Column( | ||
modifier = modifier.fillMaxHeight(), | ||
modifier = modifier | ||
.statusBarsPadding() | ||
.navigationBarsPadding() | ||
.fillMaxHeight() | ||
.background(White), | ||
Comment on lines
137
to
+142
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 수정 넘 좋아요!!! |
||
) { | ||
Column( | ||
modifier = Modifier.weight(1f) | ||
|
@@ -200,7 +203,7 @@ fun InternScreen( | |
} | ||
} | ||
|
||
Spacer(modifier = Modifier.padding(top = 16.dp)) | ||
Spacer(modifier = Modifier.padding(top = 13.dp)) | ||
|
||
InternPageTitle( | ||
modifier = Modifier, | ||
|
@@ -219,7 +222,7 @@ fun InternScreen( | |
} | ||
} | ||
|
||
Spacer(modifier = Modifier.padding(top = 16.dp)) | ||
Spacer(modifier = Modifier.padding(top = 13.dp)) | ||
|
||
InternPageTitle( | ||
modifier = Modifier, | ||
|
@@ -250,36 +253,35 @@ fun InternScreen( | |
modifier = Modifier, | ||
internInfo = internInfo, | ||
onScrapClick = { | ||
if (!internUiState.isScrappedState) | ||
if (internInfo.isScrapped) { | ||
onClickCancelButton(internInfo) | ||
} else { | ||
onClickScrapButton(internInfo) | ||
else onClickCancelButton(internInfo) | ||
} | ||
}, | ||
) | ||
|
||
|
||
if (internUiState.scrapDialogVisibility) { | ||
if (internUiState.scrapCancelDialogVisibility) { | ||
ScrapCancelDialog( | ||
internshipAnnouncementId = announcementId, | ||
onDismissRequest = onDismissCancelDialog | ||
) | ||
} | ||
|
||
if (internUiState.internDialogVisibility) { | ||
internUiState.internshipModel?.let { | ||
ScrapDialog( | ||
title = internUiState.internshipModel.title, | ||
scrapColor = CalRed, | ||
deadline = internUiState.internshipModel.deadline, | ||
startYearMonth = internUiState.internshipModel.startDate, | ||
workingPeriod = internUiState.internshipModel.workingPeriod, | ||
internshipAnnouncementId = announcementId, | ||
companyImage = internUiState.internshipModel.companyImage, | ||
isScrapped = false, | ||
onDismissRequest = onDismissScrapDialog, | ||
onClickChangeColor = { }, | ||
onClickNavigateButton = { } | ||
) | ||
} | ||
ScrapDialog( | ||
title = internInfo.title, | ||
scrapColor = CalRed, | ||
deadline = internInfo.deadline, | ||
startYearMonth = internInfo.startYearMonth, | ||
workingPeriod = internInfo.workingPeriod, | ||
internshipAnnouncementId = announcementId, | ||
companyImage = internInfo.companyImage, | ||
isScrapped = internInfo.isScrapped, | ||
onDismissRequest = onDismissScrapDialog, | ||
onClickChangeColor = { }, | ||
onClickNavigateButton = { } | ||
) | ||
} | ||
} | ||
} |
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
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.
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.
제가 아린언니 브렌치 들어가서 돌려봤는데 실기기 문제인 것 같아요..! 공기계로 돌려보니 안 뜨더라구요ㅜㅜ
130번째 줄에 아래와 같이 수정하면 웹 뷰 잘 뜨는 것 같습니당..!
확인부탁드려요!
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.
추가로.. 제가 말한대로 작성 시 백버튼 눌렀을 때 다시 웹 뷰가 뜨는 이슈가 있는 것 같은데,, 저도 정확히 보지 않아서 뭐가 문제인지 확실하진 않지만,, 이 부분은 MyPageRoute 한번 참고해보면 좋을 것 같아요..!
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.
새삼스럽지만 사랑합니다 ㅜㅜ
수정했는데, 실기기에서 잘 동작하는지 확인해주심 감사 🥹
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.
확인했습니당 잘 동작하네요!! 수고했어요!!🙂 @arinming