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

Commit a338daa2 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Adding a utility class to cache views at an activity level" into ub-launcher3-qt-dev

parents a09cfe23 56863331
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -118,7 +118,8 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe
        final RectF iconLocation = new RectF();
        boolean canUseWorkspaceView = workspaceView != null && workspaceView.isAttachedToWindow();
        FloatingIconView floatingIconView = canUseWorkspaceView
                ? recentsView.getFloatingIconView(activity, workspaceView, iconLocation)
                ? FloatingIconView.getFloatingIconView(activity, workspaceView,
                        true /* hideOriginal */, iconLocation, false /* isOpening */)
                : null;

        return new HomeAnimationFactory() {
+0 −11
Original line number Diff line number Diff line
@@ -66,7 +66,6 @@ import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewDebug;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
@@ -77,7 +76,6 @@ import com.android.launcher3.BaseActivity;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Insettable;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAnimUtils.ViewProgressProperty;
import com.android.launcher3.LauncherState;
import com.android.launcher3.PagedView;
@@ -95,7 +93,6 @@ import com.android.launcher3.util.OverScroller;
import com.android.launcher3.util.PendingAnimation;
import com.android.launcher3.util.Themes;
import com.android.launcher3.util.ViewPool;
import com.android.launcher3.views.FloatingIconView;
import com.android.quickstep.RecentsAnimationWrapper;
import com.android.quickstep.RecentsModel;
import com.android.quickstep.RecentsModel.TaskThumbnailChangeListener;
@@ -308,8 +305,6 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
    private Layout mEmptyTextLayout;
    private LiveTileOverlay mLiveTileOverlay;

    private FloatingIconView mFloatingIconView;

    private BaseActivity.MultiWindowModeChangedListener mMultiWindowModeChangedListener =
            (inMultiWindowMode) -> {
        if (!inMultiWindowMode && mOverviewStateEnabled) {
@@ -1687,12 +1682,6 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
        }
    }

    public FloatingIconView getFloatingIconView(Launcher launcher, View view, RectF iconLocation) {
        mFloatingIconView = FloatingIconView.getFloatingIconView(launcher, view,
                true /* hideOriginal */, iconLocation, false /* isOpening */, mFloatingIconView);
        return  mFloatingIconView;
    }

    public ClipAnimationHelper getTempClipAnimationHelper() {
        return mTempClipAnimationHelper;
    }
+5 −6
Original line number Diff line number Diff line
@@ -142,7 +142,6 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans
    private final float mClosingWindowTransY;

    private DeviceProfile mDeviceProfile;
    private FloatingIconView mFloatingView;

    private RemoteAnimationProvider mRemoteAnimationProvider;

@@ -411,15 +410,15 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans
    private ValueAnimator getOpeningWindowAnimators(View v, RemoteAnimationTargetCompat[] targets,
            Rect windowTargetBounds, boolean toggleVisibility) {
        RectF bounds = new RectF();
        mFloatingView = FloatingIconView.getFloatingIconView(mLauncher, v, toggleVisibility,
                bounds, true /* isOpening */, mFloatingView);
        FloatingIconView floatingView = FloatingIconView.getFloatingIconView(mLauncher, v,
                toggleVisibility, bounds, true /* isOpening */);
        Rect crop = new Rect();
        Matrix matrix = new Matrix();

        RemoteAnimationTargetSet openingTargets = new RemoteAnimationTargetSet(targets,
                MODE_OPENING);
        SyncRtSurfaceTransactionApplierCompat surfaceApplier =
                new SyncRtSurfaceTransactionApplierCompat(mFloatingView);
                new SyncRtSurfaceTransactionApplierCompat(floatingView);
        openingTargets.addDependentTransactionApplier(surfaceApplier);

        // Scale the app icon to take up the entire screen. This simplifies the math when
@@ -463,7 +462,7 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans
        ValueAnimator appAnimator = ValueAnimator.ofFloat(0, 1);
        appAnimator.setDuration(APP_LAUNCH_DURATION);
        appAnimator.setInterpolator(LINEAR);
        appAnimator.addListener(mFloatingView);
        appAnimator.addListener(floatingView);
        appAnimator.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
@@ -557,7 +556,7 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans
                        } else {
                            currentBounds.bottom -= croppedHeight;
                        }
                        mFloatingView.update(currentBounds, mIconAlpha.value, percent, 0f,
                        floatingView.update(currentBounds, mIconAlpha.value, percent, 0f,
                                cornerRadius * scale, true /* isOpening */);
                    } else {
                        matrix.setTranslate(target.position.x, target.position.y);
+19 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 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.
-->
<com.android.launcher3.views.FloatingIconView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />
+0 −1
Original line number Diff line number Diff line
@@ -86,7 +86,6 @@

    <!-- View IDs to store item highlight information -->
    <item type="id" name="view_unhighlight_background" />
    <item type="id" name="view_highlighted" />

    <!-- Menu id for feature flags -->
    <item type="id" name="menu_apply_flags" />
Loading