Skip to content

Commit

Permalink
Merge pull request #45 from Divinelink/feature/modules
Browse files Browse the repository at this point in the history
Multi-Module
  • Loading branch information
Divinelink authored May 27, 2024
2 parents 305fb8c + 5a89512 commit 79b2be8
Show file tree
Hide file tree
Showing 235 changed files with 1,279 additions and 1,220 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/distribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ jobs:
java-version: 17
distribution: 'adopt'

- name: Auth token to local.properties
env:
TMDB_AUTH_TOKEN: ${{ secrets.TMDB_AUTH_TOKEN }}
run: echo "TMDB_AUTH_TOKEN=${TMDB_AUTH_TOKEN}" >> local.properties

- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Build APK
Expand Down
12 changes: 10 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,24 @@ android {
checkReleaseBuilds = false
abortOnError = false
}

buildFeatures {
buildConfig = true
}
}

secrets {
defaultPropertiesFileName = "secrets.defaults.properties"
}

dependencies {
implementation(project(":core-util"))
implementation(projects.coreUtil)

implementation(projects.core.data)
implementation(projects.core.database)
implementation(projects.core.designsystem)
implementation(projects.core.model)
implementation(projects.core.network)

implementation(libs.android.tools.desugar)

Expand Down Expand Up @@ -154,7 +162,7 @@ dependencies {
implementation(libs.datastore.preferences)
implementation(libs.datastore.preferences.core)
implementation(libs.encrypted.preferences)
implementation(libs.room.ktx)
implementation(libs.room.ktx) // TODO Remove room deps and add di for database
implementation(libs.room.runtime)
ksp(libs.room.compiler)

Expand Down

This file was deleted.

This file was deleted.

5 changes: 2 additions & 3 deletions app/src/main/java/com/andreolas/movierama/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import com.andreolas.core.designsystem.theme.AppTheme
import com.andreolas.core.designsystem.theme.Theme
import com.andreolas.movierama.destinations.HomeScreenDestination
import com.andreolas.movierama.home.ui.HomeScreen
import com.andreolas.movierama.home.ui.LoadingContent
import com.andreolas.movierama.ui.components.snackbar.controller.ProvideSnackbarController
import com.divinelink.core.designsystem.theme.AppTheme
import com.divinelink.core.designsystem.theme.Theme
import com.google.accompanist.navigation.material.ExperimentalMaterialNavigationApi
import com.ramcosta.composedestinations.DestinationsNavHost
import com.ramcosta.composedestinations.animations.defaults.RootNavGraphDefaultAnimations
Expand Down Expand Up @@ -66,7 +66,6 @@ class MainActivity : AppCompatActivity() {
MainViewState.Loading -> {
LoadingContent()
}
is MainViewState.Error -> viewModel.retryFetchRemoteConfig()
}
}
}
Expand Down
11 changes: 5 additions & 6 deletions app/src/main/java/com/andreolas/movierama/MainViewModel.kt
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
package com.andreolas.movierama

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.andreolas.movierama.base.data.remote.firebase.usecase.SetRemoteConfigUseCase
import com.andreolas.movierama.ui.ThemedActivityDelegate
import com.andreolas.movierama.ui.UIText
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.launch
import javax.inject.Inject

@HiltViewModel
class MainViewModel @Inject constructor(
themedActivityDelegate: ThemedActivityDelegate,
private val setRemoteConfigUseCase: SetRemoteConfigUseCase,
) : ViewModel(), ThemedActivityDelegate by themedActivityDelegate {

private val _viewState: MutableStateFlow<MainViewState> = MutableStateFlow(MainViewState.Loading)
private val _viewState: MutableStateFlow<MainViewState> =
MutableStateFlow(MainViewState.Completed)
val viewState: StateFlow<MainViewState> = _viewState

/**
* Activate remote config once Main Activity starts.
* This is crucial since we can fetch data from remote config and then update our UI
* once we're ready.
*/

/**
init {
setRemoteConfig()
}
Expand All @@ -47,4 +45,5 @@ class MainViewModel @Inject constructor(
}
}
}
*/
}
7 changes: 0 additions & 7 deletions app/src/main/java/com/andreolas/movierama/MainViewState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ sealed class MainViewState(
isLoading = true,
)

data class Error(
override val error: UIText? = null,
) : MainViewState(
isLoading = false,
error = error,
)

data object Completed : MainViewState(
isLoading = false,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.andreolas.movierama.base.communication
package com.andreolas.movierama.base

import com.andreolas.movierama.BuildConfig

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 79b2be8

Please sign in to comment.