Skip to content

Commit

Permalink
Integrate Ceres Core Foundation Composition Provider
Browse files Browse the repository at this point in the history
- Integrated the Composition Provider from the `ceres:core:foundation` module.
- Replaced the usage of `audioManagerUtils` and `mediaPlayerUtils` with Composition Providers.
- Updated the code to use the provided Composition Providers for AudioManager and MediaPlayer utilities.
  • Loading branch information
teogor committed Oct 1, 2023
1 parent ad36844 commit c423548
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions framework/core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ android {
}

dependencies {
api(project(":core:foundation"))
api(project(":core:network"))
api(project(":core:runtime"))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package dev.teogor.ceres.framework.core

import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Bundle
Expand All @@ -37,6 +38,10 @@ import androidx.compose.runtime.setValue
import androidx.core.splashscreen.SplashScreen
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.metrics.performance.JankStats
import dev.teogor.ceres.core.foundation.audioManagerUtils
import dev.teogor.ceres.core.foundation.compositions.LocalAudioManager
import dev.teogor.ceres.core.foundation.compositions.LocalMediaPlayer
import dev.teogor.ceres.core.foundation.mediaPlayerUtils
import dev.teogor.ceres.core.network.NetworkMonitor
import dev.teogor.ceres.data.compose.rememberPreference
import dev.teogor.ceres.data.datastore.defaults.AppTheme
Expand Down Expand Up @@ -103,6 +108,10 @@ open class Activity : ComponentActivity() {

handleSplashScreen(splashScreen)

val context = this as Context
val audioManagerUtils = context.audioManagerUtils()
val mediaPlayerUtils = context.mediaPlayerUtils()

setContent {
val darkTheme = isSystemInDarkTheme()

Expand Down Expand Up @@ -195,6 +204,10 @@ open class Activity : ComponentActivity() {
LocalNavigationParameters provides navigationParameters,
LocalAnalyticsHelper provides analyticsHelper,
LocalCrashlyticsHelper provides crashlyticsHelper,

// Ceres Core Foundation - Composition Provider
LocalAudioManager provides audioManagerUtils,
LocalMediaPlayer provides mediaPlayerUtils,
) {
val menuConfig = MenuConfig().apply { buildMenu() }
val menuConfigHeader =
Expand Down

0 comments on commit c423548

Please sign in to comment.