Skip to content

Commit

Permalink
[FIX/#239] 웹뷰 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
arinming committed Sep 15, 2024
1 parent e1ef6bd commit 180f9f3
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions feature/src/main/java/com/terning/feature/intern/InternRoute.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
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
Expand All @@ -19,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
Expand Down Expand Up @@ -114,6 +113,8 @@ fun InternScreen(
onClickCancelButton: (InternInfo) -> Unit,
onClickScrapButton: (InternInfo) -> Unit,
) {
val context = LocalContext.current

val decimal = DecimalFormat("#,###")

val internInfoList = listOf(
Expand All @@ -127,18 +128,10 @@ fun InternScreen(
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(
Expand Down

0 comments on commit 180f9f3

Please sign in to comment.