Skip to content

Commit

Permalink
Merge pull request #22 from THEOplayer/update-dependencies
Browse files Browse the repository at this point in the history
Update to latest version of Jetpack Compose
  • Loading branch information
MattiasBuelens authored Nov 27, 2023
2 parents cd77edf + ef51a33 commit 84bb247
Show file tree
Hide file tree
Showing 25 changed files with 189 additions and 117 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
## Unreleased

* 💥 Updated to Jetpack Compose version 1.5.4 ([BOM](https://developer.android.com/jetpack/compose/bom) 2023.10.01).
* 💅 Renamed project to "THEOplayer Open Video UI for Android".

## v1.3.4 (2023-10-17)
Expand Down
40 changes: 19 additions & 21 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
}

android {
namespace = "com.theoplayer.android.ui.demo"
compileSdk = 33
compileSdk = 34

defaultConfig {
applicationId = "com.theoplayer.android.ui.demo"
Expand Down Expand Up @@ -55,28 +55,26 @@ android {
}

dependencies {
val compose_ui_version: String by rootProject.extra
val material3_version: String by rootProject.extra
val theoplayer_version: String by rootProject.extra
implementation(platform(libs.androidx.compose.bom))

implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.0")
implementation("androidx.activity:activity-compose:1.6.1")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.compose.ui:ui:$compose_ui_version")
implementation("androidx.compose.ui:ui-tooling-preview:$compose_ui_version")
implementation("androidx.compose.material3:material3:$material3_version")
implementation("androidx.compose.material:material-icons-extended:1.3.1")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:$compose_ui_version")
debugImplementation("androidx.compose.ui:ui-tooling:$compose_ui_version")
debugImplementation("androidx.compose.ui:ui-test-manifest:$compose_ui_version")
implementation(libs.androidx.ktx)
implementation(libs.androidx.lifecycle.runtime)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.compose.ui.ui)
implementation(libs.androidx.compose.ui.toolingPreview)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.material.iconsExtended)
testImplementation(libs.junit4)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso)
androidTestImplementation(libs.androidx.compose.ui.testJunit4)
debugImplementation(libs.androidx.compose.ui.tooling)
debugImplementation(libs.androidx.compose.ui.testManifest)

debugImplementation(project(":ui"))
releaseImplementation(project(":ui"))
"mavenImplementation"("com.theoplayer.android-ui:android-ui:1.+")

implementation("com.theoplayer.theoplayer-sdk-android:core:$theoplayer_version")
implementation(libs.theoplayer)
}
17 changes: 6 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,13 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.4.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10")
classpath(libs.gradle.plugin)
classpath(libs.kotlin.gradle.plugin)
}
val compose_ui_version by extra("1.3.3")
val material3_version by extra("1.0.1")
val theoplayer_version by extra("6.1.0")
val dokka_version by extra("1.8.10")
}
plugins {
val dokka_version: String by extra
id("com.android.application") version "7.4.2" apply false
id("com.android.library") version "7.4.2" apply false
id("org.jetbrains.kotlin.android") version "1.8.10" apply false
id("org.jetbrains.dokka") version dokka_version apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.dokka) apply false
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ kotlin.code.style=official
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.defaults.buildfeatures.buildconfig=true
android.nonFinalResIds=false
# The version of the THEOplayer Open Video UI for Android.
libraryVersion=1.3.4
42 changes: 42 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[versions]
gradle = "8.1.4"
kotlin-gradle-plugin = "1.8.10"
ktx = "1.12.0"
lifecycle-runtime = "2.6.2"
activity-compose = "1.8.1"
appcompat = "1.6.1"
compose-bom = "2023.10.01"
junit4 = "4.13.2"
androidx-junit = "1.1.5"
androidx-espresso = "3.5.1"
dokka = "1.8.10"
theoplayer = "6.4.0"

[libraries]
androidx-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "ktx" }
androidx-lifecycle-runtime = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycle-runtime" }
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activity-compose" }
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose-bom" }
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" }
androidx-compose-material-iconsExtended = { group = "androidx.compose.material", name = "material-icons-extended" }
androidx-compose-ui-ui = { group = "androidx.compose.ui", name = "ui" }
androidx-compose-ui-test = { group = "androidx.compose.ui", name = "ui-test-junit4" }
androidx-compose-ui-testJunit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
androidx-compose-ui-testManifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
androidx-compose-ui-toolingPreview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-junit" }
androidx-espresso = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "androidx-espresso" }
gradle-plugin = { group = "com.android.tools.build", name = "gradle", version.ref = "gradle" }
dokka-base = { group = "org.jetbrains.dokka", name = "dokka-base", version.ref = "dokka" }
dokka-plugin = { group = "org.jetbrains.dokka", name = "android-documentation-plugin", version.ref = "dokka" }
kotlin-gradle-plugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin-gradle-plugin" }
junit4 = { group = "junit", name = "junit", version.ref = "junit4" }
theoplayer = { group = "com.theoplayer.theoplayer-sdk-android", name = "core", version.ref = "theoplayer" }

[plugins]
android-application = { id = "com.android.application", version.ref = "gradle" }
android-library = { id = "com.android.library", version.ref = "gradle" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin-gradle-plugin" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Feb 27 14:59:36 CET 2023
#Mon Nov 20 16:01:06 CET 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
49 changes: 22 additions & 27 deletions ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,23 @@ import kotlin.text.Typography.copyright

buildscript {
dependencies {
classpath("org.jetbrains.dokka:dokka-base:1.8.10")
classpath(libs.dokka.base)
}
}

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("org.jetbrains.dokka")
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.dokka)
id("maven-publish")
}

