Skip to content

Commit e46e3b5

Browse files
committed
[FEATURE]#60 : WebLink 링크 모음 및 웹 링크 전환 구현
1 parent 1c9b297 commit e46e3b5

File tree

4 files changed

+57
-1
lines changed

4 files changed

+57
-1
lines changed

app/src/main/kotlin/com/bff/wespot/NavigatorImpl.kt

+10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import android.content.Intent
66
import android.net.Uri
77
import com.bff.wespot.auth.AuthActivity
88
import com.bff.wespot.navigation.Navigator
9+
import com.bff.wespot.navigation.util.WebLink
910
import com.bff.wespot.navigation.util.buildIntent
1011
import timber.log.Timber
1112
import javax.inject.Inject
@@ -96,6 +97,15 @@ class NavigatorImpl @Inject constructor() : Navigator {
9697
return intent
9798
}
9899

100+
override fun navigateToWebLink(context: Context, webLink: WebLink) {
101+
val webLinkIntent = Intent(
102+
Intent.ACTION_VIEW,
103+
Uri.parse(context.getString(webLink.url)),
104+
)
105+
webLinkIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
106+
context.startActivity(webLinkIntent)
107+
}
108+
99109
private fun redirectToPlayStoreForInstagram(context: Context) {
100110
val appStoreIntent = Intent(
101111
Intent.ACTION_VIEW,

core/navigation/src/main/kotlin/com/bff/wespot/navigation/Navigator.kt

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package com.bff.wespot.navigation
33
import android.content.Context
44
import android.content.Intent
55
import android.net.Uri
6+
import com.bff.wespot.navigation.util.WebLink
67

78
interface Navigator {
89
fun navigateToMain(
@@ -20,4 +21,6 @@ interface Navigator {
2021
): Intent
2122

2223
fun navigateToSharing(context: Context)
23-
}
24+
25+
fun navigateToWebLink(context: Context, webLink: WebLink)
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.bff.wespot.navigation.util
2+
3+
import com.bff.wespot.navigation.R
4+
5+
enum class WebLink {
6+
PLAY_STORE,
7+
VOTE_QUESTION_GOOGLE_FORM,
8+
WESPOT_KAKAKO_CHANNEL,
9+
WESPOT_INSTARGRAM,
10+
USER_OPINION_GOOGLE_FORM,
11+
RESEARCH_PARTICIPATION_GOOGLE_FORM,
12+
WESPOT_MAKERS,
13+
PROFILE_CHANGE_GOOGLE_FROM,
14+
PRIVACY_POLICY,
15+
TERMS_OF_SERVICE;
16+
17+
val url
18+
get() = when (this) {
19+
PLAY_STORE -> R.string.play_store_url
20+
VOTE_QUESTION_GOOGLE_FORM -> R.string.vote_question_google_form_url
21+
WESPOT_KAKAKO_CHANNEL -> R.string.wespot_kakao_channel_url
22+
WESPOT_INSTARGRAM -> R.string.wespot_instagram_url
23+
USER_OPINION_GOOGLE_FORM -> R.string.user_opinion_google_form_url
24+
RESEARCH_PARTICIPATION_GOOGLE_FORM -> R.string.research_participation_google_form_url
25+
WESPOT_MAKERS -> R.string.wespot_makers_url
26+
PROFILE_CHANGE_GOOGLE_FROM -> R.string.profile_change_google_form_url
27+
PRIVACY_POLICY -> R.string.privacy_policy_url
28+
TERMS_OF_SERVICE -> R.string.terms_of_service_url
29+
}
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="vote_question_google_form_url">https://forms.gle/eiKdpjmwdxzvqm947</string>
4+
<string name="wespot_kakao_channel_url">http://pf.kakao.com/_SEDcG</string>
5+
<string name="wespot_instagram_url">https://www.instagram.com/wespot.official/</string>
6+
<string name="user_opinion_google_form_url">https://forms.gle/BZbC5wpuMt9mynUG6</string>
7+
<string name="research_participation_google_form_url">https://docs.google.com/forms/d/e/1FAIpQLSfkN2b752gRKtFRk9IUreFRacNXnj5jh4tlHWKp0n51IaObyw/viewform?usp=sf_link</string>
8+
<string name="wespot_makers_url">https://www.notion.so/WeSpot-Makers-87e988ab3c9e47f28c141ad1aa663b80?pvs=4</string>
9+
<string name="profile_change_google_form_url">https://docs.google.com/forms/d/e/1FAIpQLSdFlTCYbGL4QDYJlzt8jeeeA-E3ITWIBeYS2B5cAZs2j8wosQ/viewform?usp=sf_link</string>
10+
<string name="privacy_policy_url">https://www.notion.so/2fa1c3002e14460f91462204b0daefbf?pvs=4</string>
11+
<string name="play_store_url">https://play.google.com/store/apps</string>
12+
<string name="terms_of_service_url">https://www.notion.so/yapp-workspace/0826c1435e0b4eba95ce62beb0aea425</string>
13+
</resources>

0 commit comments

Comments
 (0)