diff options
author | Tony Wickham <twickham@google.com> | 2017-03-20 17:12:24 -0700 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2017-03-30 15:48:53 -0700 |
commit | 50e5165b78c75ccb022f0954699f49c579547115 (patch) | |
tree | 754a3dfe45fbed74cb3b122312304cf406226ebf /src/com/android/launcher3/AbstractFloatingView.java | |
parent | 8eb0de133154666cd20d0244953ee755b626b44a (diff) | |
download | android_packages_apps_Trebuchet-50e5165b78c75ccb022f0954699f49c579547115.tar.gz android_packages_apps_Trebuchet-50e5165b78c75ccb022f0954699f49c579547115.tar.bz2 android_packages_apps_Trebuchet-50e5165b78c75ccb022f0954699f49c579547115.zip |
Add WidgetsAndMore bottom sheet
- Contains two rows, one for widgets, and one for "configurable
shortcuts" that have customization activities
- Extends AbstractFloatingView and uses VerticalPullDetector for
touch interactions
- No way to show this currently; will add options to popup in followup
Bug: 34940468
Change-Id: Iab62c2cb89428f91119c9c86f9db886496c321fd
Diffstat (limited to 'src/com/android/launcher3/AbstractFloatingView.java')
-rw-r--r-- | src/com/android/launcher3/AbstractFloatingView.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/com/android/launcher3/AbstractFloatingView.java b/src/com/android/launcher3/AbstractFloatingView.java index bd1268651..dbef05411 100644 --- a/src/com/android/launcher3/AbstractFloatingView.java +++ b/src/com/android/launcher3/AbstractFloatingView.java @@ -16,9 +16,11 @@ package com.android.launcher3; +import android.annotation.SuppressLint; import android.content.Context; import android.support.annotation.IntDef; import android.util.AttributeSet; +import android.view.MotionEvent; import android.view.View; import android.widget.LinearLayout; @@ -32,11 +34,16 @@ import java.lang.annotation.RetentionPolicy; */ public abstract class AbstractFloatingView extends LinearLayout { - @IntDef(flag = true, value = {TYPE_FOLDER, TYPE_POPUP_CONTAINER_WITH_ARROW}) + @IntDef(flag = true, value = { + TYPE_FOLDER, + TYPE_POPUP_CONTAINER_WITH_ARROW, + TYPE_WIDGETS_AND_MORE + }) @Retention(RetentionPolicy.SOURCE) public @interface FloatingViewType {} public static final int TYPE_FOLDER = 1 << 0; public static final int TYPE_POPUP_CONTAINER_WITH_ARROW = 1 << 1; + public static final int TYPE_WIDGETS_AND_MORE = 1 << 2; protected boolean mIsOpen; @@ -48,6 +55,15 @@ public abstract class AbstractFloatingView extends LinearLayout { super(context, attrs, defStyleAttr); } + /** + * We need to handle touch events to prevent them from falling through to the workspace below. + */ + @SuppressLint("ClickableViewAccessibility") + @Override + public boolean onTouchEvent(MotionEvent ev) { + return true; + } + public final void close(boolean animate) { animate &= !Utilities.isPowerSaverOn(getContext()); handleClose(animate); @@ -119,7 +135,8 @@ public abstract class AbstractFloatingView extends LinearLayout { } public static AbstractFloatingView getTopOpenView(Launcher launcher) { - return getOpenView(launcher, TYPE_FOLDER | TYPE_POPUP_CONTAINER_WITH_ARROW); + return getOpenView(launcher, TYPE_FOLDER | TYPE_POPUP_CONTAINER_WITH_ARROW + | TYPE_WIDGETS_AND_MORE); } public abstract int getLogContainerType(); |