Merge "Controls UI - Detail panel redlines" into rvc-dev am: cc5cb3dc16 am: 82d7f72672
Change-Id: Id84d7e4ba7e8a7e104ee3d14791207792a6017f8
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_marginBottom="10dp">
|
android:layout_marginBottom="4dp">
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/control_detail_close"
|
android:id="@+id/control_detail_close"
|
||||||
android:contentDescription="@string/accessibility_desc_close"
|
android:contentDescription="@string/accessibility_desc_close"
|
||||||
@@ -55,10 +55,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:paddingTop="@dimen/controls_activity_view_top_padding"
|
android:background="@android:color/black"
|
||||||
android:paddingLeft="@dimen/controls_activity_view_side_padding"
|
|
||||||
android:paddingRight="@dimen/controls_activity_view_side_padding"
|
|
||||||
android:background="@drawable/rounded_bg_top"
|
|
||||||
android:orientation="vertical" />
|
android:orientation="vertical" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -1277,10 +1277,9 @@
|
|||||||
<fraction name="controls_dimmed_alpha">40%</fraction>
|
<fraction name="controls_dimmed_alpha">40%</fraction>
|
||||||
|
|
||||||
<!-- Home Controls activity view detail panel-->
|
<!-- Home Controls activity view detail panel-->
|
||||||
<dimen name="controls_activity_view_top_padding">25dp</dimen>
|
|
||||||
<dimen name="controls_activity_view_side_padding">12dp</dimen>
|
|
||||||
<dimen name="controls_activity_view_top_offset">100dp</dimen>
|
<dimen name="controls_activity_view_top_offset">100dp</dimen>
|
||||||
<dimen name="controls_activity_view_text_size">17sp</dimen>
|
<dimen name="controls_activity_view_text_size">17sp</dimen>
|
||||||
|
<dimen name="controls_activity_view_corner_radius">@*android:dimen/config_bottomDialogCornerRadius</dimen>
|
||||||
|
|
||||||
<!-- Home Controls management screens -->
|
<!-- Home Controls management screens -->
|
||||||
<dimen name="controls_management_top_padding">48dp</dimen>
|
<dimen name="controls_management_top_padding">48dp</dimen>
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import android.view.WindowInsets.Type
|
|||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
|
|
||||||
|
import com.android.internal.policy.ScreenDecorationsUtils
|
||||||
import com.android.systemui.R
|
import com.android.systemui.R
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,8 +42,12 @@ class DetailDialog(
|
|||||||
) : Dialog(cvh.context, R.style.Theme_SystemUI_Dialog_Control_DetailPanel) {
|
) : Dialog(cvh.context, R.style.Theme_SystemUI_Dialog_Control_DetailPanel) {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val ALPHA = (0.8f * 255).toInt()
|
|
||||||
private const val PANEL_TOP_OFFSET = "systemui.controls_panel_top_offset"
|
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)
|
var activityView = ActivityView(context, null, 0, false)
|
||||||
@@ -50,6 +55,7 @@ class DetailDialog(
|
|||||||
val stateCallback: ActivityView.StateCallback = object : ActivityView.StateCallback() {
|
val stateCallback: ActivityView.StateCallback = object : ActivityView.StateCallback() {
|
||||||
override fun onActivityViewReady(view: ActivityView) {
|
override fun onActivityViewReady(view: ActivityView) {
|
||||||
val launchIntent = Intent(intent)
|
val launchIntent = Intent(intent)
|
||||||
|
launchIntent.putExtra(EXTRA_USE_PANEL, true)
|
||||||
|
|
||||||
// Apply flags to make behaviour match documentLaunchMode=always.
|
// Apply flags to make behaviour match documentLaunchMode=always.
|
||||||
launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
@@ -112,6 +118,12 @@ class DetailDialog(
|
|||||||
setOnClickListener { dismiss() }
|
setOnClickListener { dismiss() }
|
||||||
(getParent() as View).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() {
|
override fun show() {
|
||||||
|
|||||||
Reference in New Issue
Block a user