[conflict] Merge "Rename SystemUIComposeCore to PlatformComposeCore (1/2)" into tm-qpr-dev am: 62a8398031
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20803453 Change-Id: I6bc476444ded867610b318bc04c0012d3ba77f09 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -60,7 +60,7 @@ systemui_compose_java_defaults {
|
||||
// except for SystemUI-core.
|
||||
// Copied from compose/features/Android.bp.
|
||||
static_libs: [
|
||||
"SystemUIComposeCore",
|
||||
"PlatformComposeCore",
|
||||
|
||||
"androidx.compose.runtime_runtime",
|
||||
"androidx.compose.material3_material3",
|
||||
|
||||
@@ -22,7 +22,7 @@ package {
|
||||
}
|
||||
|
||||
android_library {
|
||||
name: "SystemUIComposeCore",
|
||||
name: "PlatformComposeCore",
|
||||
manifest: "AndroidManifest.xml",
|
||||
|
||||
srcs: [
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
-->
|
||||
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.android.systemui.compose.core">
|
||||
package="com.android.compose.core">
|
||||
|
||||
|
||||
</manifest>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"presubmit": [
|
||||
{
|
||||
"name": "SystemUIComposeCoreTests",
|
||||
"name": "PlatformComposeCoreTests",
|
||||
"options": [
|
||||
{
|
||||
"exclude-annotation": "org.junit.Ignore"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.android.systemui.compose
|
||||
package com.android.compose
|
||||
|
||||
import androidx.compose.foundation.BorderStroke
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
@@ -27,10 +27,10 @@ import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.android.systemui.compose.theme.LocalAndroidColorScheme
|
||||
import com.android.compose.theme.LocalAndroidColorScheme
|
||||
|
||||
@Composable
|
||||
fun SysUiButton(
|
||||
fun PlatformButton(
|
||||
onClick: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
enabled: Boolean = true,
|
||||
@@ -48,7 +48,7 @@ fun SysUiButton(
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun SysUiOutlinedButton(
|
||||
fun PlatformOutlinedButton(
|
||||
onClick: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
enabled: Boolean = true,
|
||||
@@ -67,7 +67,7 @@ fun SysUiOutlinedButton(
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun SysUiTextButton(
|
||||
fun PlatformTextButton(
|
||||
onClick: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
enabled: Boolean = true,
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.compose
|
||||
package com.android.compose
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.compose.animation
|
||||
package com.android.compose.animation
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.compose.animation
|
||||
package com.android.compose.animation
|
||||
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.compose.animation
|
||||
package com.android.compose.animation
|
||||
|
||||
import android.view.View
|
||||
import androidx.savedstate.SavedStateRegistryOwner
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.compose.modifiers
|
||||
package com.android.compose.modifiers
|
||||
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.DrawModifier
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.compose.modifiers
|
||||
package com.android.compose.modifiers
|
||||
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.layout.LayoutModifier
|
||||
@@ -15,7 +15,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.android.systemui.compose.modifiers
|
||||
package com.android.compose.modifiers
|
||||
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.layout.IntrinsicMeasurable
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.compose.layout.pager
|
||||
package com.android.compose.pager
|
||||
|
||||
import androidx.compose.animation.core.AnimationSpec
|
||||
import androidx.compose.animation.core.DecayAnimationSpec
|
||||
@@ -40,7 +40,6 @@ import androidx.compose.ui.input.nestedscroll.nestedScroll
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.Velocity
|
||||
import androidx.compose.ui.unit.dp
|
||||
import kotlinx.coroutines.flow.collect
|
||||
import kotlinx.coroutines.flow.filter
|
||||
|
||||
/** Library-wide switch to turn on debug logging. */
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.compose.layout.pager
|
||||
package com.android.compose.pager
|
||||
|
||||
import androidx.annotation.FloatRange
|
||||
import androidx.annotation.IntRange
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.compose.layout.pager
|
||||
package com.android.compose.pager
|
||||
|
||||
import androidx.compose.animation.core.AnimationSpec
|
||||
import androidx.compose.animation.core.AnimationState
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.compose.runtime
|
||||
package com.android.compose.runtime
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.InternalComposeApi
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.compose.theme
|
||||
package com.android.compose.theme
|
||||
|
||||
import android.annotation.ColorInt
|
||||
import android.content.Context
|
||||
@@ -27,7 +27,7 @@ val LocalAndroidColorScheme =
|
||||
staticCompositionLocalOf<AndroidColorScheme> {
|
||||
throw IllegalStateException(
|
||||
"No AndroidColorScheme configured. Make sure to use LocalAndroidColorScheme in a " +
|
||||
"Composable surrounded by a SystemUITheme {}."
|
||||
"Composable surrounded by a PlatformTheme {}."
|
||||
)
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.compose.theme
|
||||
package com.android.compose.theme
|
||||
|
||||
import android.annotation.AttrRes
|
||||
import androidx.compose.runtime.Composable
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.compose.theme
|
||||
package com.android.compose.theme
|
||||
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
@@ -24,15 +24,15 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import com.android.systemui.compose.theme.typography.TypeScaleTokens
|
||||
import com.android.systemui.compose.theme.typography.TypefaceNames
|
||||
import com.android.systemui.compose.theme.typography.TypefaceTokens
|
||||
import com.android.systemui.compose.theme.typography.TypographyTokens
|
||||
import com.android.systemui.compose.theme.typography.systemUITypography
|
||||
import com.android.compose.theme.typography.TypeScaleTokens
|
||||
import com.android.compose.theme.typography.TypefaceNames
|
||||
import com.android.compose.theme.typography.TypefaceTokens
|
||||
import com.android.compose.theme.typography.TypographyTokens
|
||||
import com.android.compose.theme.typography.platformTypography
|
||||
|
||||
/** The Material 3 theme that should wrap all SystemUI Composables. */
|
||||
/** The Material 3 theme that should wrap all Platform Composables. */
|
||||
@Composable
|
||||
fun SystemUITheme(
|
||||
fun PlatformTheme(
|
||||
isDarkTheme: Boolean = isSystemInDarkTheme(),
|
||||
content: @Composable () -> Unit,
|
||||
) {
|
||||
@@ -49,7 +49,7 @@ fun SystemUITheme(
|
||||
val typefaceNames = remember(context) { TypefaceNames.get(context) }
|
||||
val typography =
|
||||
remember(typefaceNames) {
|
||||
systemUITypography(TypographyTokens(TypeScaleTokens(TypefaceTokens(typefaceNames))))
|
||||
platformTypography(TypographyTokens(TypeScaleTokens(TypefaceTokens(typefaceNames))))
|
||||
}
|
||||
|
||||
MaterialTheme(colorScheme, typography = typography) {
|
||||
@@ -14,18 +14,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.compose.theme.typography
|
||||
package com.android.compose.theme.typography
|
||||
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Typography
|
||||
|
||||
/**
|
||||
* The SystemUI typography.
|
||||
* The typography for Platform Compose code.
|
||||
*
|
||||
* Do not use directly and call [MaterialTheme.typography] instead to access the different text
|
||||
* styles.
|
||||
*/
|
||||
internal fun systemUITypography(typographyTokens: TypographyTokens): Typography {
|
||||
internal fun platformTypography(typographyTokens: TypographyTokens): Typography {
|
||||
return Typography(
|
||||
displayLarge = typographyTokens.displayLarge,
|
||||
displayMedium = typographyTokens.displayMedium,
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.compose.theme.typography
|
||||
package com.android.compose.theme.typography
|
||||
|
||||
import androidx.compose.ui.unit.sp
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
@file:OptIn(ExperimentalTextApi::class)
|
||||
|
||||
package com.android.systemui.compose.theme.typography
|
||||
package com.android.compose.theme.typography
|
||||
|
||||
import android.content.Context
|
||||
import androidx.compose.ui.text.ExperimentalTextApi
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.compose.theme.typography
|
||||
package com.android.compose.theme.typography
|
||||
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
|
||||
@@ -23,7 +23,7 @@ package {
|
||||
|
||||
// TODO(b/230606318): Make those host tests instead of device tests.
|
||||
android_test {
|
||||
name: "SystemUIComposeCoreTests",
|
||||
name: "PlatformComposeCoreTests",
|
||||
manifest: "AndroidManifest.xml",
|
||||
test_suites: ["device-tests"],
|
||||
sdk_version: "current",
|
||||
@@ -34,7 +34,7 @@ android_test {
|
||||
],
|
||||
|
||||
static_libs: [
|
||||
"SystemUIComposeCore",
|
||||
"PlatformComposeCore",
|
||||
|
||||
"androidx.test.runner",
|
||||
"androidx.test.ext.junit",
|
||||
|
||||
@@ -15,14 +15,14 @@
|
||||
-->
|
||||
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.android.systemui.compose.core.tests" >
|
||||
package="com.android.compose.core.tests" >
|
||||
|
||||
<application>
|
||||
<uses-library android:name="android.test.runner" />
|
||||
</application>
|
||||
|
||||
<instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
|
||||
android:targetPackage="com.android.systemui.compose.core.tests"
|
||||
android:label="Tests for SystemUIComposeCore"/>
|
||||
android:targetPackage="com.android.compose.core.tests"
|
||||
android:label="Tests for PlatformComposeCore"/>
|
||||
|
||||
</manifest>
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.compose.theme
|
||||
package com.android.compose.theme
|
||||
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.ui.test.assertIsDisplayed
|
||||
@@ -32,7 +32,7 @@ class SystemUIThemeTest {
|
||||
|
||||
@Test
|
||||
fun testThemeShowsContent() {
|
||||
composeRule.setContent { SystemUITheme { Text("foo") } }
|
||||
composeRule.setContent { PlatformTheme { Text("foo") } }
|
||||
|
||||
composeRule.onNodeWithText("foo").assertIsDisplayed()
|
||||
}
|
||||
@@ -40,7 +40,7 @@ class SystemUIThemeTest {
|
||||
@Test
|
||||
fun testAndroidColorsAreAvailableInsideTheme() {
|
||||
composeRule.setContent {
|
||||
SystemUITheme { Text("foo", color = LocalAndroidColorScheme.current.colorAccent) }
|
||||
PlatformTheme { Text("foo", color = LocalAndroidColorScheme.current.colorAccent) }
|
||||
}
|
||||
|
||||
composeRule.onNodeWithText("foo").assertIsDisplayed()
|
||||
@@ -18,7 +18,7 @@ package com.android.systemui.compose
|
||||
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import com.android.systemui.compose.theme.SystemUITheme
|
||||
import com.android.compose.theme.PlatformTheme
|
||||
import com.android.systemui.people.ui.compose.PeopleScreen
|
||||
import com.android.systemui.people.ui.viewmodel.PeopleViewModel
|
||||
|
||||
@@ -31,6 +31,6 @@ object ComposeFacade : BaseComposeFacade {
|
||||
viewModel: PeopleViewModel,
|
||||
onResult: (PeopleViewModel.Result) -> Unit,
|
||||
) {
|
||||
activity.setContent { SystemUITheme { PeopleScreen(viewModel, onResult) } }
|
||||
activity.setContent { PlatformTheme { PeopleScreen(viewModel, onResult) } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ android_library {
|
||||
|
||||
static_libs: [
|
||||
"SystemUI-core",
|
||||
"SystemUIComposeCore",
|
||||
"PlatformComposeCore",
|
||||
|
||||
"androidx.compose.runtime_runtime",
|
||||
"androidx.compose.material3_material3",
|
||||
|
||||
@@ -49,8 +49,8 @@ import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.repeatOnLifecycle
|
||||
import com.android.compose.theme.LocalAndroidColorScheme
|
||||
import com.android.systemui.R
|
||||
import com.android.systemui.compose.theme.LocalAndroidColorScheme
|
||||
import com.android.systemui.people.ui.viewmodel.PeopleTileViewModel
|
||||
import com.android.systemui.people.ui.viewmodel.PeopleViewModel
|
||||
|
||||
|
||||
@@ -41,8 +41,8 @@ import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.android.compose.theme.LocalAndroidColorScheme
|
||||
import com.android.systemui.R
|
||||
import com.android.systemui.compose.theme.LocalAndroidColorScheme
|
||||
|
||||
@Composable
|
||||
internal fun PeopleScreenEmpty(
|
||||
|
||||
@@ -65,14 +65,14 @@ import androidx.compose.ui.unit.sp
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import androidx.lifecycle.repeatOnLifecycle
|
||||
import com.android.compose.animation.Expandable
|
||||
import com.android.compose.modifiers.background
|
||||
import com.android.compose.theme.LocalAndroidColorScheme
|
||||
import com.android.compose.theme.colorAttr
|
||||
import com.android.systemui.R
|
||||
import com.android.systemui.animation.Expandable
|
||||
import com.android.systemui.common.shared.model.Icon
|
||||
import com.android.systemui.common.ui.compose.Icon
|
||||
import com.android.systemui.compose.animation.Expandable
|
||||
import com.android.systemui.compose.modifiers.background
|
||||
import com.android.systemui.compose.theme.LocalAndroidColorScheme
|
||||
import com.android.systemui.compose.theme.colorAttr
|
||||
import com.android.systemui.qs.footer.ui.viewmodel.FooterActionsButtonViewModel
|
||||
import com.android.systemui.qs.footer.ui.viewmodel.FooterActionsForegroundServicesButtonViewModel
|
||||
import com.android.systemui.qs.footer.ui.viewmodel.FooterActionsSecurityButtonViewModel
|
||||
|
||||
@@ -30,7 +30,7 @@ android_library {
|
||||
],
|
||||
|
||||
static_libs: [
|
||||
"SystemUIComposeCore",
|
||||
"PlatformComposeCore",
|
||||
"SystemUIScreenshotLib",
|
||||
|
||||
"androidx.compose.runtime_runtime",
|
||||
|
||||
@@ -22,7 +22,7 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.platform.ViewRootForTest
|
||||
import androidx.compose.ui.test.junit4.createAndroidComposeRule
|
||||
import androidx.compose.ui.test.onRoot
|
||||
import com.android.systemui.compose.theme.SystemUITheme
|
||||
import com.android.compose.theme.PlatformTheme
|
||||
import com.android.systemui.testing.screenshot.ScreenshotActivity
|
||||
import com.android.systemui.testing.screenshot.SystemUIGoldenImagePathManager
|
||||
import com.android.systemui.testing.screenshot.UnitTestBitmapMatcher
|
||||
@@ -79,7 +79,7 @@ class ComposeScreenshotTestRule(
|
||||
// Set the content using the AndroidComposeRule to make sure that the Activity is set up
|
||||
// correctly.
|
||||
composeRule.setContent {
|
||||
SystemUITheme {
|
||||
PlatformTheme {
|
||||
Surface(
|
||||
color = MaterialTheme.colorScheme.background,
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user