diff --git a/packages/SystemUI/res/layout/controls_detail_dialog.xml b/packages/SystemUI/res/layout/controls_detail_dialog.xml
index d1ce10e5745f1..d61122fd47ddd 100644
--- a/packages/SystemUI/res/layout/controls_detail_dialog.xml
+++ b/packages/SystemUI/res/layout/controls_detail_dialog.xml
@@ -26,7 +26,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
- android:layout_marginBottom="10dp">
+ android:layout_marginBottom="4dp">
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 48648e547a842..f9c7c6bd7c1e6 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -1268,10 +1268,9 @@
40%
- 25dp
- 12dp
100dp
17sp
+ @*android:dimen/config_bottomDialogCornerRadius
48dp
diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/DetailDialog.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/DetailDialog.kt
index 65ed9678c63ed..236fa2d29aca3 100644
--- a/packages/SystemUI/src/com/android/systemui/controls/ui/DetailDialog.kt
+++ b/packages/SystemUI/src/com/android/systemui/controls/ui/DetailDialog.kt
@@ -28,6 +28,7 @@ import android.view.WindowInsets.Type
import android.view.WindowManager
import android.widget.ImageView
+import com.android.internal.policy.ScreenDecorationsUtils
import com.android.systemui.R
/**
@@ -41,8 +42,12 @@ class DetailDialog(
) : Dialog(cvh.context, R.style.Theme_SystemUI_Dialog_Control_DetailPanel) {
companion object {
- private const val ALPHA = (0.8f * 255).toInt()
private const val PANEL_TOP_OFFSET = "systemui.controls_panel_top_offset"
+ /*
+ * Indicate to the activity that it is being rendered in a bottomsheet, and they
+ * should optimize the layout for a smaller space.
+ */
+ private const val EXTRA_USE_PANEL = "controls.DISPLAY_IN_PANEL"
}
var activityView = ActivityView(context, null, 0, false)
@@ -50,6 +55,7 @@ class DetailDialog(
val stateCallback: ActivityView.StateCallback = object : ActivityView.StateCallback() {
override fun onActivityViewReady(view: ActivityView) {
val launchIntent = Intent(intent)
+ launchIntent.putExtra(EXTRA_USE_PANEL, true)
// Apply flags to make behaviour match documentLaunchMode=always.
launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
@@ -112,6 +118,12 @@ class DetailDialog(
setOnClickListener { dismiss() }
(getParent() as View).setOnClickListener { dismiss() }
}
+
+ if (ScreenDecorationsUtils.supportsRoundedCornersOnWindows(context.getResources())) {
+ val cornerRadius = context.resources
+ .getDimensionPixelSize(R.dimen.controls_activity_view_corner_radius)
+ activityView.setCornerRadius(cornerRadius.toFloat())
+ }
}
override fun show() {