Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bcd5672c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Controls UI - Detail panel" into rvc-dev am: 87cf6848

Change-Id: Ia167e1c03859d5be843a49b3d490d6e34d0ae64d
parents 20c3d155 87cf6848
Loading
Loading
Loading
Loading
+5 −31
Original line number Diff line number Diff line
@@ -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>
+1 −1
Original line number Diff line number Diff line
@@ -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 -->
+0 −5
Original line number Diff line number Diff line
@@ -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>

+4 −16
Original line number Diff line number Diff line
@@ -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 {
@@ -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())
        }
    }

+2 −4
Original line number Diff line number Diff line
@@ -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 {
@@ -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