blob: f72c55615cb59b0af527b78a4dd39845d71df488 [file] [log] [blame]
Sunny Goyal740ac7f2016-09-28 16:47:32 -07001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.launcher3;
18
Sunny Goyaleaf7a952020-07-29 16:54:20 -070019import static android.animation.ValueAnimator.areAnimatorsEnabled;
Sunny Goyalde753212018-05-15 13:55:57 -070020import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED;
21import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;
Tony Wickham9791bd12019-04-05 13:52:35 -070022
Sunny Goyalde753212018-05-15 13:55:57 -070023import static com.android.launcher3.compat.AccessibilityManagerCompat.isAccessibilityEnabled;
24import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent;
25
Tony Wickham50e51652017-03-20 17:12:24 -070026import android.annotation.SuppressLint;
Fengjiang Lib7860bd2023-03-15 10:50:50 -070027import android.annotation.TargetApi;
Sunny Goyal740ac7f2016-09-28 16:47:32 -070028import android.content.Context;
Fengjiang Lib7860bd2023-03-15 10:50:50 -070029import android.os.Build;
Sunny Goyal740ac7f2016-09-28 16:47:32 -070030import android.util.AttributeSet;
Sunny Goyalde753212018-05-15 13:55:57 -070031import android.util.Pair;
Tony Wickham50e51652017-03-20 17:12:24 -070032import android.view.MotionEvent;
Sunny Goyal740ac7f2016-09-28 16:47:32 -070033import android.view.View;
Pinyao Ting52d02522019-09-27 16:29:32 -070034import android.view.accessibility.AccessibilityNodeInfo;
Sunny Goyalf3ac7032020-03-13 13:01:33 -070035import android.view.animation.Interpolator;
Sunny Goyal740ac7f2016-09-28 16:47:32 -070036import android.widget.LinearLayout;
Fengjiang Lib7860bd2023-03-15 10:50:50 -070037import android.window.OnBackAnimationCallback;
Sunny Goyal740ac7f2016-09-28 16:47:32 -070038
Tony Wickham9791bd12019-04-05 13:52:35 -070039import androidx.annotation.IntDef;
Tony Wickham9791bd12019-04-05 13:52:35 -070040
Sunny Goyalf3ac7032020-03-13 13:01:33 -070041import com.android.launcher3.anim.PendingAnimation;
Sunny Goyal37920962017-09-28 13:43:24 -070042import com.android.launcher3.util.TouchController;
Sunny Goyal87b5eb62018-07-03 15:53:39 -070043import com.android.launcher3.views.ActivityContext;
Sunny Goyal0b0847b2018-03-14 12:30:11 -070044import com.android.launcher3.views.BaseDragLayer;
Sunny Goyal740ac7f2016-09-28 16:47:32 -070045
46import java.lang.annotation.Retention;
47import java.lang.annotation.RetentionPolicy;
48
49/**
50 * Base class for a View which shows a floating UI on top of the launcher UI.
51 */
Fengjiang Lib7860bd2023-03-15 10:50:50 -070052@TargetApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
Fengjiang Li6bb8d792023-01-12 16:20:58 -080053public abstract class AbstractFloatingView extends LinearLayout implements TouchController,
Fengjiang Lib7860bd2023-03-15 10:50:50 -070054 OnBackAnimationCallback {
Sunny Goyal740ac7f2016-09-28 16:47:32 -070055
Tony Wickham50e51652017-03-20 17:12:24 -070056 @IntDef(flag = true, value = {
57 TYPE_FOLDER,
Sunny Goyal10a1bd02017-10-09 14:56:21 -070058 TYPE_ACTION_POPUP,
Sunny Goyal37920962017-09-28 13:43:24 -070059 TYPE_WIDGETS_BOTTOM_SHEET,
Sunny Goyalf1fbc3f2017-10-10 15:21:15 -070060 TYPE_WIDGET_RESIZE_FRAME,
Sunny Goyalf8088ee2017-11-10 14:52:00 -080061 TYPE_WIDGETS_FULL_SHEET,
Tony Wickham2fae2a02017-12-14 18:38:25 -080062 TYPE_ON_BOARD_POPUP,
Vadim Tryshev17839d52018-05-23 14:45:56 -070063 TYPE_DISCOVERY_BOUNCE,
Tony Wickham6a71a5b2018-08-21 11:40:23 -070064 TYPE_SNACKBAR,
Jon Mirandade0093d2019-04-16 20:53:24 -070065 TYPE_LISTENER,
Jon Miranda517cec52020-05-19 14:04:59 -070066 TYPE_ALL_APPS_EDU,
Sunny Goyal384b5782021-02-09 22:50:02 -080067 TYPE_DRAG_DROP_POPUP,
Sunny Goyal02424b22018-01-19 11:24:32 -080068 TYPE_TASK_MENU,
Sunny Goyal30ac97d2020-06-24 23:47:46 -070069 TYPE_OPTIONS_POPUP,
Alina Zaidid80cec62021-05-13 14:13:18 +010070 TYPE_ICON_SURFACE,
Sunny Goyala992ac92023-01-10 17:50:32 -080071 TYPE_OPTIONS_POPUP_DIALOG,
Alina Zaidif2c79de2021-05-27 14:55:21 +010072 TYPE_PIN_WIDGET_FROM_EXTERNAL_POPUP,
Andy Wickham13f3ffe2021-07-30 16:00:20 -100073 TYPE_WIDGETS_EDUCATION_DIALOG,
Brian Isganitis9e80fb32022-01-26 19:20:13 -050074 TYPE_TASKBAR_EDUCATION_DIALOG,
Brian Isganitis7ef4fe42022-04-07 16:29:44 -070075 TYPE_TASKBAR_ALL_APPS,
Sunny Goyala992ac92023-01-10 17:50:32 -080076 TYPE_ADD_TO_HOME_CONFIRMATION,
Jagrut Desaic6d625b2023-04-03 16:57:32 -070077 TYPE_TASKBAR_OVERLAY_PROXY,
78 TYPE_TASKBAR_PINNING_POPUP
Tony Wickham50e51652017-03-20 17:12:24 -070079 })
Sunny Goyal740ac7f2016-09-28 16:47:32 -070080 @Retention(RetentionPolicy.SOURCE)
81 public @interface FloatingViewType {}
82 public static final int TYPE_FOLDER = 1 << 0;
Sunny Goyal10a1bd02017-10-09 14:56:21 -070083 public static final int TYPE_ACTION_POPUP = 1 << 1;
Tony Wickham343a77e2017-04-12 18:31:09 -070084 public static final int TYPE_WIDGETS_BOTTOM_SHEET = 1 << 2;
Sunny Goyal37920962017-09-28 13:43:24 -070085 public static final int TYPE_WIDGET_RESIZE_FRAME = 1 << 3;
Sunny Goyalf1fbc3f2017-10-10 15:21:15 -070086 public static final int TYPE_WIDGETS_FULL_SHEET = 1 << 4;
Sunny Goyal02424b22018-01-19 11:24:32 -080087 public static final int TYPE_ON_BOARD_POPUP = 1 << 5;
Vadim Tryshev17839d52018-05-23 14:45:56 -070088 public static final int TYPE_DISCOVERY_BOUNCE = 1 << 6;
Tony Wickham6a71a5b2018-08-21 11:40:23 -070089 public static final int TYPE_SNACKBAR = 1 << 7;
Jon Mirandade0093d2019-04-16 20:53:24 -070090 public static final int TYPE_LISTENER = 1 << 8;
Jon Miranda517cec52020-05-19 14:04:59 -070091 public static final int TYPE_ALL_APPS_EDU = 1 << 9;
Sunny Goyala4647b62021-02-02 13:45:34 -080092 public static final int TYPE_DRAG_DROP_POPUP = 1 << 10;
Sunny Goyal02424b22018-01-19 11:24:32 -080093
94 // Popups related to quickstep UI
Sunny Goyala4647b62021-02-02 13:45:34 -080095 public static final int TYPE_TASK_MENU = 1 << 11;
96 public static final int TYPE_OPTIONS_POPUP = 1 << 12;
97 public static final int TYPE_ICON_SURFACE = 1 << 13;
Sunny Goyala992ac92023-01-10 17:50:32 -080098 public static final int TYPE_OPTIONS_POPUP_DIALOG = 1 << 14;
Sunny Goyalf1fbc3f2017-10-10 15:21:15 -070099
Sunny Goyala992ac92023-01-10 17:50:32 -0800100 public static final int TYPE_PIN_WIDGET_FROM_EXTERNAL_POPUP = 1 << 15;
101 public static final int TYPE_WIDGETS_EDUCATION_DIALOG = 1 << 16;
102 public static final int TYPE_TASKBAR_EDUCATION_DIALOG = 1 << 17;
103 public static final int TYPE_TASKBAR_ALL_APPS = 1 << 18;
104 public static final int TYPE_ADD_TO_HOME_CONFIRMATION = 1 << 19;
105 public static final int TYPE_TASKBAR_OVERLAY_PROXY = 1 << 20;
Jagrut Desaic6d625b2023-04-03 16:57:32 -0700106 public static final int TYPE_TASKBAR_PINNING_POPUP = 1 << 21;
Brian Isganitisa2b32952023-11-30 13:27:28 -0500107 public static final int TYPE_PIN_IME_POPUP = 1 << 22;
Alina Zaidid80cec62021-05-13 14:13:18 +0100108
Sunny Goyalf1fbc3f2017-10-10 15:21:15 -0700109 public static final int TYPE_ALL = TYPE_FOLDER | TYPE_ACTION_POPUP
Sunny Goyalf8088ee2017-11-10 14:52:00 -0800110 | TYPE_WIDGETS_BOTTOM_SHEET | TYPE_WIDGET_RESIZE_FRAME | TYPE_WIDGETS_FULL_SHEET
Sunny Goyal462551b2019-02-18 14:42:47 -0800111 | TYPE_ON_BOARD_POPUP | TYPE_DISCOVERY_BOUNCE | TYPE_TASK_MENU
Sunny Goyal30ac97d2020-06-24 23:47:46 -0700112 | TYPE_OPTIONS_POPUP | TYPE_SNACKBAR | TYPE_LISTENER | TYPE_ALL_APPS_EDU
Alina Zaidif2c79de2021-05-27 14:55:21 +0100113 | TYPE_ICON_SURFACE | TYPE_DRAG_DROP_POPUP | TYPE_PIN_WIDGET_FROM_EXTERNAL_POPUP
Brian Isganitis7ef4fe42022-04-07 16:29:44 -0700114 | TYPE_WIDGETS_EDUCATION_DIALOG | TYPE_TASKBAR_EDUCATION_DIALOG | TYPE_TASKBAR_ALL_APPS
Brian Isganitis589c8d32022-11-17 20:08:05 +0000115 | TYPE_OPTIONS_POPUP_DIALOG | TYPE_ADD_TO_HOME_CONFIRMATION
Brian Isganitisa2b32952023-11-30 13:27:28 -0500116 | TYPE_TASKBAR_OVERLAY_PROXY | TYPE_TASKBAR_PINNING_POPUP | TYPE_PIN_IME_POPUP;
Sunny Goyal740ac7f2016-09-28 16:47:32 -0700117
Sunny Goyal7ede6112017-12-05 15:11:21 -0800118 // Type of popups which should be kept open during launcher rebind
119 public static final int TYPE_REBIND_SAFE = TYPE_WIDGETS_FULL_SHEET
Jon Miranda517cec52020-05-19 14:04:59 -0700120 | TYPE_WIDGETS_BOTTOM_SHEET | TYPE_ON_BOARD_POPUP | TYPE_DISCOVERY_BOUNCE
Andy Wickham13f3ffe2021-07-30 16:00:20 -1000121 | TYPE_ALL_APPS_EDU | TYPE_ICON_SURFACE | TYPE_WIDGETS_EDUCATION_DIALOG
Brian Isganitis589c8d32022-11-17 20:08:05 +0000122 | TYPE_TASKBAR_EDUCATION_DIALOG | TYPE_TASKBAR_ALL_APPS | TYPE_OPTIONS_POPUP_DIALOG
Brian Isganitisa2b32952023-11-30 13:27:28 -0500123 | TYPE_TASKBAR_OVERLAY_PROXY | TYPE_PIN_IME_POPUP;
Sunny Goyal7ede6112017-12-05 15:11:21 -0800124
Brian Isganitisa2b32952023-11-30 13:27:28 -0500125 /** Type of popups that should get exclusive accessibility focus. */
Jon Miranda517cec52020-05-19 14:04:59 -0700126 public static final int TYPE_ACCESSIBLE = TYPE_ALL & ~TYPE_DISCOVERY_BOUNCE & ~TYPE_LISTENER
Brian Isganitisa2b32952023-11-30 13:27:28 -0500127 & ~TYPE_ALL_APPS_EDU & ~TYPE_TASKBAR_ALL_APPS & ~TYPE_PIN_IME_POPUP;
Tony Wickhamdf1eb8b2018-04-12 17:26:18 -0700128
Hyunyoung Songf58cf5e2018-09-19 16:06:16 -0700129 // These view all have particular operation associated with swipe down interaction.
130 public static final int TYPE_STATUS_BAR_SWIPE_DOWN_DISALLOW = TYPE_WIDGETS_BOTTOM_SHEET |
131 TYPE_WIDGETS_FULL_SHEET | TYPE_WIDGET_RESIZE_FRAME | TYPE_ON_BOARD_POPUP |
Sunny Goyala4647b62021-02-02 13:45:34 -0800132 TYPE_DISCOVERY_BOUNCE | TYPE_TASK_MENU | TYPE_DRAG_DROP_POPUP;
Hyunyoung Songf58cf5e2018-09-19 16:06:16 -0700133
Brian Isganitise41faf52023-04-12 14:16:25 -0400134 // Floating views that are exclusive to the taskbar overlay window.
135 public static final int TYPE_TASKBAR_OVERLAYS =
136 TYPE_TASKBAR_ALL_APPS | TYPE_TASKBAR_EDUCATION_DIALOG;
137
Brian Isganitis7eae1e62023-12-11 21:27:50 +0000138 // Floating views that a TouchController should not try to intercept touches from.
139 public static final int TYPE_TOUCH_CONTROLLER_NO_INTERCEPT = TYPE_ALL & ~TYPE_DISCOVERY_BOUNCE
140 & ~TYPE_LISTENER & ~TYPE_TASKBAR_OVERLAYS;
141
Brian Isganitisa2b32952023-11-30 13:27:28 -0500142 public static final int TYPE_ALL_EXCEPT_ON_BOARD_POPUP = TYPE_ALL & ~TYPE_ON_BOARD_POPUP
143 & ~TYPE_PIN_IME_POPUP;
Pat Manningda696612023-02-17 15:06:58 +0000144
Sunny Goyal740ac7f2016-09-28 16:47:32 -0700145 protected boolean mIsOpen;
146
147 public AbstractFloatingView(Context context, AttributeSet attrs) {
148 super(context, attrs);
149 }
150
151 public AbstractFloatingView(Context context, AttributeSet attrs, int defStyleAttr) {
152 super(context, attrs, defStyleAttr);
153 }
154
Tony Wickham50e51652017-03-20 17:12:24 -0700155 /**
156 * We need to handle touch events to prevent them from falling through to the workspace below.
157 */
158 @SuppressLint("ClickableViewAccessibility")
159 @Override
160 public boolean onTouchEvent(MotionEvent ev) {
161 return true;
162 }
163
Sunny Goyal740ac7f2016-09-28 16:47:32 -0700164 public final void close(boolean animate) {
Sunny Goyaleaf7a952020-07-29 16:54:20 -0700165 animate &= areAnimatorsEnabled();
Hyunyoung Songbd6fba92018-05-16 15:54:31 -0700166 if (mIsOpen) {
Hyunyoung Song6b670d62020-08-22 23:24:43 -0700167 // Add to WW logging
Hyunyoung Songbd6fba92018-05-16 15:54:31 -0700168 }
Sunny Goyal740ac7f2016-09-28 16:47:32 -0700169 handleClose(animate);
Jon Miranda83337f92018-04-24 12:21:28 -0700170 mIsOpen = false;
Sunny Goyal740ac7f2016-09-28 16:47:32 -0700171 }
172
173 protected abstract void handleClose(boolean animate);
174
Tony Wickham9791bd12019-04-05 13:52:35 -0700175 /**
176 * Creates a user-controlled animation to hint that the view will be closed if completed.
177 * @param distanceToMove The max distance that elements should move from their starting point.
178 */
Sunny Goyalf3ac7032020-03-13 13:01:33 -0700179 public void addHintCloseAnim(
180 float distanceToMove, Interpolator interpolator, PendingAnimation target) { }
Tony Wickham9791bd12019-04-05 13:52:35 -0700181
Sunny Goyal740ac7f2016-09-28 16:47:32 -0700182 public final boolean isOpen() {
183 return mIsOpen;
184 }
185
186 protected abstract boolean isOfType(@FloatingViewType int type);
187
Fengjiang Li6bb8d792023-01-12 16:20:58 -0800188 /** Return true if this view can consume back press. */
189 public boolean canHandleBack() {
Tony Wickham52c1b662018-05-21 13:13:58 -0700190 return true;
Sunny Goyal37920962017-09-28 13:43:24 -0700191 }
192
193 @Override
Fengjiang Li6bb8d792023-01-12 16:20:58 -0800194 public void onBackInvoked() {
195 close(true);
196 }
197
198 @Override
Sunny Goyal37920962017-09-28 13:43:24 -0700199 public boolean onControllerTouchEvent(MotionEvent ev) {
200 return false;
201 }
202
Sunny Goyalde753212018-05-15 13:55:57 -0700203 protected void announceAccessibilityChanges() {
204 Pair<View, String> targetInfo = getAccessibilityTarget();
205 if (targetInfo == null || !isAccessibilityEnabled(getContext())) {
206 return;
207 }
208 sendCustomAccessibilityEvent(
209 targetInfo.first, TYPE_WINDOW_STATE_CHANGED, targetInfo.second);
210
211 if (mIsOpen) {
Andy Wickhambc83edb2020-05-27 12:58:40 -0700212 getAccessibilityInitialFocusView().performAccessibilityAction(
213 AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS, null);
Sunny Goyalde753212018-05-15 13:55:57 -0700214 }
Sunny Goyal87b5eb62018-07-03 15:53:39 -0700215 ActivityContext.lookupContext(getContext()).getDragLayer()
Sunny Goyalde753212018-05-15 13:55:57 -0700216 .sendAccessibilityEvent(TYPE_WINDOW_CONTENT_CHANGED);
217 }
218
219 protected Pair<View, String> getAccessibilityTarget() {
220 return null;
221 }
222
Andy Wickhambc83edb2020-05-27 12:58:40 -0700223 /** Returns the View that Accessibility services should focus on first. */
224 protected View getAccessibilityInitialFocusView() {
225 return this;
226 }
227
Samuel Fufa82bbdac2020-03-09 18:24:47 -0700228 /**
Tony Wickhamd5e116a2021-09-14 17:48:14 -0700229 * Returns a view matching FloatingViewType and {@link #isOpen()} == true.
Samuel Fufa82bbdac2020-03-09 18:24:47 -0700230 */
231 public static <T extends AbstractFloatingView> T getOpenView(
Sunny Goyal87b5eb62018-07-03 15:53:39 -0700232 ActivityContext activity, @FloatingViewType int type) {
Tony Wickhamd5e116a2021-09-14 17:48:14 -0700233 return getView(activity, type, true /* mustBeOpen */);
234 }
235
236 /**
Tony Wickhamf286f9c2022-04-20 14:43:39 -0700237 * Returns whether there is at least one view of the given type where {@link #isOpen()} == true.
238 */
239 public static boolean hasOpenView(ActivityContext activity, @FloatingViewType int type) {
240 return getOpenView(activity, type) != null;
241 }
242
243 /**
Tony Wickhamd5e116a2021-09-14 17:48:14 -0700244 * Returns a view matching FloatingViewType, and {@link #isOpen()} may be false (if animating
245 * closed).
246 */
247 public static <T extends AbstractFloatingView> T getAnyView(
248 ActivityContext activity, @FloatingViewType int type) {
249 return getView(activity, type, false /* mustBeOpen */);
250 }
251
252 private static <T extends AbstractFloatingView> T getView(
253 ActivityContext activity, @FloatingViewType int type, boolean mustBeOpen) {
Sunny Goyal0b0847b2018-03-14 12:30:11 -0700254 BaseDragLayer dragLayer = activity.getDragLayer();
vadimt5a22ef72019-04-17 18:39:00 -0700255 if (dragLayer == null) return null;
Sunny Goyal740ac7f2016-09-28 16:47:32 -0700256 // Iterate in reverse order. AbstractFloatingView is added later to the dragLayer,
257 // and will be one of the last views.
258 for (int i = dragLayer.getChildCount() - 1; i >= 0; i--) {
259 View child = dragLayer.getChildAt(i);
260 if (child instanceof AbstractFloatingView) {
261 AbstractFloatingView view = (AbstractFloatingView) child;
Tony Wickhamd5e116a2021-09-14 17:48:14 -0700262 if (view.isOfType(type) && (!mustBeOpen || view.isOpen())) {
Sunny Goyal740ac7f2016-09-28 16:47:32 -0700263 return (T) view;
264 }
265 }
266 }
267 return null;
268 }
269
Sunny Goyal87b5eb62018-07-03 15:53:39 -0700270 public static void closeOpenContainer(ActivityContext activity,
Sunny Goyal0b0847b2018-03-14 12:30:11 -0700271 @FloatingViewType int type) {
272 AbstractFloatingView view = getOpenView(activity, type);
Sunny Goyal740ac7f2016-09-28 16:47:32 -0700273 if (view != null) {
274 view.close(true);
275 }
276 }
277
Sunny Goyal87b5eb62018-07-03 15:53:39 -0700278 public static void closeOpenViews(ActivityContext activity, boolean animate,
Sunny Goyalf1fbc3f2017-10-10 15:21:15 -0700279 @FloatingViewType int type) {
Sunny Goyal0b0847b2018-03-14 12:30:11 -0700280 BaseDragLayer dragLayer = activity.getDragLayer();
Sunny Goyal740ac7f2016-09-28 16:47:32 -0700281 // Iterate in reverse order. AbstractFloatingView is added later to the dragLayer,
282 // and will be one of the last views.
283 for (int i = dragLayer.getChildCount() - 1; i >= 0; i--) {
284 View child = dragLayer.getChildAt(i);
285 if (child instanceof AbstractFloatingView) {
Sunny Goyalf1fbc3f2017-10-10 15:21:15 -0700286 AbstractFloatingView abs = (AbstractFloatingView) child;
287 if (abs.isOfType(type)) {
288 abs.close(animate);
289 }
Sunny Goyal740ac7f2016-09-28 16:47:32 -0700290 }
291 }
292 }
293
Sunny Goyal87b5eb62018-07-03 15:53:39 -0700294 public static void closeAllOpenViews(ActivityContext activity, boolean animate) {
Sunny Goyal0b0847b2018-03-14 12:30:11 -0700295 closeOpenViews(activity, animate, TYPE_ALL);
296 activity.finishAutoCancelActionMode();
Sunny Goyalf1fbc3f2017-10-10 15:21:15 -0700297 }
298
Sunny Goyal87b5eb62018-07-03 15:53:39 -0700299 public static void closeAllOpenViews(ActivityContext activity) {
Sunny Goyal0b0847b2018-03-14 12:30:11 -0700300 closeAllOpenViews(activity, true);
Sunny Goyal740ac7f2016-09-28 16:47:32 -0700301 }
302
Tracy Zhoud43e7c22018-10-16 14:49:55 -0700303 public static void closeAllOpenViewsExcept(ActivityContext activity, boolean animate,
304 @FloatingViewType int type) {
305 closeOpenViews(activity, animate, TYPE_ALL & ~type);
306 activity.finishAutoCancelActionMode();
307 }
308
309 public static void closeAllOpenViewsExcept(ActivityContext activity,
310 @FloatingViewType int type) {
311 closeAllOpenViewsExcept(activity, true, type);
312 }
313
Sunny Goyal87b5eb62018-07-03 15:53:39 -0700314 public static AbstractFloatingView getTopOpenView(ActivityContext activity) {
Tony Wickhamdf1eb8b2018-04-12 17:26:18 -0700315 return getTopOpenViewWithType(activity, TYPE_ALL);
316 }
317
Sunny Goyal87b5eb62018-07-03 15:53:39 -0700318 public static AbstractFloatingView getTopOpenViewWithType(ActivityContext activity,
Tony Wickhamdf1eb8b2018-04-12 17:26:18 -0700319 @FloatingViewType int type) {
320 return getOpenView(activity, type);
Sunny Goyal740ac7f2016-09-28 16:47:32 -0700321 }
vadimt34cc5f42020-06-04 13:38:17 -0700322
323 public boolean canInterceptEventsInSystemGestureRegion() {
324 return false;
325 }
Sunny Goyal740ac7f2016-09-28 16:47:32 -0700326}