Skip to content

Commit a571929

Browse files
authored
Merge pull request #50 from Nexters/feature/add-proposal-detail-deeplink
모임 초대장 상세 화면 딥링크를 연결합니다.
2 parents a41a64c + 85efa4e commit a571929

File tree

19 files changed

+338
-13
lines changed

19 files changed

+338
-13
lines changed

core/ui-navigation/src/main/java/com/plottwist/core/ui/navigation/Route.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,9 @@ sealed interface Route {
8686

8787
@Serializable
8888
data object EditName : Route
89+
90+
@Serializable
91+
data class ProposalDetail(
92+
val proposalId: Long
93+
) : Route
8994
}

feature/webview/src/main/java/com/plottwist/feature/webview/client/TukWebViewClient.kt renamed to core/ui/src/main/java/com/plottwist/core/ui/web/client/TukWebViewClient.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.plottwist.feature.webview.client
1+
package com.plottwist.core.ui.web.client
22

33
import android.webkit.WebView
44
import android.webkit.WebViewClient

feature/webview/src/main/java/com/plottwist/feature/webview/component/TukWebView.kt renamed to core/ui/src/main/java/com/plottwist/core/ui/web/component/TukWebView.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
package com.plottwist.feature.webview.component
1+
package com.plottwist.core.ui.web.component
22

33
import android.annotation.SuppressLint
44
import android.view.ViewGroup
55
import android.webkit.WebView
66
import androidx.compose.runtime.Composable
77
import androidx.compose.ui.Modifier
88
import androidx.compose.ui.viewinterop.AndroidView
9-
import com.plottwist.feature.webview.client.TukWebViewClient
9+
import com.plottwist.core.ui.web.client.TukWebViewClient
1010

1111
@SuppressLint("SetJavaScriptEnabled")
1212
@Composable
@@ -26,6 +26,10 @@ fun TukWebView(
2626
ViewGroup.LayoutParams.MATCH_PARENT
2727
)
2828

29+
webViewClient = TukWebViewClient(
30+
onPageFinished = onPageFinished
31+
)
32+
2933
settings.run {
3034
javaScriptEnabled = true
3135
domStorageEnabled = true
@@ -37,10 +41,6 @@ fun TukWebView(
3741
setInitialScale(1)
3842
}
3943

40-
webViewClient = TukWebViewClient(
41-
onPageFinished = onPageFinished
42-
)
43-
4444
addBridge(this)
4545

4646
onWebViewCreated(this)

feature/main/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ dependencies {
1818
implementation(project(":feature:webview"))
1919
implementation(project(":feature:invite_gathering"))
2020
implementation(project(":feature:join_gathering"))
21+
implementation(project(":feature:proposal-detail"))
2122
testImplementation(libs.junit)
2223
androidTestImplementation(libs.androidx.test.ext.junit)
2324
androidTestImplementation(libs.espresso.core)

feature/main/src/main/java/com/plottwist/feature/main/MainActivity.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package com.plottwist.feature.main
22

3+
import android.content.Intent
34
import android.os.Bundle
45
import androidx.activity.ComponentActivity
56
import androidx.activity.compose.setContent
67
import androidx.activity.enableEdgeToEdge
8+
import androidx.core.net.toUri
79
import com.plottwist.feature.main.ui.theme.TukTheme
810
import dagger.hilt.android.AndroidEntryPoint
911

@@ -13,6 +15,7 @@ class MainActivity : ComponentActivity() {
1315
super.onCreate(savedInstanceState)
1416
enableEdgeToEdge()
1517

18+
handleDeepLink(intent)
1619
setComposeContent()
1720
}
1821

@@ -24,6 +27,16 @@ class MainActivity : ComponentActivity() {
2427
}
2528
}
2629

30+
private fun handleDeepLink(
31+
intent: Intent,
32+
) {
33+
val deepLink = intent.extras?.getString("deepLink") ?: return
34+
35+
startActivity(Intent(Intent.ACTION_VIEW).apply {
36+
data = deepLink.toUri()
37+
})
38+
}
39+
2740
companion object {
2841
const val NOTIFICATION_REQUEST_CODE = 0
2942
}

feature/main/src/main/java/com/plottwist/feature/main/ui/component/TukNavHost.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import com.plottwist.feature.proposal_create.navigation.navigateToCreateGatherin
3535
import com.plottwist.feature.proposal_create.navigation.navigateToCreateProposal
3636
import com.plottwist.feature.proposal_create.navigation.navigateToSelectGathering
3737
import com.plottwist.feature.proposal_create.navigation.selectGatheringNavGraph
38+
import com.plottwist.feature.proposal_detail.navigation.proposalDetailNavGraph
3839
import com.plottwist.feature.webview.navigation.navigateToWebView
3940
import com.plottwist.feature.webview.navigation.webViewNavGraph
4041
import com.plottwist.invite_gathering.navigation.inviteGatheringNavGraph
@@ -263,5 +264,10 @@ fun TukNavHost(
263264
navController.popBackStack()
264265
}
265266
)
267+
proposalDetailNavGraph(
268+
onBack = {
269+
navController.popBackStack()
270+
}
271+
)
266272
}
267273
}

feature/proposal-detail/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
plugins {
2+
alias(libs.plugins.tuk.android.library)
3+
alias(libs.plugins.tuk.feature)
4+
}
5+
6+
android {
7+
namespace = "com.plottwist.feature.proposal_detail"
8+
}
9+
10+
dependencies {
11+
implementation(project(":core:weburl"))
12+
13+
testImplementation(libs.junit)
14+
androidTestImplementation(libs.androidx.test.ext.junit)
15+
androidTestImplementation(libs.espresso.core)
16+
}

feature/proposal-detail/consumer-rules.pro

Whitespace-only changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile

0 commit comments

Comments
 (0)