diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2019-05-22 14:13:53 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2019-05-22 14:23:12 -0700 |
commit | 5686333117ff6e2e4add6b2f32edcf047f241466 (patch) | |
tree | f7271799263a8d7d6cde5a6eb24bc9ad9ce25dd8 /quickstep | |
parent | 07b985b5e5763bafec786d52b8f65fdcff2d1b14 (diff) | |
download | android_packages_apps_Trebuchet-5686333117ff6e2e4add6b2f32edcf047f241466.tar.gz android_packages_apps_Trebuchet-5686333117ff6e2e4add6b2f32edcf047f241466.tar.bz2 android_packages_apps_Trebuchet-5686333117ff6e2e4add6b2f32edcf047f241466.zip |
Adding a utility class to cache views at an activity level
Bug: 122345781
Change-Id: I9a939e0b19c06c1089c1ceb515f8b97fb5dbb49e
Diffstat (limited to 'quickstep')
3 files changed, 7 insertions, 18 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java index 90b55360e..4b2e487da 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java @@ -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() { diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java index 661468ac6..1e1007e68 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java @@ -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; } diff --git a/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java b/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java index 91c460148..95ae31289 100644 --- a/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java +++ b/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java @@ -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); |