Skip to content

Commit

Permalink
Remove all codes for deeplink (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
fornewid authored Oct 27, 2024
1 parent b6336a6 commit 795eca8
Show file tree
Hide file tree
Showing 18 changed files with 0 additions and 219 deletions.
2 changes: 0 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ dependencies {
runtimeOnly projects.feature.notification.impl
implementation projects.feature.tasks.api
runtimeOnly projects.feature.tasks.impl
implementation projects.feature.deeplink
runtimeOnly projects.data.network.impl
runtimeOnly projects.data.database.impl
runtimeOnly projects.data.repository.impl
Expand All @@ -126,7 +125,6 @@ dependencies {
implementation platform(libs.firebase.bom)
implementation libs.firebase.cloudmessaging
implementation libs.firebase.crashlytics
implementation libs.firebase.dynamiclinks
implementation libs.firebase.performance
implementation libs.firebase.remoteconfig

Expand Down
2 changes: 0 additions & 2 deletions app/dependencies/releaseRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ com.google.errorprone:error_prone_annotations:2.26.0
com.google.firebase:firebase-abt:21.1.1
com.google.firebase:firebase-analytics:22.0.0
com.google.firebase:firebase-annotations:16.2.0
com.google.firebase:firebase-auth-interop:20.0.0
com.google.firebase:firebase-bom:33.0.0
com.google.firebase:firebase-common-ktx:21.0.0
com.google.firebase:firebase-common:21.0.0
Expand All @@ -167,7 +166,6 @@ com.google.firebase:firebase-config-interop:16.0.1
com.google.firebase:firebase-config:22.0.0
com.google.firebase:firebase-crashlytics:19.0.0
com.google.firebase:firebase-datatransport:18.2.0
com.google.firebase:firebase-dynamic-links:22.0.0
com.google.firebase:firebase-encoders-json:18.0.1
com.google.firebase:firebase-encoders-proto:16.0.0
com.google.firebase:firebase-encoders:17.0.0
Expand Down
13 changes: 0 additions & 13 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,6 @@

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="moop.link"
android:scheme="https" />
<data
android:host="movie"
android:scheme="moop" />
</intent-filter>
</activity>

<provider
Expand Down
17 changes: 0 additions & 17 deletions app/src/main/java/soup/movie/ui/main/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package soup.movie.ui.main

import android.content.Intent
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.activity.viewModels
Expand All @@ -28,7 +27,6 @@ import soup.movie.config.Config
import soup.movie.config.RemoteConfig
import soup.movie.core.designsystem.theme.MovieTheme
import soup.movie.core.designsystem.windowsizeclass.calculateWindowSizeClass
import soup.movie.feature.deeplink.FirebaseLink
import soup.movie.feature.tasks.RecommendMoviesTasks
import javax.inject.Inject

Expand Down Expand Up @@ -56,8 +54,6 @@ class MainActivity : AppCompatActivity() {
// TODO: Improve this please
FirebaseMessaging.getInstance().isAutoInitEnabled = true

handleDeepLink(intent)

val config: Config = RemoteConfig()
config.fetchAndActivate {
if (config.allowToRunLegacyWorker) {
Expand All @@ -68,17 +64,4 @@ class MainActivity : AppCompatActivity() {
}
viewModel.onInit()
}

override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
handleDeepLink(intent)
}

private fun handleDeepLink(intent: Intent) {
FirebaseLink.extractMovieId(intent) { movieId ->
if (movieId != null) {
viewModel.requestMovie(movieId)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import androidx.compose.material.icons.rounded.Map
import androidx.compose.material.icons.rounded.Palette
import androidx.compose.material.icons.rounded.Search
import androidx.compose.material.icons.rounded.Settings
import androidx.compose.material.icons.rounded.Share
import androidx.compose.material.icons.rounded.Star
import androidx.compose.material.icons.rounded.ViewModule
import soup.movie.core.designsystem.R
Expand All @@ -51,7 +50,6 @@ object MovieIcons {
val PrivacyTip = Icons.Outlined.PrivacyTip
val Search = Icons.Rounded.Search
val Settings = Icons.Rounded.Settings
val Share = Icons.Rounded.Share
val Star = Icons.Rounded.Star
val Subject = Icons.AutoMirrored.Rounded.Subject
val ViewModule = Icons.Rounded.ViewModule
Expand Down
2 changes: 0 additions & 2 deletions core/resources/src/main/res/values-ko/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
<string name="filter_category_age">연령 필터</string>
<string name="filter_category_genre">장르 필터</string>

<string name="action_share">공유하기</string>
<string name="action_share_failed">공유하기가 실패했어요.</string>
<string name="action_toast_opendate_alarm">⏰ 영화가 개봉할 때, 알려드릴게요.</string>

<string name="time_minute">%d분</string>
Expand Down
2 changes: 0 additions & 2 deletions core/resources/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
<string name="filter_category_age">Age Filter</string>
<string name="filter_category_genre">Genre Filter</string>

<string name="action_share">Share</string>
<string name="action_share_failed">Failed to share movie.</string>
<string name="action_toast_opendate_alarm">⏰ I\'ll let you know when released.</string>

<string name="time_minute">%d min.</string>
Expand Down
1 change: 0 additions & 1 deletion feature/deeplink/.gitignore

This file was deleted.

16 changes: 0 additions & 16 deletions feature/deeplink/build.gradle

This file was deleted.

1 change: 0 additions & 1 deletion feature/deeplink/src/main/AndroidManifest.xml

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion feature/detail/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ dependencies {
implementation projects.data.repository.api
implementation projects.data.model
implementation projects.domain
implementation projects.feature.deeplink
implementation projects.feature.home

implementation libs.kotlin.stdlib
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ internal fun DetailContent(
viewModel: DetailViewModel,
uiModel: DetailUiModel,
onPosterClick: () -> Unit,
onShareClick: () -> Unit,
onItemClick: (ContentItemUiModel) -> Unit,
modifier: Modifier = Modifier,
) {
Expand All @@ -53,11 +52,6 @@ internal fun DetailContent(
viewModel.onFavoriteButtonClick(isFavorite)
},
)
ShareButton(
onClick = {
onShareClick()
},
)
},
)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
Expand Down Expand Up @@ -287,18 +286,3 @@ internal fun FavoriteButton(
)
}
}

@Composable
internal fun ShareButton(
onClick: () -> Unit,
) {
IconButton(onClick = onClick) {
Image(
MovieIcons.Share,
contentDescription = null,
modifier = Modifier.requiredSize(48.dp),
contentScale = ContentScale.Inside,
colorFilter = ColorFilter.tint(color = MovieTheme.colors.onBackground),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package soup.movie.feature.detail

import android.content.Context
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
Expand All @@ -28,11 +27,7 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.platform.LocalContext
import androidx.core.app.ShareCompat
import soup.movie.core.designsystem.showToast
import soup.movie.feature.deeplink.FirebaseLink
import soup.movie.model.MovieModel
import soup.movie.resources.R

@Composable
fun DetailNavGraph(
Expand All @@ -46,13 +41,6 @@ fun DetailNavGraph(
DetailScreen(
viewModel = viewModel,
uiModel = uiModel,
onShareClick = {
if (movie != null) {
context.shareText(movie)
} else {
context.showToast(R.string.action_share_failed)
}
},
onPosterClick = {
showPoster = true
},
Expand All @@ -79,37 +67,3 @@ fun DetailNavGraph(
}
}
}

private fun Context.shareText(movie: MovieModel) {
FirebaseLink.createDetailLink(
movieId = movie.id,
imageUrl = movie.posterUrl,
title = movie.title,
description = buildString {
if (movie.isNow) {
append("현재상영중")
} else {
append("${movie.openDate}개봉")
}
val ageLabel = getString(
when {
movie.age >= 19 -> R.string.movie_age_19
movie.age >= 15 -> R.string.movie_age_15
movie.age >= 12 -> R.string.movie_age_12
movie.age >= 0 -> R.string.movie_age_all
else -> R.string.movie_age_unknown
},
)
append(" / $ageLabel")
movie.genres?.let { genres ->
append(" / ${genres.joinToString()}")
}
},
) { link ->
ShareCompat.IntentBuilder(this)
.setChooserTitle(R.string.action_share)
.setText("[뭅] ${movie.title}\n$link")
.setType("text/plain")
.startChooser()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import soup.movie.resources.R
internal fun DetailScreen(
viewModel: DetailViewModel,
uiModel: DetailUiModel,
onShareClick: () -> Unit,
onPosterClick: () -> Unit,
) {
var showPrivacyDialog by remember { mutableStateOf(false) }
Expand All @@ -57,10 +56,6 @@ internal fun DetailScreen(
viewModel.clickPoster()
onPosterClick()
},
onShareClick = {
viewModel.clickShare()
onShareClick()
},
onItemClick = { item ->
when (item) {
is BoxOfficeItemUiModel -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,6 @@ class DetailViewModel @Inject constructor(
analytics.clickPoster()
}

fun clickShare() {
analytics.clickShare()
}

fun clickTrailer() {
analytics.clickTrailer()
}
Expand Down
1 change: 0 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ firebase-bom = { module = "com.google.firebase:firebase-bom", version.ref = "fir
firebase-analytics = { module = "com.google.firebase:firebase-analytics" }
firebase-cloudmessaging = { module = "com.google.firebase:firebase-messaging" }
firebase-crashlytics = { module = "com.google.firebase:firebase-crashlytics" }
firebase-dynamiclinks = { module = "com.google.firebase:firebase-dynamic-links" }
firebase-performance = { module = "com.google.firebase:firebase-perf" }
firebase-remoteconfig = { module = "com.google.firebase:firebase-config" }

Expand Down

0 comments on commit 795eca8

Please sign in to comment.