diff options
author | Steve Bower <stevebower@google.com> | 2022-02-02 19:51:41 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2022-02-02 19:51:41 +0000 |
commit | 08308be266e4c5c9b4449b24b61b6dabe0140411 (patch) | |
tree | 0e627185c07e947a44afca9129e8295ab759d1aa | |
parent | 1c111eaf10dfaafcd120a72924b6d87c8d034c60 (diff) | |
parent | 38f405c7c70488f205f126a2dc66afd99ac966fe (diff) | |
download | support-androidx-metrics-release.tar.gz |
Merge "Update baseline profile rules for Wear Compose" into androidx-mainandroidx-metrics-release
5 files changed, 78 insertions, 22 deletions
diff --git a/wear/compose/compose-foundation/src/androidMain/baseline-prof.txt b/wear/compose/compose-foundation/src/androidMain/baseline-prof.txt index e65b9e1909b..093d07db662 100644 --- a/wear/compose/compose-foundation/src/androidMain/baseline-prof.txt +++ b/wear/compose/compose-foundation/src/androidMain/baseline-prof.txt @@ -3,13 +3,13 @@ HSPLandroidx/wear/compose/foundation/ArcPaddingPx;->**(**)** Landroidx/wear/compose/foundation/ArcPaddingValues; SPLandroidx/wear/compose/foundation/ArcPaddingValuesImpl;->**(**)** HSPLandroidx/wear/compose/foundation/BasicCurvedTextKt**->**(**)** -SPLandroidx/wear/compose/foundation/CurvedMeasuredChild;->**(**)** +HSPLandroidx/wear/compose/foundation/CurvedMeasuredChild;->**(**)** HSPLandroidx/wear/compose/foundation/CurvedRowKt**->**(**)** SPLandroidx/wear/compose/foundation/CurvedRowParentData;->**(**)** Landroidx/wear/compose/foundation/CurvedRowScope; SPLandroidx/wear/compose/foundation/CurvedRowScopeInstance;->**(**)** HSPLandroidx/wear/compose/foundation/CurvedTextDelegate;->**(**)** -SPLandroidx/wear/compose/foundation/CurvedTextModifier;->**(**)** +HSPLandroidx/wear/compose/foundation/CurvedTextModifier;->**(**)** HSPLandroidx/wear/compose/foundation/CurvedTextStyle;->**(**)** SPLandroidx/wear/compose/foundation/CurvedTextStyleKt**->**(**)** HSPLandroidx/wear/compose/foundation/MeasuredChild;->**(**)** diff --git a/wear/compose/compose-material/src/androidMain/baseline-prof.txt b/wear/compose/compose-material/src/androidMain/baseline-prof.txt index dc96f70d74d..e9435276cab 100644 --- a/wear/compose/compose-material/src/androidMain/baseline-prof.txt +++ b/wear/compose/compose-material/src/androidMain/baseline-prof.txt @@ -9,7 +9,7 @@ HSPLandroidx/wear/compose/material/ChipDefaults;->**(**)** HSPLandroidx/wear/compose/material/ChipKt**->**(**)** HSPLandroidx/wear/compose/material/Colors;->**(**)** HSPLandroidx/wear/compose/material/ColorsKt**->**(**)** -SPLandroidx/wear/compose/material/CombinedPaddingValues;->**(**)** +HSPLandroidx/wear/compose/material/CombinedPaddingValues;->**(**)** SPLandroidx/wear/compose/material/ComposableSingletons;->**(**)** HSPLandroidx/wear/compose/material/ContentAlpha;->**(**)** HSPLandroidx/wear/compose/material/ContentAlphaKt**->**(**)** @@ -25,9 +25,7 @@ SPLandroidx/wear/compose/material/DefaultTimeSource;->**(**)** HSPLandroidx/wear/compose/material/DefaultTimeSourceKt**->**(**)** SPLandroidx/wear/compose/material/DefaultToggleButtonColors;->**(**)** HSPLandroidx/wear/compose/material/DefaultToggleChipColors;->**(**)** -PLandroidx/wear/compose/material/DialogDefaults;->**(**)** -HPLandroidx/wear/compose/material/DialogKt**->**(**)** -Landroidx/wear/compose/material/EmptyScalingLazyListLayoutInfo; +SPLandroidx/wear/compose/material/EmptyScalingLazyListLayoutInfo;->**(**)** HSPLandroidx/wear/compose/material/FortyFiveDegreeLinearGradient;->**(**)** Landroidx/wear/compose/material/FractionPositionIndicatorState; Landroidx/wear/compose/material/FractionalThreshold; @@ -42,16 +40,19 @@ HSPLandroidx/wear/compose/material/MaterialRippleTheme;->**(**)** SPLandroidx/wear/compose/material/MaterialTextSelectionColorsKt**->**(**)** HSPLandroidx/wear/compose/material/MaterialTheme;->**(**)** SPLandroidx/wear/compose/material/MaterialThemeKt**->**(**)** +HSPLandroidx/wear/compose/material/Modifiers;->**(**)** SPLandroidx/wear/compose/material/PickerDefaults;->**(**)** HSPLandroidx/wear/compose/material/PickerKt**->**(**)** Landroidx/wear/compose/material/PickerScope; SPLandroidx/wear/compose/material/PickerScopeImpl;->**(**)** -SPLandroidx/wear/compose/material/PickerState;->**(**)** +HSPLandroidx/wear/compose/material/PickerState;->**(**)** HSPLandroidx/wear/compose/material/PositionIndicatorKt**->**(**)** Landroidx/wear/compose/material/PositionIndicatorState; +HPLandroidx/wear/compose/material/ProgressIndicatorDefaults;->**(**)** +HPLandroidx/wear/compose/material/ProgressIndicatorKt**->**(**)** Landroidx/wear/compose/material/R; -SPLandroidx/wear/compose/material/RangeDefaults;->**(**)** -HSPLandroidx/wear/compose/material/RangeDefaultsKt**->**(**)** +HSPLandroidx/wear/compose/material/RangeDefaults;->**(**)** +SPLandroidx/wear/compose/material/RangeDefaultsKt**->**(**)** SPLandroidx/wear/compose/material/RangeIcons;->**(**)** SPLandroidx/wear/compose/material/ResistanceConfig;->**(**)** HSPLandroidx/wear/compose/material/Resources_androidKt**->**(**)** @@ -61,18 +62,19 @@ Landroidx/wear/compose/material/ScalingLazyColumnDefaults; HSPLandroidx/wear/compose/material/ScalingLazyColumnKt**->**(**)** HPLandroidx/wear/compose/material/ScalingLazyColumnMeasureKt**->**(**)** Landroidx/wear/compose/material/ScalingLazyColumnStateAdapter; +HSPLandroidx/wear/compose/material/ScalingLazyListAnchorType;->**(**)** Landroidx/wear/compose/material/ScalingLazyListItemInfo; Landroidx/wear/compose/material/ScalingLazyListItemScope; -SPLandroidx/wear/compose/material/ScalingLazyListItemScopeImpl;->**(**)** +HSPLandroidx/wear/compose/material/ScalingLazyListItemScopeImpl;->**(**)** Landroidx/wear/compose/material/ScalingLazyListLayoutInfo; SPLandroidx/wear/compose/material/ScalingLazyListScope;->**(**)** HSPLandroidx/wear/compose/material/ScalingLazyListScopeImpl;->**(**)** HSPLandroidx/wear/compose/material/ScalingLazyListState;->**(**)** -Landroidx/wear/compose/material/ScalingLazyListStateKt; +HPLandroidx/wear/compose/material/ScalingLazyListStateKt**->**(**)** Landroidx/wear/compose/material/ScalingParams; HSPLandroidx/wear/compose/material/ScrollStateAdapter;->**(**)** -SPLandroidx/wear/compose/material/Shapes;->**(**)** -SPLandroidx/wear/compose/material/ShapesKt**->**(**)** +HSPLandroidx/wear/compose/material/Shapes;->**(**)** +HSPLandroidx/wear/compose/material/ShapesKt**->**(**)** HSPLandroidx/wear/compose/material/SliderKt**->**(**)** SPLandroidx/wear/compose/material/SqueezeMotion;->**(**)** SPLandroidx/wear/compose/material/StepperDefaults;->**(**)** @@ -82,7 +84,7 @@ Landroidx/wear/compose/material/SwipeProgress; SPLandroidx/wear/compose/material/SwipeToDismissBoxDefaults;->**(**)** HSPLandroidx/wear/compose/material/SwipeToDismissBoxKt**->**(**)** SPLandroidx/wear/compose/material/SwipeToDismissBoxState;->**(**)** -SPLandroidx/wear/compose/material/SwipeableDefaults;->**(**)** +HSPLandroidx/wear/compose/material/SwipeableDefaults;->**(**)** HSPLandroidx/wear/compose/material/SwipeableKt**->**(**)** HSPLandroidx/wear/compose/material/SwipeableState;->**(**)** HSPLandroidx/wear/compose/material/TextKt**->**(**)** @@ -101,3 +103,5 @@ HSPLandroidx/wear/compose/material/Typography;->**(**)** HSPLandroidx/wear/compose/material/TypographyKt**->**(**)** HSPLandroidx/wear/compose/material/VignetteKt**->**(**)** SPLandroidx/wear/compose/material/VignettePosition;->**(**)** +HPLandroidx/wear/compose/material/dialog/DialogDefaults;->**(**)** +HPLandroidx/wear/compose/material/dialog/DialogKt**->**(**)** diff --git a/wear/compose/compose-navigation/src/androidMain/baseline-prof.txt b/wear/compose/compose-navigation/src/androidMain/baseline-prof.txt index a33330f537e..f9213a25b1a 100644 --- a/wear/compose/compose-navigation/src/androidMain/baseline-prof.txt +++ b/wear/compose/compose-navigation/src/androidMain/baseline-prof.txt @@ -1,4 +1,5 @@ -SPLandroidx/wear/compose/navigation/NavGraphBuilderKt**->**(**)** +Landroidx/wear/compose/navigation/ComposableSingletons; +HSPLandroidx/wear/compose/navigation/NavGraphBuilderKt**->**(**)** SPLandroidx/wear/compose/navigation/SwipeDismissableNavHostControllerKt**->**(**)** HSPLandroidx/wear/compose/navigation/SwipeDismissableNavHostKt**->**(**)** HSPLandroidx/wear/compose/navigation/WearNavigator;->**(**)** diff --git a/wear/compose/integration-tests/macrobenchmark-target/src/main/java/androidx/wear/compose/integration/macrobenchmark/target/BaselineActivity.kt b/wear/compose/integration-tests/macrobenchmark-target/src/main/java/androidx/wear/compose/integration/macrobenchmark/target/BaselineActivity.kt index 025e8b3dc10..a00755a15b7 100644 --- a/wear/compose/integration-tests/macrobenchmark-target/src/main/java/androidx/wear/compose/integration/macrobenchmark/target/BaselineActivity.kt +++ b/wear/compose/integration-tests/macrobenchmark-target/src/main/java/androidx/wear/compose/integration/macrobenchmark/target/BaselineActivity.kt @@ -50,6 +50,7 @@ import androidx.wear.compose.material.Button import androidx.wear.compose.material.Card import androidx.wear.compose.material.Chip import androidx.wear.compose.material.ChipDefaults +import androidx.wear.compose.material.CircularProgressIndicator import androidx.wear.compose.material.CompactButton import androidx.wear.compose.material.CompactChip import androidx.wear.compose.material.CurvedText @@ -80,6 +81,8 @@ private val ALERT_DIALOG = "alert-dialog" private val CONFIRMATION_DIALOG = "confirmation-dialog" private val STEPPER = "stepper" private val SWIPE_DISMISS = "swipe-dismiss" +private val PROGRESS_INDICATOR = "progress-indicator" +private val PROGRESS_INDICATOR_INDETERMINATE = "progress-indicator-indeterminate" class BaselineActivity : ComponentActivity() { @@ -120,6 +123,7 @@ class BaselineActivity : ComponentActivity() { ) { Dialogs(navController) Steppers(navController) + ProgressIndicators(navController) Buttons() Cards() Chips() @@ -150,6 +154,23 @@ class BaselineActivity : ComponentActivity() { steps = 7 ) { Text("Value: $value") } } + composable(PROGRESS_INDICATOR) { + CircularProgressIndicator( + modifier = Modifier.fillMaxSize(), + startAngle = 300f, + endAngle = 240f, + progress = 0.3f + ) + } + composable(PROGRESS_INDICATOR_INDETERMINATE) { + Column( + modifier = Modifier.fillMaxSize(), + verticalArrangement = Arrangement.Center, + horizontalAlignment = Alignment.CenterHorizontally + ) { + CircularProgressIndicator() + } + } } } } @@ -234,6 +255,24 @@ fun Pickers() { } @Composable +fun ProgressIndicators(navController: NavHostController) { + ListHeader { Text("Progress Indicators") } + // Test both circular progress indicator with gap and spinning indicator. + CompactChip( + onClick = { navController.navigate(PROGRESS_INDICATOR) }, + colors = ChipDefaults.primaryChipColors(), + label = { Text(PROGRESS_INDICATOR) }, + modifier = Modifier.semantics { contentDescription = PROGRESS_INDICATOR }, + ) + CompactChip( + onClick = { navController.navigate(PROGRESS_INDICATOR_INDETERMINATE) }, + colors = ChipDefaults.primaryChipColors(), + label = { Text(PROGRESS_INDICATOR_INDETERMINATE) }, + modifier = Modifier.semantics { contentDescription = PROGRESS_INDICATOR_INDETERMINATE }, + ) +} + +@Composable fun Sliders() { ListHeader { Text("Sliders") } var value by remember { mutableStateOf(4.5f) } diff --git a/wear/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/wear/compose/integration/macrobenchmark/BaselineProfile.kt b/wear/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/wear/compose/integration/macrobenchmark/BaselineProfile.kt index 2b216c9e9ab..74d435c0ecf 100644 --- a/wear/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/wear/compose/integration/macrobenchmark/BaselineProfile.kt +++ b/wear/compose/integration-tests/macrobenchmark/src/androidTest/java/androidx/wear/compose/integration/macrobenchmark/BaselineProfile.kt @@ -67,6 +67,8 @@ class BaselineProfile { private val ALERT_DIALOG = "alert-dialog" private val CONFIRMATION_DIALOG = "confirmation-dialog" private val STEPPER = "stepper" + private val PROGRESS_INDICATOR = "progress-indicator" + private val PROGRESS_INDICATOR_INDETERMINATE = "progress-indicator-indeterminate" @Before fun setUp() { @@ -83,16 +85,17 @@ class BaselineProfile { intent.action = ACTION startActivityAndWait(intent) testDestination(ALERT_DIALOG) + scrollDown() testDestination(CONFIRMATION_DIALOG) + scrollDown() testDestination(STEPPER) + scrollDown() + testDestination(PROGRESS_INDICATOR) + scrollDown() + testDestination(PROGRESS_INDICATOR_INDETERMINATE) - // Scroll down to view remaining UI elements - // Setting a gesture margin is important otherwise gesture nav is triggered. - val list = device.findObject(By.desc(CONTENT_DESCRIPTION)) - list.setGestureMargin(device.displayWidth / 5) - repeat(25) { - list.drag(Point(list.visibleCenter.x, list.visibleCenter.y / 3)) - device.waitForIdle() + repeat(30) { + scrollDown() } } ) @@ -105,6 +108,15 @@ class BaselineProfile { device.waitForIdle() } + private fun scrollDown() { + // Scroll down to view remaining UI elements + // Setting a gesture margin is important otherwise gesture nav is triggered. + val list = device.findObject(By.desc(CONTENT_DESCRIPTION)) + list.setGestureMargin(device.displayWidth / 5) + list.drag(Point(list.visibleCenter.x, list.visibleCenter.y / 3)) + device.waitForIdle() + } + companion object { private const val PACKAGE_NAME = "androidx.wear.compose.integration.macrobenchmark.target" private const val ACTION = |