Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to AndroidX Core 1.15.0 #783

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
internal object AppConfig {
internal const val minSdk = 21
internal const val targetSdk = 34
internal const val compileSdk = 34
internal const val compileSdk = 35

internal const val javaVersionName = "17"
internal val javaVersion = JavaVersion.valueOf("VERSION_$javaVersionName")
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ androidx-activity = "1.9.3"
androidx-annotation = "1.9.1"
androidx-compose = "2024.10.01"
androidx-compose-material-navigation = "1.7.0-beta01" # TODO Remove this once https://issuetracker.google.com/issues/347719428 is resolved
androidx-core = "1.13.1"
androidx-core = "1.15.0"
androidx-datastore = "1.1.1"
androidx-fragment = "1.8.5"
androidx-lifecycle = "2.8.7"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ import java.util.concurrent.atomic.AtomicBoolean
/**
* ComScore for SRG SSR
*
* Initialize ComScore before using page view by calling [ComScoreSrg.init] in your Application.create
* Initialize ComScore before using page view by calling [ComScoreSrg.init] in your [Application.onCreate].
*
* SRGSSR doc : https://confluence.srg.beecollaboration.com/pages/viewpage.action?pageId=13188965
* SRGSSR doc: https://confluence.srg.beecollaboration.com/pages/viewpage.action?pageId=13188965
*/
internal object ComScoreSrg : ComScore, Application.ActivityLifecycleCallbacks {
private var config: AnalyticsConfig? = null
private const val publisherId = "6036016"
private val started = AtomicBoolean(false)

/**
* Init ComScore if [context] is an [Activity] we init ComScpre directly otherwise we start it when an [Activity] as been created.
* Init ComScore if [context] is an [Activity] we init ComScore directly otherwise we start it when an [Activity] as been created.
*
* @param config Common analytics configuration
* @param context Context context
Expand All @@ -54,6 +54,7 @@ internal object ComScoreSrg : ComScore, Application.ActivityLifecycleCallbacks {
val versionName: String = applicationContext.packageManager
.getPackageInfo(applicationContext.packageName, 0)
.versionName
.orEmpty()
persistentLabels[ComScoreLabel.MP_V.label] = versionName
persistentLabels[ComScoreLabel.MP_BRAND.label] = config.vendor.toString()
val publisher = PublisherConfiguration.Builder()
Expand All @@ -80,7 +81,7 @@ internal object ComScoreSrg : ComScore, Application.ActivityLifecycleCallbacks {
internal fun start(appContext: Context) {
if (!started.getAndSet(true)) {
checkInitialized()
Log.i("COMSCORE", "Start Comscore for SRG")
Log.i("COMSCORE", "Start ComScore for SRG")
Analytics.start(appContext)
}
}
Expand Down
6 changes: 4 additions & 2 deletions pillarbox-demo-cast/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) SRG SSR. All rights reserved.
* License information is available from the LICENSE file.
*/
plugins {
alias(libs.plugins.pillarbox.android.application)
}
Expand All @@ -13,12 +17,10 @@ dependencies {
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.runtime)
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.graphics)
implementation(libs.androidx.compose.ui.text)
debugImplementation(libs.androidx.compose.ui.tooling)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.compose.ui.unit)
implementation(libs.androidx.core)
implementation(libs.androidx.fragment)
implementation(libs.kotlin.stdlib)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,12 @@
*/
package ch.srgssr.pillarbox.demo.cast.ui.theme

import android.app.Activity
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.SideEffect
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalView
import androidx.core.view.WindowCompat
import ch.srgssr.pillarbox.demo.shared.ui.theme.md_theme_dark_background
import ch.srgssr.pillarbox.demo.shared.ui.theme.md_theme_dark_error
import ch.srgssr.pillarbox.demo.shared.ui.theme.md_theme_dark_errorContainer
Expand Down Expand Up @@ -157,15 +152,6 @@ fun PillarboxTheme(
lightColorScheme
}

val view = LocalView.current
if (!view.isInEditMode) {
SideEffect {
val window = (view.context as Activity).window
window.statusBarColor = colorScheme.primary.toArgb()
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme
}
}

MaterialTheme(colorScheme = colorScheme) {
CompositionLocalProvider(LocalPaddings provides paddings) {
content()
Expand Down
Loading