android {
namespace = "com.theoplayer.android.ui"
compileSdk = 33
compileSdk = 34

defaultConfig {
minSdk = 24
targetSdk = 33

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down Expand Up @@ -66,34 +65,30 @@ android {
}

dependencies {
val compose_ui_version: String by rootProject.extra
val material3_version: String by rootProject.extra
val theoplayer_version: String by rootProject.extra
val dokka_version: String by rootProject.extra
implementation(platform(libs.androidx.compose.bom))

implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.0")
implementation("androidx.activity:activity-compose:1.6.1")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.compose.ui:ui:$compose_ui_version")
implementation("androidx.compose.ui:ui-tooling-preview:$compose_ui_version")
implementation("androidx.compose.material3:material3:$material3_version")
implementation("androidx.compose.material:material-icons-extended:1.3.1")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:$compose_ui_version")
debugImplementation("androidx.compose.ui:ui-tooling:$compose_ui_version")
debugImplementation("androidx.compose.ui:ui-test-manifest:$compose_ui_version")
implementation(libs.androidx.ktx)
implementation(libs.androidx.lifecycle.runtime)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.compose.ui.ui)
implementation(libs.androidx.compose.ui.toolingPreview)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.material.iconsExtended)
testImplementation(libs.junit4)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso)
androidTestImplementation(libs.androidx.compose.ui.testJunit4)
debugImplementation(libs.androidx.compose.ui.tooling)
debugImplementation(libs.androidx.compose.ui.testManifest)

implementation("com.theoplayer.theoplayer-sdk-android:core") {
implementation(libs.theoplayer) {
version {
strictly("[5.0, 7.0[")
prefer(theoplayer_version)
}
}

dokkaPlugin("org.jetbrains.dokka:android-documentation-plugin:$dokka_version")
dokkaPlugin(libs.dokka.plugin)
}

publishing {
Expand Down
5 changes: 1 addition & 4 deletions ui/src/main/java/com/theoplayer/android/ui/AudioTrackList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@ package com.theoplayer.android.ui

import androidx.compose.foundation.clickable
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ListItem
import androidx.compose.material3.RadioButton
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import java.util.*

/**
* A list of audio tracks, from which the user can choose an active audio track.
*
* @param modifier the [Modifier] to be applied to this menu
* @param onClick called when an audio track in the list is clicked
*/
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun AudioTrackList(
modifier: Modifier = Modifier,
Expand All @@ -32,7 +29,7 @@ fun AudioTrackList(
) {
val audioTrack = audioTracks[it]
ListItem(
headlineText = { Text(text = formatTrackLabel(audioTrack)) },
headlineContent = { Text(text = formatTrackLabel(audioTrack)) },
leadingContent = {
RadioButton(
selected = (activeAudioTrack == audioTrack),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
package com.theoplayer.android.ui

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.CastConnected
import androidx.compose.material3.ButtonDefaults
Expand Down
7 changes: 6 additions & 1 deletion ui/src/main/java/com/theoplayer/android/ui/ErrorDisplay.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
package com.theoplayer.android.ui

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.Error
import androidx.compose.material3.Icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ internal class FullscreenHandlerImpl(private val view: View) : FullscreenHandler
private set
override var onFullscreenChangeListener: FullscreenHandler.OnFullscreenChangeListener? = null

private var previousSystemBarsBehavior: Int =
WindowInsetsControllerCompat.BEHAVIOR_SHOW_BARS_BY_SWIPE
private var previousRequestedOrientation: Int =
ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
private var previousSystemBarsBehavior: Int = WindowInsetsControllerCompat.BEHAVIOR_DEFAULT
private var previousRequestedOrientation: Int = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
private var previousViewParent: ViewGroup? = null
private var previousViewIndex: Int = 0
private var previousViewLayoutParams: ViewGroup.LayoutParams? = null
Expand Down
2 changes: 1 addition & 1 deletion ui/src/main/java/com/theoplayer/android/ui/Helper.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.theoplayer.android.ui

import com.theoplayer.android.api.player.track.Track
import java.util.*
import java.util.Locale
import kotlin.math.absoluteValue

/**
Expand Down
6 changes: 5 additions & 1 deletion ui/src/main/java/com/theoplayer/android/ui/IconButton.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.foundation.layout.size
import androidx.compose.material3.*
import androidx.compose.material3.ButtonColors
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.IconButton
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
Expand Down
6 changes: 5 additions & 1 deletion ui/src/main/java/com/theoplayer/android/ui/LanguageMenu.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package com.theoplayer.android.ui

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.ChevronRight
import androidx.compose.material.icons.rounded.Close
Expand Down
6 changes: 5 additions & 1 deletion ui/src/main/java/com/theoplayer/android/ui/LiveButton.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.Circle
import androidx.compose.material3.*
import androidx.compose.material3.ButtonColors
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.Dp
import com.theoplayer.android.ui.theme.THEOplayerTheme
import kotlin.time.Duration
import kotlin.time.Duration.Companion.milliseconds
import kotlin.time.DurationUnit

/**
Expand Down
Loading

0 comments on commit 84bb247

Please sign in to comment.