Add BubbleTextHolder interface.

Bug: 184817903
Test: manual, verify correct app open animation
Change-Id: I3723922aff5c71ae6ec7340d3c00cffef7b010b8
This commit is contained in:
Jon Miranda 2021-04-12 13:11:59 -04:00
parent ea29adfbe9
commit 92f130fdf5
3 changed files with 30 additions and 3 deletions

View File

@ -30,12 +30,13 @@ import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.popup.PopupContainerWithArrow;
import com.android.launcher3.views.BubbleTextHolder;
/**
* A {@link android.widget.FrameLayout} that contains a {@link DeepShortcutView}.
* This lets us animate the DeepShortcutView (icon and text) separately from the background.
*/
public class DeepShortcutView extends FrameLayout {
public class DeepShortcutView extends FrameLayout implements BubbleTextHolder {
private static final Point sTempPoint = new Point();
@ -64,6 +65,7 @@ public class DeepShortcutView extends FrameLayout {
mIconView = findViewById(R.id.icon);
}
@Override
public BubbleTextView getBubbleText() {
return mBubbleText;
}

View File

@ -0,0 +1,25 @@
/*
* Copyright (C) 2021 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.
*/
package com.android.launcher3.views;
import com.android.launcher3.BubbleTextView;
/**
* Views that contain {@link BubbleTextView} should implement this interface.
*/
public interface BubbleTextHolder {
BubbleTextView getBubbleText();
}

View File

@ -210,8 +210,8 @@ public class FloatingIconView extends FrameLayout implements
public static void getLocationBoundsForView(Launcher launcher, View v, boolean isOpening,
RectF outRect, Rect outViewBounds) {
boolean ignoreTransform = !isOpening;
if (v instanceof DeepShortcutView) {
v = ((DeepShortcutView) v).getBubbleText();
if (v instanceof BubbleTextHolder) {
v = ((BubbleTextHolder) v).getBubbleText();
ignoreTransform = false;
} else if (v.getParent() instanceof DeepShortcutView) {
v = ((DeepShortcutView) v.getParent()).getIconView();