Skip to content

Commit

Permalink
Remove all codes for firebase remoteconfig and performance (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
fornewid authored Nov 3, 2024
1 parent ff90578 commit b8653ef
Show file tree
Hide file tree
Showing 18 changed files with 1 addition and 367 deletions.
3 changes: 0 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ plugins {
id "moop.android.compose"
id "moop.android.hilt"
alias libs.plugins.firebase.crashlytics
alias libs.plugins.firebase.performance
alias libs.plugins.dependencyGuard
alias(libs.plugins.baselineprofile)
}
Expand Down Expand Up @@ -121,8 +120,6 @@ dependencies {
implementation platform(libs.firebase.bom)
implementation libs.firebase.cloudmessaging
implementation libs.firebase.crashlytics
implementation libs.firebase.performance
implementation libs.firebase.remoteconfig

implementation libs.androidx.activity.compose
implementation libs.androidx.hilt.navigation.compose
Expand Down
7 changes: 1 addition & 6 deletions app/dependencies/releaseRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,12 @@ com.google.dagger:dagger:2.52
com.google.dagger:hilt-android:2.52
com.google.dagger:hilt-core:2.52
com.google.errorprone:error_prone_annotations:2.26.0
com.google.firebase:firebase-abt:21.1.1
com.google.firebase:firebase-annotations:16.2.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
com.google.firebase:firebase-components:18.0.0
com.google.firebase:firebase-config-interop:16.0.1
com.google.firebase:firebase-config:22.0.0
com.google.firebase:firebase-config-interop:16.0.0
com.google.firebase:firebase-crashlytics:19.0.0
com.google.firebase:firebase-datatransport:18.2.0
com.google.firebase:firebase-encoders-json:18.0.1
Expand All @@ -158,11 +156,8 @@ com.google.firebase:firebase-installations-interop:17.1.1
com.google.firebase:firebase-installations:18.0.0
com.google.firebase:firebase-measurement-connector:19.0.0
com.google.firebase:firebase-messaging:24.0.0
com.google.firebase:firebase-perf:21.0.0
com.google.firebase:firebase-sessions:2.0.0
com.google.firebase:protolite-well-known-types:18.0.0
com.google.guava:listenablefuture:1.0
com.google.protobuf:protobuf-javalite:3.21.11
com.jakewharton.timber:timber:5.0.1
com.squareup.okhttp3:okhttp:4.12.0
com.squareup.okio:okio-jvm:3.8.0
Expand Down
21 changes: 0 additions & 21 deletions app/src/main/java/soup/movie/config/Config.kt

This file was deleted.

43 changes: 0 additions & 43 deletions app/src/main/java/soup/movie/config/RemoteConfig.kt

This file was deleted.

20 changes: 0 additions & 20 deletions app/src/main/java/soup/movie/ui/main/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,14 @@ import androidx.activity.compose.setContent
import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.WindowCompat
import com.google.firebase.messaging.FirebaseMessaging
import dagger.hilt.android.AndroidEntryPoint
import soup.movie.R
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.tasks.RecommendMoviesTasks
import javax.inject.Inject

@AndroidEntryPoint
class MainActivity : AppCompatActivity() {

@Inject
lateinit var recommendMoviesTasks: RecommendMoviesTasks

private val viewModel: MainViewModel by viewModels()

override fun onCreate(savedInstanceState: Bundle?) {
Expand All @@ -45,23 +37,11 @@ class MainActivity : AppCompatActivity() {
setContent {
MovieTheme {
MainNavGraph(
mainViewModel = viewModel,
widthSizeClass = calculateWindowSizeClass(this).widthSizeClass,
)
}
}

// TODO: Improve this please
FirebaseMessaging.getInstance().isAutoInitEnabled = true

val config: Config = RemoteConfig()
config.fetchAndActivate {
if (config.allowToRunLegacyWorker) {
recommendMoviesTasks.fetch()
} else {
recommendMoviesTasks.cancel()
}
}
viewModel.onInit()
}
}
12 changes: 0 additions & 12 deletions app/src/main/java/soup/movie/ui/main/MainNavGraph.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package soup.movie.ui.main

import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.navigation.NavController
import androidx.navigation.compose.NavHost
Expand All @@ -43,7 +42,6 @@ private fun NavController.navigateToDetail(movieId: String) {

@Composable
fun MainNavGraph(
mainViewModel: MainViewModel,
widthSizeClass: WindowWidthSizeClass,
) {
val navController = rememberNavController()
Expand Down Expand Up @@ -84,14 +82,4 @@ fun MainNavGraph(
)
}
}

LaunchedEffect(Unit) {
mainViewModel.uiEvent.collect { event ->
when (event) {
is MainUiEvent.ShowDetailUiEvent -> {
navController.navigateToDetail(movieId = event.movieId)
}
}
}
}
}
23 changes: 0 additions & 23 deletions app/src/main/java/soup/movie/ui/main/MainUiEvent.kt

This file was deleted.

12 changes: 0 additions & 12 deletions app/src/main/java/soup/movie/ui/main/MainViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ package soup.movie.ui.main
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.coroutines.launch
import soup.movie.feature.tasks.AnnounceOpenDateTasks
import soup.movie.feature.tasks.SyncOpenDateTasks
Expand All @@ -32,19 +29,10 @@ class MainViewModel @Inject constructor(
private val syncOpenDateTasks: SyncOpenDateTasks,
) : ViewModel() {

private val _uiEvent = MutableSharedFlow<MainUiEvent>()
val uiEvent: SharedFlow<MainUiEvent> = _uiEvent.asSharedFlow()

fun onInit() {
viewModelScope.launch {
announceOpenDateTasks.fetch()
syncOpenDateTasks.fetch()
}
}

fun requestMovie(movieId: String) {
viewModelScope.launch {
_uiEvent.emit(MainUiEvent.ShowDetailUiEvent(movieId))
}
}
}
7 changes: 0 additions & 7 deletions app/src/main/res/xml/remote_config_defaults.xml

This file was deleted.

1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ plugins {
alias(libs.plugins.ksp) apply false
alias(libs.plugins.dependencyGuard) apply false
alias(libs.plugins.firebase.crashlytics) apply false
alias(libs.plugins.firebase.performance) apply false
alias(libs.plugins.baselineprofile) apply false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@
*/
package soup.movie.feature.notification

import soup.movie.model.MovieModel
import soup.movie.model.OpenDateAlarmModel

interface NotificationBuilder {

fun showLegacyNotification(list: List<MovieModel>)
fun showAlarmNotification(list: List<OpenDateAlarmModel>)
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import dagger.hilt.android.qualifiers.ApplicationContext
import soup.movie.feature.navigator.AppNavigator
import soup.movie.feature.navigator.Destination
import soup.movie.feature.notification.NotificationBuilder
import soup.movie.model.MovieModel
import soup.movie.model.OpenDateAlarmModel
import soup.movie.resources.R
import javax.inject.Inject
Expand All @@ -35,17 +34,6 @@ class NotificationBuilderImpl @Inject constructor(
private val navigator: AppNavigator,
) : NotificationBuilder {

override fun showLegacyNotification(list: List<MovieModel>) = context.run {
NotificationSpecs.notifyLegacy(this) {
setStyle(NotificationCompat.BigTextStyle())
setSmallIcon(R.drawable.ic_notify_default)
setContentTitle(buildSpannedString { bold { append("간만에 영화 보는거 어때요? 👀🍿") } })
setContentText(list.joinToString { it.title })
setAutoCancel(true)
setContentIntent(createLauncherIntent())
}
}

override fun showAlarmNotification(list: List<OpenDateAlarmModel>) = context.run {
NotificationSpecs.notifyOpenDateAlarm(this) {
setStyle(NotificationCompat.BigTextStyle())
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit b8653ef

Please sign in to comment.