Loading packages/SystemUI/res/layout/controls_detail_dialog.xml +5 −31 Original line number Diff line number Diff line Loading @@ -50,41 +50,15 @@ android:padding="12dp" /> </LinearLayout> <LinearLayout <FrameLayout android:id="@+id/controls_activity_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_height="0dp" android:layout_weight="1" android:paddingTop="@dimen/controls_activity_view_top_padding" 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"> <TextView android:id="@+id/title" android:layout_width="match_parent" android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.ControlDialog" android:clickable="false" android:focusable="false" android:maxLines="1" android:ellipsize="end" /> <TextView android:id="@+id/subtitle" android:layout_marginTop="6dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.ControlDialog" android:clickable="false" android:focusable="false" android:maxLines="1" android:ellipsize="end" /> <FrameLayout android:id="@+id/controls_activity_view" android:layout_width="match_parent" android:layout_height="0dp" android:layout_marginTop="10dp" android:layout_weight="1" /> </LinearLayout> android:orientation="vertical" /> </LinearLayout> packages/SystemUI/res/values/dimens.xml +1 −1 Original line number Diff line number Diff line Loading @@ -1260,7 +1260,7 @@ <!-- 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">200dp</dimen> <dimen name="controls_activity_view_top_offset">100dp</dimen> <dimen name="controls_activity_view_text_size">17sp</dimen> <!-- Home Controls management screens --> Loading packages/SystemUI/res/values/styles.xml +0 −5 Original line number Diff line number Diff line Loading @@ -731,11 +731,6 @@ <item name="android:textSize">@dimen/control_text_size</item> <item name="android:textColor">@color/control_secondary_text</item> </style> <style name="TextAppearance.ControlDialog"> <item name="android:fontFamily">@*android:string/config_headlineFontFamilyMedium</item> <item name="android:textSize">@dimen/controls_activity_view_text_size</item> <item name="android:textColor">@color/control_primary_text</item> </style> <style name="Control.ListPopupWindow" parent="@*android:style/Widget.DeviceDefault.ListPopupWindow"> <item name="android:overlapAnchor">true</item> Loading packages/SystemUI/src/com/android/systemui/controls/ui/ControlActionCoordinator.kt +4 −16 Original line number Diff line number Diff line Loading @@ -17,14 +17,11 @@ package com.android.systemui.controls.ui import android.app.Dialog import android.app.PendingIntent import android.content.Intent import android.service.controls.Control import android.service.controls.actions.BooleanAction import android.service.controls.actions.CommandAction import android.util.Log import android.view.HapticFeedbackConstants import com.android.systemui.R import com.android.systemui.controls.controller.ControlsController object ControlActionCoordinator { Loading @@ -51,23 +48,14 @@ object ControlActionCoordinator { } /** * Allow apps to specify whether they would like to appear in a detail panel or within * the full activity by setting the {@link Control#EXTRA_USE_PANEL} flag. In order for * activities to determine how they are being launched, they should inspect the * {@link Control#EXTRA_USE_PANEL} flag for a value of true. * All long presses will be shown in a 3/4 height bottomsheet panel, in order for the user to * retain context with their favorited controls in the power menu. */ fun longPress(cvh: ControlViewHolder) { // Long press snould only be called when there is valid control state, otherwise ignore cvh.cws.control?.let { try { it.getAppIntent().send() cvh.layout.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS) cvh.context.sendBroadcast(Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)) } catch (e: PendingIntent.CanceledException) { Log.e(ControlsUiController.TAG, "Error sending pending intent", e) cvh.setTransientStatus( cvh.context.resources.getString(R.string.controls_error_failed)) } showDialog(cvh, it.getAppIntent().getIntent()) } } Loading packages/SystemUI/src/com/android/systemui/controls/ui/ControlViewHolder.kt +2 −4 Original line number Diff line number Diff line Loading @@ -52,8 +52,7 @@ class ControlViewHolder( val layout: ViewGroup, val controlsController: ControlsController, val uiExecutor: DelayableExecutor, val bgExecutor: DelayableExecutor, val usePanels: Boolean val bgExecutor: DelayableExecutor ) { companion object { Loading Loading @@ -159,8 +158,7 @@ class ControlViewHolder( controlsController.action(cws.componentName, cws.ci, action) } fun usePanel(): Boolean = usePanels && deviceType in ControlViewHolder.FORCE_PANEL_DEVICES fun usePanel(): Boolean = deviceType in ControlViewHolder.FORCE_PANEL_DEVICES private fun findBehavior( status: Int, Loading Loading
packages/SystemUI/res/layout/controls_detail_dialog.xml +5 −31 Original line number Diff line number Diff line Loading @@ -50,41 +50,15 @@ android:padding="12dp" /> </LinearLayout> <LinearLayout <FrameLayout android:id="@+id/controls_activity_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_height="0dp" android:layout_weight="1" android:paddingTop="@dimen/controls_activity_view_top_padding" 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"> <TextView android:id="@+id/title" android:layout_width="match_parent" android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.ControlDialog" android:clickable="false" android:focusable="false" android:maxLines="1" android:ellipsize="end" /> <TextView android:id="@+id/subtitle" android:layout_marginTop="6dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.ControlDialog" android:clickable="false" android:focusable="false" android:maxLines="1" android:ellipsize="end" /> <FrameLayout android:id="@+id/controls_activity_view" android:layout_width="match_parent" android:layout_height="0dp" android:layout_marginTop="10dp" android:layout_weight="1" /> </LinearLayout> android:orientation="vertical" /> </LinearLayout>
packages/SystemUI/res/values/dimens.xml +1 −1 Original line number Diff line number Diff line Loading @@ -1260,7 +1260,7 @@ <!-- 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">200dp</dimen> <dimen name="controls_activity_view_top_offset">100dp</dimen> <dimen name="controls_activity_view_text_size">17sp</dimen> <!-- Home Controls management screens --> Loading
packages/SystemUI/res/values/styles.xml +0 −5 Original line number Diff line number Diff line Loading @@ -731,11 +731,6 @@ <item name="android:textSize">@dimen/control_text_size</item> <item name="android:textColor">@color/control_secondary_text</item> </style> <style name="TextAppearance.ControlDialog"> <item name="android:fontFamily">@*android:string/config_headlineFontFamilyMedium</item> <item name="android:textSize">@dimen/controls_activity_view_text_size</item> <item name="android:textColor">@color/control_primary_text</item> </style> <style name="Control.ListPopupWindow" parent="@*android:style/Widget.DeviceDefault.ListPopupWindow"> <item name="android:overlapAnchor">true</item> Loading
packages/SystemUI/src/com/android/systemui/controls/ui/ControlActionCoordinator.kt +4 −16 Original line number Diff line number Diff line Loading @@ -17,14 +17,11 @@ package com.android.systemui.controls.ui import android.app.Dialog import android.app.PendingIntent import android.content.Intent import android.service.controls.Control import android.service.controls.actions.BooleanAction import android.service.controls.actions.CommandAction import android.util.Log import android.view.HapticFeedbackConstants import com.android.systemui.R import com.android.systemui.controls.controller.ControlsController object ControlActionCoordinator { Loading @@ -51,23 +48,14 @@ object ControlActionCoordinator { } /** * Allow apps to specify whether they would like to appear in a detail panel or within * the full activity by setting the {@link Control#EXTRA_USE_PANEL} flag. In order for * activities to determine how they are being launched, they should inspect the * {@link Control#EXTRA_USE_PANEL} flag for a value of true. * All long presses will be shown in a 3/4 height bottomsheet panel, in order for the user to * retain context with their favorited controls in the power menu. */ fun longPress(cvh: ControlViewHolder) { // Long press snould only be called when there is valid control state, otherwise ignore cvh.cws.control?.let { try { it.getAppIntent().send() cvh.layout.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS) cvh.context.sendBroadcast(Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)) } catch (e: PendingIntent.CanceledException) { Log.e(ControlsUiController.TAG, "Error sending pending intent", e) cvh.setTransientStatus( cvh.context.resources.getString(R.string.controls_error_failed)) } showDialog(cvh, it.getAppIntent().getIntent()) } } Loading
packages/SystemUI/src/com/android/systemui/controls/ui/ControlViewHolder.kt +2 −4 Original line number Diff line number Diff line Loading @@ -52,8 +52,7 @@ class ControlViewHolder( val layout: ViewGroup, val controlsController: ControlsController, val uiExecutor: DelayableExecutor, val bgExecutor: DelayableExecutor, val usePanels: Boolean val bgExecutor: DelayableExecutor ) { companion object { Loading Loading @@ -159,8 +158,7 @@ class ControlViewHolder( controlsController.action(cws.componentName, cws.ci, action) } fun usePanel(): Boolean = usePanels && deviceType in ControlViewHolder.FORCE_PANEL_DEVICES fun usePanel(): Boolean = deviceType in ControlViewHolder.FORCE_PANEL_DEVICES private fun findBehavior( status: Int, Loading