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

Commit 1ccaacdd authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add undo snackbar for deleting items" into ub-launcher3-master

parents 46e81de3 6a71a5bd
Loading
Loading
Loading
Loading
+41 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2018 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.
-->

<merge xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <TextView
        android:id="@+id/label"
        android:layout_height="@dimen/snackbar_content_height"
        android:layout_width="0dp"
        android:layout_weight="1"
        android:gravity="center_vertical"
        android:paddingLeft="8dp"
        android:paddingRight="8dp"
        android:textSize="14sp"
        android:textColor="?android:attr/textColorPrimary"/>
    <TextView
        android:id="@+id/action"
        android:layout_height="@dimen/snackbar_content_height"
        android:layout_width="wrap_content"
        android:layout_weight="0"
        android:gravity="center"
        android:padding="8dp"
        android:background="?android:attr/selectableItemBackground"
        android:textStyle="bold"
        android:textColor="?android:attr/textColorPrimary"
        android:textAllCaps="true"/>
</merge>
 No newline at end of file
+6 −0
Original line number Diff line number Diff line
@@ -225,4 +225,10 @@
<!-- Overview -->
    <dimen name="options_menu_icon_size">24dp</dimen>
    <dimen name="options_menu_thumb_size">32dp</dimen>

<!-- Snackbar -->
    <dimen name="snackbar_height">48dp</dimen>
    <dimen name="snackbar_content_height">32dp</dimen>
    <dimen name="snackbar_padding">8dp</dimen>
    <dimen name="snackbar_margin">16dp</dimen>
</resources>
+4 −1
Original line number Diff line number Diff line
@@ -259,9 +259,12 @@
    <!-- Accessibility confirmation for item added to workspace. -->
    <string name="item_added_to_workspace">Item added to home screen</string>

    <!-- Accessibility confirmation for item removed. -->
    <!-- Accessibility confirmation for item removed. [CHAR_LIMIT=50]-->
    <string name="item_removed">Item removed</string>

    <!-- Action shown in snackbar to undo item removal. [CHAR_LIMIT=15] -->
    <string name="undo">Undo</string>

    <!-- Accessibility action to move an item on the workspace. [CHAR_LIMIT=30] -->
    <string name="action_move">Move item</string>

+8 −6
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.launcher3;
import static android.view.accessibility.AccessibilityEvent.TYPE_VIEW_FOCUSED;
import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED;
import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;

import static com.android.launcher3.compat.AccessibilityManagerCompat.isAccessibilityEnabled;
import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent;

@@ -54,6 +53,7 @@ public abstract class AbstractFloatingView extends LinearLayout implements Touch
            TYPE_WIDGETS_FULL_SHEET,
            TYPE_ON_BOARD_POPUP,
            TYPE_DISCOVERY_BOUNCE,
            TYPE_SNACKBAR,

            TYPE_QUICKSTEP_PREVIEW,
            TYPE_TASK_MENU,
@@ -68,23 +68,25 @@ public abstract class AbstractFloatingView extends LinearLayout implements Touch
    public static final int TYPE_WIDGETS_FULL_SHEET = 1 << 4;
    public static final int TYPE_ON_BOARD_POPUP = 1 << 5;
    public static final int TYPE_DISCOVERY_BOUNCE = 1 << 6;
    public static final int TYPE_SNACKBAR = 1 << 7;

    // Popups related to quickstep UI
    public static final int TYPE_QUICKSTEP_PREVIEW = 1 << 7;
    public static final int TYPE_TASK_MENU = 1 << 8;
    public static final int TYPE_OPTIONS_POPUP = 1 << 9;
    public static final int TYPE_QUICKSTEP_PREVIEW = 1 << 8;
    public static final int TYPE_TASK_MENU = 1 << 9;
    public static final int TYPE_OPTIONS_POPUP = 1 << 10;

    public static final int TYPE_ALL = TYPE_FOLDER | TYPE_ACTION_POPUP
            | TYPE_WIDGETS_BOTTOM_SHEET | TYPE_WIDGET_RESIZE_FRAME | TYPE_WIDGETS_FULL_SHEET
            | TYPE_QUICKSTEP_PREVIEW | TYPE_ON_BOARD_POPUP | TYPE_DISCOVERY_BOUNCE | TYPE_TASK_MENU
            | TYPE_OPTIONS_POPUP;
            | TYPE_OPTIONS_POPUP | TYPE_SNACKBAR;

    // Type of popups which should be kept open during launcher rebind
    public static final int TYPE_REBIND_SAFE = TYPE_WIDGETS_FULL_SHEET
            | TYPE_QUICKSTEP_PREVIEW | TYPE_ON_BOARD_POPUP | TYPE_DISCOVERY_BOUNCE;

    // Usually we show the back button when a floating view is open. Instead, hide for these types.
    public static final int TYPE_HIDE_BACK_BUTTON = TYPE_ON_BOARD_POPUP | TYPE_DISCOVERY_BOUNCE;
    public static final int TYPE_HIDE_BACK_BUTTON = TYPE_ON_BOARD_POPUP | TYPE_DISCOVERY_BOUNCE
            | TYPE_SNACKBAR;

    public static final int TYPE_ACCESSIBLE = TYPE_ALL
            & ~TYPE_DISCOVERY_BOUNCE & ~TYPE_QUICKSTEP_PREVIEW;
+0 −1
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.launcher3;

import static com.android.launcher3.util.SystemUiController.UI_STATE_OVERVIEW;

import static java.lang.annotation.RetentionPolicy.SOURCE;

import android.app.Activity;
Loading