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

Commit e3cd4832 authored by Jonathan Miranda's avatar Jonathan Miranda Committed by Android (Google) Code Review
Browse files

Merge "Add BubbleTextHolder interface." into sc-dev

parents 9bb040ec 92f130fd
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;
    }
+25 −0
Original line number Diff line number Diff line
/*
 * 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();
}
+2 −2
Original line number Diff line number Diff line
@@ -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();