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

Commit b6149ff1 authored by mattsziklay's avatar mattsziklay Committed by Brian Egizi
Browse files

Update fullscreen handle appearance.

Makes fullscreen desktop handle rounder and aligns its brightness with
notification icons.
Before: https://screenshot.googleplex.com/89zkkMpUefHc39L
After: https://screenshot.googleplex.com/3ceqjybE6QvHsWe

Cherry picked I4cd9a65366c2e3f17c22f54c85a64e53b50e6b9a to master due to b/286408867.

Code was merged via `-s ours` and is missing even though the sha exists on the target branch. Cherry pick is required to bring in the code.

Manually remove the "Merged in" directive to allow for downstream propagation.

Bug: 280830923
Test: Manual
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:6980cec2dd5770595e0c804083ef011f7fd81570)
Change-Id: Id1dfe3f02875155700cd1f3e32222b8a6dfbdf0e
parent 1d62ef33
Loading
Loading
Loading
Loading
+14 −7
Original line number Original line Diff line number Diff line
@@ -13,13 +13,20 @@
  ~ See the License for the specific language governing permissions and
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~ limitations under the License.
  -->
  -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
<vector
    android:width="24dp"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:height="24dp"
    android:width="128dp"
    android:viewportWidth="24"
    android:height="4dp"
    android:viewportHeight="24">
    android:viewportWidth="128"
    <group android:translateY="8.0">
    android:viewportHeight="4"
    >
    <group>
        <clip-path
            android:pathData="M2 0H126C127.105 0 128 0.895431 128 2C128 3.10457 127.105 4 126 4H2C0.895431 4 0 3.10457 0 2C0 0.895431 0.895431 0 2 0Z"
            />
        <path
        <path
            android:fillColor="@android:color/black" android:pathData="M3,5V3H21V5Z"/>
            android:pathData="M0 0V4H128V0"
            android:fillColor="@android:color/black"
            />
    </group>
    </group>
</vector>
</vector>
+1 −0
Original line number Original line Diff line number Diff line
@@ -28,6 +28,7 @@
        android:layout_width="176dp"
        android:layout_width="176dp"
        android:layout_height="42dp"
        android:layout_height="42dp"
        android:paddingHorizontal="24dp"
        android:paddingHorizontal="24dp"
        android:paddingVertical="19dp"
        android:contentDescription="@string/handle_text"
        android:contentDescription="@string/handle_text"
        android:src="@drawable/decor_handle_dark"
        android:src="@drawable/decor_handle_dark"
        tools:tint="@color/desktop_mode_caption_handle_bar_dark"
        tools:tint="@color/desktop_mode_caption_handle_bar_dark"
+19 −16
Original line number Original line Diff line number Diff line
package com.android.wm.shell.windowdecor.viewholder
package com.android.wm.shell.windowdecor.viewholder


import android.app.ActivityManager.RunningTaskInfo
import android.app.ActivityManager.RunningTaskInfo
import android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM
import android.content.Context
import android.content.Context
import android.graphics.Color
import android.graphics.Color
import android.view.View
import android.view.View
import android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS
import android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS

/**
/**
 * Encapsulates the root [View] of a window decoration and its children to facilitate looking up
 * Encapsulates the root [View] of a window decoration and its children to facilitate looking up
 * children (via findViewById) and updating to the latest data from [RunningTaskInfo].
 * children (via findViewById) and updating to the latest data from [RunningTaskInfo].
@@ -13,8 +15,8 @@ internal abstract class DesktopModeWindowDecorationViewHolder(rootView: View) {
  val context: Context = rootView.context
  val context: Context = rootView.context


  /**
  /**
     * A signal to the view holder that new data is available and that the views should be updated
   * A signal to the view holder that new data is available and that the views should be updated to
     * to reflect it.
   * reflect it.
   */
   */
  abstract fun bindData(taskInfo: RunningTaskInfo)
  abstract fun bindData(taskInfo: RunningTaskInfo)


@@ -23,7 +25,8 @@ internal abstract class DesktopModeWindowDecorationViewHolder(rootView: View) {
   * with the caption background color.
   * with the caption background color.
   */
   */
  protected fun shouldUseLightCaptionColors(taskInfo: RunningTaskInfo): Boolean {
  protected fun shouldUseLightCaptionColors(taskInfo: RunningTaskInfo): Boolean {
        return if (Color.alpha(taskInfo.taskDescription.statusBarColor) != 0) {
    return if (Color.alpha(taskInfo.taskDescription.statusBarColor) != 0 &&
        taskInfo.windowingMode == WINDOWING_MODE_FREEFORM) {
      Color.valueOf(taskInfo.taskDescription.statusBarColor).luminance() < 0.5
      Color.valueOf(taskInfo.taskDescription.statusBarColor).luminance() < 0.5
    } else {
    } else {
      taskInfo.taskDescription.statusBarAppearance and APPEARANCE_LIGHT_STATUS_BARS == 0
      taskInfo.taskDescription.statusBarAppearance and APPEARANCE_LIGHT_STATUS_BARS == 0