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

Commit f98949ca authored by Andy Wickham's avatar Andy Wickham
Browse files

Change Overview Actions to round buttons.

If floating search is active in Overview (flag enabled and we are
the active Launcher), these buttons will be aligned to the search
bar relative to the bottom of the screen. Otherwise, the buttons
will be aligned below the active task like before.

Demo for Launcher3 build:
https://drive.google.com/file/d/1fVzRRnW5AFDMPkW-E8_w4BOCzTAOURQ_/view?usp=drive_link&resourcekey=0-6-EbFZXkBqcu0rw7uuEzjw

Bug: 292000892
Test: Manual with floating enabled/disabled and
SEPARATE_RECENTS_ACTIVITY enabled/disabled (simulating not being
the active Launcher). Also tested with a 3P Launcher, Nova.
Flag: N/A; this change is enabled by default, but also verified
UI looks correct with ENABLE_FLOATING_SEARCH_BAR.

Change-Id: Ia45f88d2c691c4525b1e73cca4707498d058a917
parent c56c01c3
Loading
Loading
Loading
Loading
+9 −31
Original line number Diff line number Diff line
<!-- Copyright (C) 2020 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     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="20dp"
    android:height="20dp"
    android:viewportWidth="20"
    android:viewportHeight="20">
  <path
      android:pathData="M5.8334,1.666H8.3334V3.3327H5.8334V6.666H4.1667V3.3327C4.1667,2.4122 4.9129,1.666 5.8334,1.666Z"
      android:fillColor="#000000"/>
  <path
      android:pathData="M4.1667,13.3327V16.666C4.1667,17.5865 4.9129,18.3327 5.8334,18.3327H8.3334V16.666H5.8334V13.3327H4.1667Z"
      android:fillColor="#000000"/>
  <path
      android:pathData="M14.1667,13.3327V16.666H11.6667V18.3327H14.1667C15.0872,18.3327 15.8334,17.5865 15.8334,16.666V13.3327H14.1667Z"
      android:fillColor="#000000"/>
  <path
      android:pathData="M15.8334,6.666V3.3327C15.8334,2.4122 15.0872,1.666 14.1667,1.666H11.6667V3.3327H14.1667V6.666H15.8334Z"
      android:fillColor="#000000"/>
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24">
  <path
      android:pathData="M5,4C5,2.343 6.343,1 8,1L16,1C17.657,1 19,2.343 19,4L19,20C19,21.657 17.657,23 16,23L8,23C6.343,23 5,21.657 5,20L5,4ZM8,3C7.448,3 7,3.448 7,4L7,20C7,20.552 7.448,21 8,21L16,21C16.552,21 17,20.552 17,20L17,4C17,3.448 16.552,3 16,3L8,3ZM8,4L8,8L9.5,8L9.5,5.5L12,5.5L12,4L8,4ZM16,16L16,20L12,20L12,18.5L14.5,18.5L14.5,16L16,16Z"
      android:fillColor="@color/overview_button"
      android:fillType="evenOdd"/>
</vector>
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
-->
<com.android.launcher3.LauncherRootView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/launcher"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">
+13 −10
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
    <LinearLayout
        android:id="@+id/action_buttons"
        android:layout_width="match_parent"
        android:layout_height="@dimen/overview_actions_height"
        android:layout_height="@dimen/overview_actions_size"
        android:layout_gravity="bottom|center_horizontal"
        android:orientation="horizontal">

@@ -31,13 +31,14 @@
            android:layout_height="1dp"
            android:layout_weight="1" />

        <Button
        <ImageButton
            android:id="@+id/action_screenshot"
            style="@style/OverviewActionButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:drawableStart="@drawable/ic_screenshot"
            android:text="@string/action_screenshot"
            android:layout_width="@dimen/overview_actions_size"
            android:layout_height="@dimen/overview_actions_size"
            android:gravity="center"
            android:src="@drawable/ic_screenshot"
            android:contentDescription="@string/action_screenshot"
            android:theme="@style/ThemeControlHighlightWorkspaceColor" />

        <Space
@@ -46,12 +47,14 @@
            android:layout_height="1dp"
            android:visibility="gone" />

        <Button
        <ImageButton
            android:id="@+id/action_split"
            style="@style/OverviewActionButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/action_split"
            android:layout_width="@dimen/overview_actions_size"
            android:layout_height="@dimen/overview_actions_size"
            android:gravity="center"
            android:src="@drawable/ic_split_vertical"
            android:contentDescription="@string/action_split"
            android:theme="@style/ThemeControlHighlightWorkspaceColor"
            android:visibility="gone" />

+3 −1
Original line number Diff line number Diff line
@@ -50,8 +50,10 @@

    <!-- Overrideable in overlay that provides the Overview Actions. -->
    <dimen name="overview_actions_top_margin">24dp</dimen>
    <dimen name="overview_actions_height">48dp</dimen>
    <dimen name="overview_actions_size">60dp</dimen>
    <dimen name="overview_actions_button_spacing">36dp</dimen>
    <!-- 12dp + 156dp floating search pill width (note this is in addition to normal 36dp) -->
    <dimen name="overview_actions_additional_floating_search_spacing">168dp</dimen>

    <!-- These speeds are in dp/s -->
    <dimen name="max_task_dismiss_drag_velocity">2.25dp</dimen>
+3 −8
Original line number Diff line number Diff line
@@ -221,15 +221,10 @@
        <item name="android:colorControlHighlight">?attr/workspaceTextColor</item>
    </style>

    <style name="OverviewActionButton"
        parent="@android:style/Widget.DeviceDefault.Button.Borderless">
        <item name="android:paddingTop">4dp</item>
        <item name="android:paddingBottom">4dp</item>
        <item name="android:textColor">@color/overview_button</item>
    <style name="OverviewActionButton" parent="@android:style/Widget.DeviceDefault.ImageButton">
        <item name="android:background">@drawable/circle_btn_bg</item>
        <item name="android:backgroundTint">?androidprv:attr/materialColorSurfaceBright</item>
        <item name="android:drawableTint">@color/overview_button</item>
        <item name="android:tint">?android:attr/textColorPrimary</item>
        <item name="android:drawablePadding">8dp</item>
        <item name="android:textAllCaps">false</item>
    </style>

    <style name="OverviewClearAllButton" parent="@android:style/Widget.DeviceDefault.Button">
Loading