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

Commit 6980cec2 authored by mattsziklay's avatar mattsziklay
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

Bug: 280830923
Test: Manual
Change-Id: I4cd9a65366c2e3f17c22f54c85a64e53b50e6b9a
parent 5e51aa6b
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
@@ -13,13 +13,20 @@
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24">
    <group android:translateY="8.0">
<vector
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="128dp"
    android:height="4dp"
    android:viewportWidth="128"
    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
            android:fillColor="@android:color/black" android:pathData="M3,5V3H21V5Z"/>
            android:pathData="M0 0V4H128V0"
            android:fillColor="@android:color/black"
            />
    </group>
</vector>
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
        android:layout_width="176dp"
        android:layout_height="42dp"
        android:paddingHorizontal="24dp"
        android:paddingVertical="19dp"
        android:contentDescription="@string/handle_text"
        android:src="@drawable/decor_handle_dark"
        tools:tint="@color/desktop_mode_caption_handle_bar_dark"
+19 −16
Original line number Diff line number Diff line
package com.android.wm.shell.windowdecor.viewholder

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

/**
 * 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].
@@ -13,8 +15,8 @@ internal abstract class DesktopModeWindowDecorationViewHolder(rootView: View) {
  val context: Context = rootView.context

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

@@ -23,7 +25,8 @@ internal abstract class DesktopModeWindowDecorationViewHolder(rootView: View) {
   * with the caption background color.
   */
  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
    } else {
      taskInfo.taskDescription.statusBarAppearance and APPEARANCE_LIGHT_STATUS_BARS == 0