Loading packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt +20 −20 Original line number Diff line number Diff line Loading @@ -170,7 +170,6 @@ import com.android.systemui.communal.ui.viewmodel.BaseCommunalViewModel import com.android.systemui.communal.ui.viewmodel.CommunalEditModeViewModel import com.android.systemui.communal.ui.viewmodel.CommunalViewModel import com.android.systemui.communal.util.DensityUtils.Companion.adjustedDp import com.android.systemui.communal.util.DensityUtils.Companion.scalingAdjustment import com.android.systemui.communal.widgets.SmartspaceAppWidgetHostView import com.android.systemui.communal.widgets.WidgetConfigurator import com.android.systemui.res.R Loading Loading @@ -478,8 +477,7 @@ fun CommunalHub( } val hubDimensions: Dimensions @Composable get() = Dimensions(LocalContext.current, LocalConfiguration.current, LocalDensity.current) @Composable get() = Dimensions(LocalContext.current, LocalConfiguration.current) @Composable private fun DisclaimerBottomSheetContent(onButtonClicked: () -> Unit) { Loading Loading @@ -1288,7 +1286,8 @@ fun DisabledWidgetPlaceholder( modifier = modifier .background( MaterialTheme.colorScheme.surfaceVariant, color = MaterialTheme.colorScheme.surfaceVariant, shape = RoundedCornerShape(dimensionResource(system_app_widget_background_radius)) ) .clickable( Loading Loading @@ -1325,10 +1324,8 @@ fun PendingWidgetPlaceholder( Column( modifier = modifier.background( MaterialTheme.colorScheme.surfaceVariant, RoundedCornerShape( dimensionResource(system_app_widget_background_radius) * scalingAdjustment ) color = MaterialTheme.colorScheme.surfaceVariant, shape = RoundedCornerShape(dimensionResource(system_app_widget_background_radius)) ), verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally, Loading Loading @@ -1511,21 +1508,24 @@ data class ContentPaddingInPx(val start: Float, val top: Float) { fun toOffset(): Offset = Offset(start, top) } class Dimensions(val context: Context, val config: Configuration, val density: Density) { class Dimensions(val context: Context, val config: Configuration) { val GridTopSpacing: Dp get() { val result = if (config.orientation == Configuration.ORIENTATION_LANDSCAPE) { return 114.adjustedDp 114.dp } else { val windowMetrics = WindowMetricsCalculator.getOrCreate().computeCurrentWindowMetrics(context) val screenHeight = with(density) { windowMetrics.bounds.height().adjustedDp } return (screenHeight - CardHeightFull) / 2 val density = context.resources.displayMetrics.density val screenHeight = (windowMetrics.bounds.height() / density).dp ((screenHeight - CardHeightFull) / 2) } return result } val GridHeight = CardHeightFull + GridTopSpacing val GridHeight: Dp get() = CardHeightFull + GridTopSpacing companion object { val CardHeightFull Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt +20 −20 Original line number Diff line number Diff line Loading @@ -170,7 +170,6 @@ import com.android.systemui.communal.ui.viewmodel.BaseCommunalViewModel import com.android.systemui.communal.ui.viewmodel.CommunalEditModeViewModel import com.android.systemui.communal.ui.viewmodel.CommunalViewModel import com.android.systemui.communal.util.DensityUtils.Companion.adjustedDp import com.android.systemui.communal.util.DensityUtils.Companion.scalingAdjustment import com.android.systemui.communal.widgets.SmartspaceAppWidgetHostView import com.android.systemui.communal.widgets.WidgetConfigurator import com.android.systemui.res.R Loading Loading @@ -478,8 +477,7 @@ fun CommunalHub( } val hubDimensions: Dimensions @Composable get() = Dimensions(LocalContext.current, LocalConfiguration.current, LocalDensity.current) @Composable get() = Dimensions(LocalContext.current, LocalConfiguration.current) @Composable private fun DisclaimerBottomSheetContent(onButtonClicked: () -> Unit) { Loading Loading @@ -1288,7 +1286,8 @@ fun DisabledWidgetPlaceholder( modifier = modifier .background( MaterialTheme.colorScheme.surfaceVariant, color = MaterialTheme.colorScheme.surfaceVariant, shape = RoundedCornerShape(dimensionResource(system_app_widget_background_radius)) ) .clickable( Loading Loading @@ -1325,10 +1324,8 @@ fun PendingWidgetPlaceholder( Column( modifier = modifier.background( MaterialTheme.colorScheme.surfaceVariant, RoundedCornerShape( dimensionResource(system_app_widget_background_radius) * scalingAdjustment ) color = MaterialTheme.colorScheme.surfaceVariant, shape = RoundedCornerShape(dimensionResource(system_app_widget_background_radius)) ), verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally, Loading Loading @@ -1511,21 +1508,24 @@ data class ContentPaddingInPx(val start: Float, val top: Float) { fun toOffset(): Offset = Offset(start, top) } class Dimensions(val context: Context, val config: Configuration, val density: Density) { class Dimensions(val context: Context, val config: Configuration) { val GridTopSpacing: Dp get() { val result = if (config.orientation == Configuration.ORIENTATION_LANDSCAPE) { return 114.adjustedDp 114.dp } else { val windowMetrics = WindowMetricsCalculator.getOrCreate().computeCurrentWindowMetrics(context) val screenHeight = with(density) { windowMetrics.bounds.height().adjustedDp } return (screenHeight - CardHeightFull) / 2 val density = context.resources.displayMetrics.density val screenHeight = (windowMetrics.bounds.height() / density).dp ((screenHeight - CardHeightFull) / 2) } return result } val GridHeight = CardHeightFull + GridTopSpacing val GridHeight: Dp get() = CardHeightFull + GridTopSpacing companion object { val CardHeightFull Loading