blob: 52257319f3faa0de23c8a877515855d971e82cb1 [file] [log] [blame]
Sunny Goyal47328fd2016-05-25 18:56:41 -07001/*
2 * Copyright (C) 2011 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 Goyald1b3f5c2018-01-18 17:14:05 -080019import static com.android.launcher3.ButtonDropTarget.TOOLTIP_DEFAULT;
Sunny Goyal7185dd62018-03-14 17:51:49 -070020import static com.android.launcher3.anim.AlphaUpdateListener.updateVisibility;
Federico Baron626d51c2022-10-25 14:49:24 -070021import static com.android.launcher3.config.FeatureFlags.HOME_GARDENING_WORKSPACE_BUTTONS;
Sunny Goyal0236d0b2017-10-24 14:54:30 -070022
Sunny Goyal47328fd2016-05-25 18:56:41 -070023import android.animation.TimeInterpolator;
24import android.content.Context;
Sunny Goyal07b69292018-01-08 14:19:34 -080025import android.graphics.Rect;
Sunny Goyal47328fd2016-05-25 18:56:41 -070026import android.util.AttributeSet;
vadimt89d94232021-09-01 12:33:00 -070027import android.util.Log;
Alex Chaua02eddc2021-04-29 00:36:06 +010028import android.util.TypedValue;
Sunny Goyal07b69292018-01-08 14:19:34 -080029import android.view.Gravity;
Sunny Goyal47328fd2016-05-25 18:56:41 -070030import android.view.View;
31import android.view.ViewDebug;
32import android.view.ViewPropertyAnimator;
Sunny Goyal07b69292018-01-08 14:19:34 -080033import android.widget.FrameLayout;
Sunny Goyal47328fd2016-05-25 18:56:41 -070034
vadimt89d94232021-09-01 12:33:00 -070035import androidx.annotation.NonNull;
36
Sunny Goyal5bc6b6f2017-10-26 15:36:10 -070037import com.android.launcher3.anim.Interpolators;
Sunny Goyal47328fd2016-05-25 18:56:41 -070038import com.android.launcher3.dragndrop.DragController;
Sunny Goyal07b69292018-01-08 14:19:34 -080039import com.android.launcher3.dragndrop.DragController.DragListener;
Sunny Goyal94b510c2016-08-16 15:36:48 -070040import com.android.launcher3.dragndrop.DragOptions;
vadimtf6ef8792022-07-26 13:54:31 -070041import com.android.launcher3.testing.shared.TestProtocol;
Sunny Goyal47328fd2016-05-25 18:56:41 -070042
43/*
44 * The top bar containing various drop targets: Delete/App Info/Uninstall.
45 */
Sunny Goyald1b3f5c2018-01-18 17:14:05 -080046public class DropTargetBar extends FrameLayout
Sunny Goyal07b69292018-01-08 14:19:34 -080047 implements DragListener, Insettable {
Sunny Goyal47328fd2016-05-25 18:56:41 -070048
49 protected static final int DEFAULT_DRAG_FADE_DURATION = 175;
Sunny Goyal5bc6b6f2017-10-26 15:36:10 -070050 protected static final TimeInterpolator DEFAULT_INTERPOLATOR = Interpolators.ACCEL;
Sunny Goyal47328fd2016-05-25 18:56:41 -070051
Sunny Goyal07b69292018-01-08 14:19:34 -080052 private final Runnable mFadeAnimationEndRunnable =
Sunny Goyal18d71842018-03-27 13:44:00 -070053 () -> updateVisibility(DropTargetBar.this);
Sunny Goyal47328fd2016-05-25 18:56:41 -070054
Alex Chau906d8822022-05-23 10:42:25 +010055 private final Launcher mLauncher;
56
Sunny Goyal47328fd2016-05-25 18:56:41 -070057 @ViewDebug.ExportedProperty(category = "launcher")
58 protected boolean mDeferOnDragEnd;
59
60 @ViewDebug.ExportedProperty(category = "launcher")
61 protected boolean mVisible = false;
62
Sunny Goyal0236d0b2017-10-24 14:54:30 -070063 private ButtonDropTarget[] mDropTargets;
Alex Chau906d8822022-05-23 10:42:25 +010064 private ButtonDropTarget[] mTempTargets;
Sunny Goyal47328fd2016-05-25 18:56:41 -070065 private ViewPropertyAnimator mCurrentAnimation;
66
Sunny Goyald1b3f5c2018-01-18 17:14:05 -080067 private boolean mIsVertical = true;
68
Sunny Goyal47328fd2016-05-25 18:56:41 -070069 public DropTargetBar(Context context, AttributeSet attrs) {
70 super(context, attrs);
Alex Chau906d8822022-05-23 10:42:25 +010071 mLauncher = Launcher.getLauncher(context);
Sunny Goyal47328fd2016-05-25 18:56:41 -070072 }
73
74 public DropTargetBar(Context context, AttributeSet attrs, int defStyle) {
75 super(context, attrs, defStyle);
Alex Chau906d8822022-05-23 10:42:25 +010076 mLauncher = Launcher.getLauncher(context);
Sunny Goyal47328fd2016-05-25 18:56:41 -070077 }
78
79 @Override
80 protected void onFinishInflate() {
81 super.onFinishInflate();
Sunny Goyald1b3f5c2018-01-18 17:14:05 -080082 mDropTargets = new ButtonDropTarget[getChildCount()];
83 for (int i = 0; i < mDropTargets.length; i++) {
84 mDropTargets[i] = (ButtonDropTarget) getChildAt(i);
85 mDropTargets[i].setDropTargetBar(this);
86 }
Alex Chau906d8822022-05-23 10:42:25 +010087 mTempTargets = new ButtonDropTarget[getChildCount()];
Sunny Goyal47328fd2016-05-25 18:56:41 -070088 }
89
Sunny Goyal07b69292018-01-08 14:19:34 -080090 @Override
91 public void setInsets(Rect insets) {
92 FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) getLayoutParams();
Alex Chau906d8822022-05-23 10:42:25 +010093 DeviceProfile grid = mLauncher.getDeviceProfile();
Sunny Goyald1b3f5c2018-01-18 17:14:05 -080094 mIsVertical = grid.isVerticalBarLayout();
Sunny Goyal07b69292018-01-08 14:19:34 -080095
96 lp.leftMargin = insets.left;
97 lp.topMargin = insets.top;
98 lp.bottomMargin = insets.bottom;
99 lp.rightMargin = insets.right;
Sunny Goyald1b3f5c2018-01-18 17:14:05 -0800100 int tooltipLocation = TOOLTIP_DEFAULT;
Sunny Goyal07b69292018-01-08 14:19:34 -0800101
Pat Manningde25c0d2022-04-05 19:11:26 +0100102 int horizontalMargin;
103 if (grid.isTablet) {
104 // XXX: If the icon size changes across orientations, we will have to take
105 // that into account here too.
106 horizontalMargin = ((grid.widthPx - 2 * grid.edgeMarginPx
107 - (grid.inv.numColumns * grid.cellWidthPx))
108 / (2 * (grid.inv.numColumns + 1)))
109 + grid.edgeMarginPx;
Sunny Goyal07b69292018-01-08 14:19:34 -0800110 } else {
Pat Manningde25c0d2022-04-05 19:11:26 +0100111 horizontalMargin = getContext().getResources()
112 .getDimensionPixelSize(R.dimen.drop_target_bar_margin_horizontal);
Pat Manninge3723662022-03-25 16:07:46 +0000113 }
Pat Manningde25c0d2022-04-05 19:11:26 +0100114 lp.topMargin += grid.dropTargetBarTopMarginPx;
115 lp.bottomMargin += grid.dropTargetBarBottomMarginPx;
116 lp.width = grid.availableWidthPx - 2 * horizontalMargin;
117 if (mIsVertical) {
118 lp.leftMargin = (grid.widthPx - lp.width) / 2;
119 lp.rightMargin = (grid.widthPx - lp.width) / 2;
120 }
121 lp.height = grid.dropTargetBarSizePx;
Federico Baron626d51c2022-10-25 14:49:24 -0700122 // TODO: Add tablet support for DropTargetBar when HOME_GARDENING_WORKSPACE_BUTTONS flag
123 // is on
124 if (HOME_GARDENING_WORKSPACE_BUTTONS.get()) {
125 lp.gravity = Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM;
126 } else {
127 lp.gravity = Gravity.CENTER_HORIZONTAL | Gravity.TOP;
128 }
Pat Manningde25c0d2022-04-05 19:11:26 +0100129
Alex Chau906d8822022-05-23 10:42:25 +0100130 DeviceProfile dp = mLauncher.getDeviceProfile();
131 int horizontalPadding = dp.dropTargetHorizontalPaddingPx;
132 int verticalPadding = dp.dropTargetVerticalPaddingPx;
Sunny Goyal07b69292018-01-08 14:19:34 -0800133 setLayoutParams(lp);
Sunny Goyald1b3f5c2018-01-18 17:14:05 -0800134 for (ButtonDropTarget button : mDropTargets) {
Alex Chaua02eddc2021-04-29 00:36:06 +0100135 button.setTextSize(TypedValue.COMPLEX_UNIT_PX, grid.dropTargetTextSizePx);
Sunny Goyald1b3f5c2018-01-18 17:14:05 -0800136 button.setToolTipLocation(tooltipLocation);
Alex Chau906d8822022-05-23 10:42:25 +0100137 button.setPadding(horizontalPadding, verticalPadding, horizontalPadding,
138 verticalPadding);
Sunny Goyald1b3f5c2018-01-18 17:14:05 -0800139 }
Sunny Goyal07b69292018-01-08 14:19:34 -0800140 }
141
Sunny Goyal47328fd2016-05-25 18:56:41 -0700142 public void setup(DragController dragController) {
143 dragController.addDragListener(this);
Sunny Goyal0236d0b2017-10-24 14:54:30 -0700144 for (int i = 0; i < mDropTargets.length; i++) {
Sunny Goyal0236d0b2017-10-24 14:54:30 -0700145 dragController.addDragListener(mDropTargets[i]);
146 dragController.addDropTarget(mDropTargets[i]);
147 }
148 }
149
Jon Mirandabfaa4a42017-08-21 15:31:51 -0700150 @Override
151 protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
Sunny Goyald1b3f5c2018-01-18 17:14:05 -0800152 int width = MeasureSpec.getSize(widthMeasureSpec);
153 int height = MeasureSpec.getSize(heightMeasureSpec);
Alex Chau906d8822022-05-23 10:42:25 +0100154 int heightSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
Jon Mirandabfaa4a42017-08-21 15:31:51 -0700155
Alex Chau906d8822022-05-23 10:42:25 +0100156 int visibleCount = getVisibleButtons(mTempTargets);
157 if (visibleCount == 1) {
158 int widthSpec = MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST);
Pat Manning27bfcaa2022-04-25 13:50:28 +0100159
Alex Chau906d8822022-05-23 10:42:25 +0100160 ButtonDropTarget firstButton = mTempTargets[0];
Pat Manninge63dd252022-08-02 16:15:29 +0100161 firstButton.setTextSize(TypedValue.COMPLEX_UNIT_PX,
162 mLauncher.getDeviceProfile().dropTargetTextSizePx);
Alex Chau906d8822022-05-23 10:42:25 +0100163 firstButton.setTextVisible(true);
164 firstButton.setIconVisible(true);
165 firstButton.measure(widthSpec, heightSpec);
166 } else if (visibleCount == 2) {
167 DeviceProfile dp = mLauncher.getDeviceProfile();
168 int verticalPadding = dp.dropTargetVerticalPaddingPx;
169 int horizontalPadding = dp.dropTargetHorizontalPaddingPx;
170
171 ButtonDropTarget firstButton = mTempTargets[0];
Pat Manninge63dd252022-08-02 16:15:29 +0100172 firstButton.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp.dropTargetTextSizePx);
Alex Chau906d8822022-05-23 10:42:25 +0100173 firstButton.setTextVisible(true);
174 firstButton.setIconVisible(true);
175 firstButton.setTextMultiLine(false);
Pat Manninge63dd252022-08-02 16:15:29 +0100176 // Reset first button padding in case it was previously changed to multi-line text.
Alex Chau906d8822022-05-23 10:42:25 +0100177 firstButton.setPadding(horizontalPadding, verticalPadding, horizontalPadding,
178 verticalPadding);
179
180 ButtonDropTarget secondButton = mTempTargets[1];
Pat Manninge63dd252022-08-02 16:15:29 +0100181 secondButton.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp.dropTargetTextSizePx);
Alex Chau906d8822022-05-23 10:42:25 +0100182 secondButton.setTextVisible(true);
183 secondButton.setIconVisible(true);
184 secondButton.setTextMultiLine(false);
185 // Reset second button padding in case it was previously changed to multi-line text.
186 secondButton.setPadding(horizontalPadding, verticalPadding, horizontalPadding,
187 verticalPadding);
188
Alex Chau906d8822022-05-23 10:42:25 +0100189 int availableWidth;
190 if (dp.isTwoPanels) {
Pat Manninge63dd252022-08-02 16:15:29 +0100191 // Each button for two panel fits to half the width of the screen excluding the
192 // center gap between the buttons.
193 availableWidth = (dp.availableWidthPx - dp.dropTargetGapPx) / 2;
Alex Chau906d8822022-05-23 10:42:25 +0100194 } else {
Pat Manninge63dd252022-08-02 16:15:29 +0100195 // Both buttons plus the button gap do not display past the edge of the screen.
196 availableWidth = dp.availableWidthPx - dp.dropTargetGapPx;
Pat Manningb29dabc2022-05-20 15:21:48 +0000197 }
Pat Manning27bfcaa2022-04-25 13:50:28 +0100198
Pat Manningb29dabc2022-05-20 15:21:48 +0000199 int widthSpec = MeasureSpec.makeMeasureSpec(availableWidth, MeasureSpec.AT_MOST);
Alex Chau906d8822022-05-23 10:42:25 +0100200 firstButton.measure(widthSpec, heightSpec);
Alex Chau906d8822022-05-23 10:42:25 +0100201 if (!mIsVertical) {
Pat Manninge3d74b42022-06-08 13:15:13 +0100202 // Remove both icons and put the button's text on two lines if text is truncated.
Alex Chau906d8822022-05-23 10:42:25 +0100203 if (firstButton.isTextTruncated(availableWidth)) {
204 firstButton.setIconVisible(false);
Pat Manninge3d74b42022-06-08 13:15:13 +0100205 secondButton.setIconVisible(false);
Alex Chau906d8822022-05-23 10:42:25 +0100206 firstButton.setTextMultiLine(true);
207 firstButton.setPadding(horizontalPadding, verticalPadding / 2,
208 horizontalPadding, verticalPadding / 2);
209 }
Alex Chau5b019302022-05-23 10:42:25 +0100210 }
211
212 if (!dp.isTwoPanels) {
213 availableWidth -= firstButton.getMeasuredWidth() + dp.dropTargetGapPx;
214 widthSpec = MeasureSpec.makeMeasureSpec(availableWidth, MeasureSpec.AT_MOST);
215 }
216 secondButton.measure(widthSpec, heightSpec);
217 if (!mIsVertical) {
Pat Manninge3d74b42022-06-08 13:15:13 +0100218 // Remove both icons and put the button's text on two lines if text is truncated.
Alex Chau906d8822022-05-23 10:42:25 +0100219 if (secondButton.isTextTruncated(availableWidth)) {
220 secondButton.setIconVisible(false);
Pat Manninge3d74b42022-06-08 13:15:13 +0100221 firstButton.setIconVisible(false);
Alex Chau906d8822022-05-23 10:42:25 +0100222 secondButton.setTextMultiLine(true);
223 secondButton.setPadding(horizontalPadding, verticalPadding / 2,
224 horizontalPadding, verticalPadding / 2);
Jon Mirandabfaa4a42017-08-21 15:31:51 -0700225 }
226 }
Pat Manninge63dd252022-08-02 16:15:29 +0100227
228 // If text is still truncated, shrink to fit in measured width and resize both targets.
229 float minTextSize =
230 Math.min(firstButton.resizeTextToFit(), secondButton.resizeTextToFit());
231 if (firstButton.getTextSize() != minTextSize
232 || secondButton.getTextSize() != minTextSize) {
233 firstButton.setTextSize(minTextSize);
234 secondButton.setTextSize(minTextSize);
235 }
Jon Mirandabfaa4a42017-08-21 15:31:51 -0700236 }
Sunny Goyald1b3f5c2018-01-18 17:14:05 -0800237 setMeasuredDimension(width, height);
238 }
Jon Mirandabfaa4a42017-08-21 15:31:51 -0700239
Sunny Goyald1b3f5c2018-01-18 17:14:05 -0800240 @Override
241 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
Alex Chau906d8822022-05-23 10:42:25 +0100242 int visibleCount = getVisibleButtons(mTempTargets);
Sunny Goyala4647b62021-02-02 13:45:34 -0800243 if (visibleCount == 0) {
Pat Manningde25c0d2022-04-05 19:11:26 +0100244 return;
245 }
Sunny Goyald1b3f5c2018-01-18 17:14:05 -0800246
Alex Chau906d8822022-05-23 10:42:25 +0100247 DeviceProfile dp = mLauncher.getDeviceProfile();
248 // Center vertical bar over scaled workspace, accounting for hotseat offset.
Pat Manning5f74bfd2022-07-20 12:08:54 +0100249 float scale = dp.getWorkspaceSpringLoadScale(mLauncher);
Alex Chau906d8822022-05-23 10:42:25 +0100250 Workspace<?> ws = mLauncher.getWorkspace();
251 int barCenter;
252 if (dp.isTwoPanels) {
253 barCenter = (right - left) / 2;
254 } else {
255 int workspaceCenter = (ws.getLeft() + ws.getRight()) / 2;
256 int cellLayoutCenter = ((dp.getInsets().left + dp.workspacePadding.left) + (dp.widthPx
257 - dp.getInsets().right - dp.workspacePadding.right)) / 2;
258 int cellLayoutCenterOffset = (int) ((cellLayoutCenter - workspaceCenter) * scale);
259 barCenter = workspaceCenter + cellLayoutCenterOffset - left;
260 }
Pat Manningde25c0d2022-04-05 19:11:26 +0100261
262 if (visibleCount == 1) {
Alex Chau906d8822022-05-23 10:42:25 +0100263 ButtonDropTarget button = mTempTargets[0];
Pat Manningde25c0d2022-04-05 19:11:26 +0100264 button.layout(barCenter - (button.getMeasuredWidth() / 2), 0,
265 barCenter + (button.getMeasuredWidth() / 2), button.getMeasuredHeight());
266 } else if (visibleCount == 2) {
267 int buttonGap = dp.dropTargetGapPx;
268
Alex Chau906d8822022-05-23 10:42:25 +0100269 ButtonDropTarget leftButton = mTempTargets[0];
Alex Chau906d8822022-05-23 10:42:25 +0100270 ButtonDropTarget rightButton = mTempTargets[1];
Alex Chau5b019302022-05-23 10:42:25 +0100271 if (dp.isTwoPanels) {
272 leftButton.layout(barCenter - leftButton.getMeasuredWidth() - (buttonGap / 2), 0,
273 barCenter - (buttonGap / 2), leftButton.getMeasuredHeight());
274 rightButton.layout(barCenter + (buttonGap / 2), 0,
275 barCenter + (buttonGap / 2) + rightButton.getMeasuredWidth(),
276 rightButton.getMeasuredHeight());
277 } else {
278 int scaledPanelWidth = (int) (dp.getCellLayoutWidth() * scale);
279
280 int leftButtonWidth = leftButton.getMeasuredWidth();
281 int rightButtonWidth = rightButton.getMeasuredWidth();
282 int extraSpace = scaledPanelWidth - leftButtonWidth - rightButtonWidth - buttonGap;
283
284 int leftButtonStart = barCenter - (scaledPanelWidth / 2) + extraSpace / 2;
285 int leftButtonEnd = leftButtonStart + leftButtonWidth;
286 int rightButtonStart = leftButtonEnd + buttonGap;
287 int rightButtonEnd = rightButtonStart + rightButtonWidth;
288
289 leftButton.layout(leftButtonStart, 0, leftButtonEnd,
290 leftButton.getMeasuredHeight());
291 rightButton.layout(rightButtonStart, 0, rightButtonEnd,
292 rightButton.getMeasuredHeight());
293 }
Sunny Goyald1b3f5c2018-01-18 17:14:05 -0800294 }
295 }
296
Alex Chau906d8822022-05-23 10:42:25 +0100297 private int getVisibleButtons(ButtonDropTarget[] outVisibleButtons) {
Sunny Goyald1b3f5c2018-01-18 17:14:05 -0800298 int visibleCount = 0;
Alex Chau906d8822022-05-23 10:42:25 +0100299 for (ButtonDropTarget button : mDropTargets) {
300 if (button.getVisibility() != GONE) {
301 outVisibleButtons[visibleCount] = button;
Sunny Goyald1b3f5c2018-01-18 17:14:05 -0800302 visibleCount++;
303 }
304 }
305 return visibleCount;
Jon Mirandabfaa4a42017-08-21 15:31:51 -0700306 }
307
Hyunyoung Song497708c2019-05-01 16:16:53 -0700308 public void animateToVisibility(boolean isVisible) {
vadimt89d94232021-09-01 12:33:00 -0700309 if (TestProtocol.sDebugTracing) {
310 Log.d(TestProtocol.NO_DROP_TARGET, "8");
311 }
Sunny Goyal47328fd2016-05-25 18:56:41 -0700312 if (mVisible != isVisible) {
313 mVisible = isVisible;
314
315 // Cancel any existing animation
316 if (mCurrentAnimation != null) {
317 mCurrentAnimation.cancel();
318 mCurrentAnimation = null;
319 }
320
321 float finalAlpha = mVisible ? 1 : 0;
322 if (Float.compare(getAlpha(), finalAlpha) != 0) {
323 setVisibility(View.VISIBLE);
324 mCurrentAnimation = animate().alpha(finalAlpha)
325 .setInterpolator(DEFAULT_INTERPOLATOR)
326 .setDuration(DEFAULT_DRAG_FADE_DURATION)
327 .withEndAction(mFadeAnimationEndRunnable);
328 }
329
330 }
331 }
332
Sunny Goyal47328fd2016-05-25 18:56:41 -0700333 /*
334 * DragController.DragListener implementation
335 */
336 @Override
Sunny Goyal94b510c2016-08-16 15:36:48 -0700337 public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) {
vadimt89d94232021-09-01 12:33:00 -0700338 if (TestProtocol.sDebugTracing) {
339 Log.d(TestProtocol.NO_DROP_TARGET, "7");
340 }
Sunny Goyal47328fd2016-05-25 18:56:41 -0700341 animateToVisibility(true);
342 }
343
344 /**
345 * This is called to defer hiding the delete drop target until the drop animation has completed,
346 * instead of hiding immediately when the drag has ended.
347 */
348 protected void deferOnDragEnd() {
349 mDeferOnDragEnd = true;
350 }
351
352 @Override
353 public void onDragEnd() {
354 if (!mDeferOnDragEnd) {
355 animateToVisibility(false);
356 } else {
357 mDeferOnDragEnd = false;
358 }
359 }
Sunny Goyal0236d0b2017-10-24 14:54:30 -0700360
361 public ButtonDropTarget[] getDropTargets() {
Alex Chau5b019302022-05-23 10:42:25 +0100362 return getVisibility() == View.VISIBLE ? mDropTargets : new ButtonDropTarget[0];
Sunny Goyal0236d0b2017-10-24 14:54:30 -0700363 }
vadimt89d94232021-09-01 12:33:00 -0700364
365 @Override
366 protected void onVisibilityChanged(@NonNull View changedView, int visibility) {
367 super.onVisibilityChanged(changedView, visibility);
Vadim Tryshev8629be72021-10-26 19:57:49 +0000368 if (TestProtocol.sDebugTracing) {
369 if (visibility == VISIBLE) {
370 Log.d(TestProtocol.NO_DROP_TARGET, "9");
371 } else {
372 Log.d(TestProtocol.NO_DROP_TARGET, "Hiding drop target", new Exception());
373 }
vadimt89d94232021-09-01 12:33:00 -0700374 }
375 }
Sunny Goyal47328fd2016-05-25 18:56:41 -0700376}