diff --git a/core_settings.gradle b/core_settings.gradle index eb976e28cb..fee46b3778 100644 --- a/core_settings.gradle +++ b/core_settings.gradle @@ -52,6 +52,8 @@ include modulePrefix + 'lib-ui' project(modulePrefix + 'lib-ui').projectDir = new File(rootDir, 'libraries/ui') include modulePrefix + 'lib-ui-leanback' project(modulePrefix + 'lib-ui-leanback').projectDir = new File(rootDir, 'libraries/ui_leanback') +include modulePrefix + 'lib-ui-compose' +project(modulePrefix + 'lib-ui-compose').projectDir = new File(rootDir, 'libraries/ui_compose') include modulePrefix + 'lib-database' project(modulePrefix + 'lib-database').projectDir = new File(rootDir, 'libraries/database') diff --git a/libraries/ui_compose/README.md b/libraries/ui_compose/README.md new file mode 100644 index 0000000000..bf396fefc1 --- /dev/null +++ b/libraries/ui_compose/README.md @@ -0,0 +1,27 @@ +# UI module written using Jetpack Compose + +Provides UI-related functionality such as Composable functions and Compose State +classes. For example, the Surface for rendering media playback, UI state classes +for widgets, buttons, and other interactive components. + +## Getting the module + +The easiest way to use the module is to add it as a gradle dependency: + +```gradle +implementation 'androidx.media3:media3-ui-compose:1.X.X' +``` + +where `1.X.X` is the version, which must match the version of the other media +modules being used. + +Alternatively, you can clone this GitHub project and depend on the module +locally. Instructions for doing this can be found in the [top level README][]. + +[top level README]: ../../README.md + +## Links + +* [Javadoc][] + +[Javadoc]: https://developer.android.com/reference/androidx/media3/ui/compose/package-summary diff --git a/libraries/ui_compose/build.gradle b/libraries/ui_compose/build.gradle new file mode 100644 index 0000000000..3da97a6531 --- /dev/null +++ b/libraries/ui_compose/build.gradle @@ -0,0 +1,61 @@ +// Copyright (C) 2024 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +apply from: "$gradle.ext.androidxMediaSettingsDir/common_library_config.gradle" +apply plugin: 'kotlin-android' + +android { + namespace 'androidx.media3.ui.compose' + + buildTypes { + debug { + testCoverageEnabled = true + } + } + buildFeatures { + compose true + } + publishing { + singleVariant('release') { + withSourcesJar() + } + } + testOptions { + unitTests { + includeAndroidResources = true + } + } + + kotlinOptions { + jvmTarget = '1.8' + } + // https://developer.android.com/jetpack/androidx/releases/compose-kotlin#pre-release_kotlin_compatibility + composeOptions { + kotlinCompilerExtensionVersion = "1.5.3" + } +} + +dependencies { + api project(modulePrefix + 'lib-common') + api project(modulePrefix + 'lib-common-ktx') + + def composeBom = platform('androidx.compose:compose-bom:2024.01.00') + implementation composeBom +} + +ext { + releaseArtifactId = 'media3-ui-compose' + releaseName = 'Media3 UI Compose module' +} +apply from: '../../publish.gradle' diff --git a/libraries/ui_compose/src/main/AndroidManifest.xml b/libraries/ui_compose/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..314285ddc1 --- /dev/null +++ b/libraries/ui_compose/src/main/AndroidManifest.xml @@ -0,0 +1,18 @@ + + + + + diff --git a/libraries/ui_compose/src/test/AndroidManifest.xml b/libraries/ui_compose/src/test/AndroidManifest.xml new file mode 100644 index 0000000000..cbe925f2c1 --- /dev/null +++ b/libraries/ui_compose/src/test/AndroidManifest.xml @@ -0,0 +1,19 @@ + + + + + +