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

Commit 606b3da7 authored by Winson Chung's avatar Winson Chung
Browse files

Removing unused/dead code related to footer and screenshot transition.

Change-Id: I205de9047413d1ff2da68cdd062eeba59267b10f
parent d213a1e5
Loading
Loading
Loading
Loading
+1 −35
Original line number Diff line number Diff line
@@ -59,7 +59,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
    final public static String EXTRA_FROM_HOME = "recents.triggeredOverHome";
    final public static String EXTRA_FROM_SEARCH_HOME = "recents.triggeredOverSearchHome";
    final public static String EXTRA_FROM_APP_THUMBNAIL = "recents.animatingWithThumbnail";
    final public static String EXTRA_FROM_APP_FULL_SCREENSHOT = "recents.thumbnail";
    final public static String EXTRA_FROM_TASK_ID = "recents.activeTaskId";
    final public static String EXTRA_TRIGGERED_FROM_ALT_TAB = "recents.triggeredFromAltTab";
    final public static String EXTRA_TRIGGERED_FROM_HOME_KEY = "recents.triggeredFromHomeKey";
@@ -74,7 +73,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
    final static String sRecentsPackage = "com.android.systemui";
    final static String sRecentsActivity = "com.android.systemui.recents.RecentsActivity";

    static Bitmap sLastScreenshot;
    static RecentsComponent.Callbacks sRecentsComponentCallbacks;

    Context mContext;
@@ -256,7 +254,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
    public void onConfigurationChanged(Configuration newConfig) {
        // Reload the header bar layout
        reloadHeaderBarLayout();
        sLastScreenshot = null;
    }

    /** Prepares the header bar layout. */
@@ -394,20 +391,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
     */
    ActivityOptions getThumbnailTransitionActivityOptions(ActivityManager.RunningTaskInfo topTask,
            boolean isTopTaskHome) {
        if (Constants.DebugFlags.App.EnableScreenshotAppTransition) {
            // Recycle the last screenshot
            consumeLastScreenshot();

            // Take the full screenshot
            sLastScreenshot = mSystemServicesProxy.takeAppScreenshot();
            if (sLastScreenshot != null) {
                mStartAnimationTriggered = false;
                return ActivityOptions.makeCustomAnimation(mContext,
                        R.anim.recents_from_app_enter,
                        R.anim.recents_from_app_exit, mHandler, this);
            }
        }

        // Update the destination rect
        Task toTask = new Task();
        TaskViewTransform toTransform = getThumbnailTransitionTransform(topTask.id, isTopTaskHome,
@@ -493,11 +476,7 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
            // Try starting with a thumbnail transition
            ActivityOptions opts = getThumbnailTransitionActivityOptions(topTask, isTopTaskHome);
            if (opts != null) {
                if (sLastScreenshot != null) {
                    startAlternateRecentsActivity(topTask, opts, EXTRA_FROM_APP_FULL_SCREENSHOT);
                } else {
                startAlternateRecentsActivity(topTask, opts, EXTRA_FROM_APP_THUMBNAIL);
                }
            } else {
                // Fall through below to the non-thumbnail transition
                useThumbnailTransition = false;
@@ -561,19 +540,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
        }
    }

    /** Returns the last screenshot taken, this will be called by the RecentsActivity. */
    public static Bitmap getLastScreenshot() {
        return sLastScreenshot;
    }

    /** Recycles the last screenshot taken, this will be called by the RecentsActivity. */
    public static void consumeLastScreenshot() {
        if (sLastScreenshot != null) {
            sLastScreenshot.recycle();
            sLastScreenshot = null;
        }
    }

    /** Sets the RecentsComponent callbacks. */
    public void setRecentsComponentCallback(RecentsComponent.Callbacks cb) {
        sRecentsComponentCallbacks = cb;
+0 −2
Original line number Diff line number Diff line
@@ -25,8 +25,6 @@ public class Constants {
        public static final boolean Verbose = false;

        public static class App {
            // Enables the screenshot app->Recents transition
            public static final boolean EnableScreenshotAppTransition = false;
            // Enables debug drawing for the transition thumbnail
            public static final boolean EnableTransitionThumbnailDebugMode = false;
            // Enables the filtering of tasks according to their grouping
+0 −2
Original line number Diff line number Diff line
@@ -189,8 +189,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
                AlternateRecentsComponent.EXTRA_FROM_HOME, false);
        mConfig.launchedFromAppWithThumbnail = launchIntent.getBooleanExtra(
                AlternateRecentsComponent.EXTRA_FROM_APP_THUMBNAIL, false);
        mConfig.launchedFromAppWithScreenshot = launchIntent.getBooleanExtra(
                AlternateRecentsComponent.EXTRA_FROM_APP_FULL_SCREENSHOT, false);
        mConfig.launchedToTaskId = launchIntent.getIntExtra(
                AlternateRecentsComponent.EXTRA_FROM_TASK_ID, -1);
        mConfig.launchedWithAltTab = launchIntent.getBooleanExtra(
+0 −1
Original line number Diff line number Diff line
@@ -307,7 +307,6 @@ public class RecentsConfiguration {
        launchedWithAltTab = false;
        launchedWithNoRecentTasks = false;
        launchedFromAppWithThumbnail = false;
        launchedFromAppWithScreenshot = false;
        launchedFromHome = false;
        launchedToTaskId = -1;
    }
+3 −93
Original line number Diff line number Diff line
@@ -17,12 +17,10 @@
package com.android.systemui.recents.views;

import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.graphics.Outline;
import android.graphics.Rect;
import android.view.View;
import android.view.ViewOutlineProvider;

import com.android.systemui.recents.RecentsConfiguration;

/* An outline provider that has a clip and outline that can be animated. */
@@ -31,35 +29,27 @@ public class AnimateableViewBounds extends ViewOutlineProvider {
    RecentsConfiguration mConfig;

    TaskView mSourceView;
    Rect mTmpRect = new Rect();
    Rect mClipRect = new Rect();
    Rect mClipBounds = new Rect();
    Rect mOutlineClipRect = new Rect();
    int mCornerRadius;
    float mAlpha = 1f;
    final float mMinAlpha = 0.25f;

    ObjectAnimator mClipTopAnimator;
    ObjectAnimator mClipRightAnimator;
    ObjectAnimator mClipBottomAnimator;

    public AnimateableViewBounds(TaskView source, int cornerRadius) {
        mConfig = RecentsConfiguration.getInstance();
        mSourceView = source;
        mCornerRadius = cornerRadius;
        setClipTop(getClipTop());
        setClipRight(getClipRight());
        setClipBottom(getClipBottom());
        setOutlineClipBottom(getOutlineClipBottom());
    }

    @Override
    public void getOutline(View view, Outline outline) {
        outline.setAlpha(mMinAlpha + mAlpha / (1f - mMinAlpha));
        outline.setRoundRect(Math.max(mClipRect.left, mOutlineClipRect.left),
                Math.max(mClipRect.top, mOutlineClipRect.top),
                mSourceView.getWidth() - Math.max(mClipRect.right, mOutlineClipRect.right),
                mSourceView.getHeight() - Math.max(mClipRect.bottom, mOutlineClipRect.bottom),
        outline.setRoundRect(mClipRect.left, mClipRect.top,
                mSourceView.getWidth() - mClipRect.right,
                mSourceView.getHeight() - mClipRect.bottom,
                mCornerRadius);
    }

@@ -71,73 +61,6 @@ public class AnimateableViewBounds extends ViewOutlineProvider {
        }
    }

    /** Animates the top clip. */
    void animateClipTop(int top, int duration, ValueAnimator.AnimatorUpdateListener updateListener) {
        if (mClipTopAnimator != null) {
            mClipTopAnimator.removeAllListeners();
            mClipTopAnimator.cancel();
        }
        mClipTopAnimator = ObjectAnimator.ofInt(this, "clipTop", top);
        mClipTopAnimator.setDuration(duration);
        mClipTopAnimator.setInterpolator(mConfig.fastOutSlowInInterpolator);
        if (updateListener != null) {
            mClipTopAnimator.addUpdateListener(updateListener);
        }
        mClipTopAnimator.start();
    }

    /** Sets the top clip. */
    public void setClipTop(int top) {
        if (top != mClipRect.top) {
            mClipRect.top = top;
            mSourceView.invalidateOutline();
            updateClipBounds();
        }
    }

    /** Returns the top clip. */
    public int getClipTop() {
        return mClipRect.top;
    }

    /** Animates the right clip. */
    void animateClipRight(int right, int duration) {
        if (mClipRightAnimator != null) {
            mClipRightAnimator.removeAllListeners();
            mClipRightAnimator.cancel();
        }
        mClipRightAnimator = ObjectAnimator.ofInt(this, "clipRight", right);
        mClipRightAnimator.setDuration(duration);
        mClipRightAnimator.setInterpolator(mConfig.fastOutSlowInInterpolator);
        mClipRightAnimator.start();
    }

    /** Sets the right clip. */
    public void setClipRight(int right) {
        if (right != mClipRect.right) {
            mClipRect.right = right;
            mSourceView.invalidateOutline();
            updateClipBounds();
        }
    }

    /** Returns the right clip. */
    public int getClipRight() {
        return mClipRect.right;
    }

    /** Animates the bottom clip. */
    void animateClipBottom(int bottom, int duration) {
        if (mClipBottomAnimator != null) {
            mClipBottomAnimator.removeAllListeners();
            mClipBottomAnimator.cancel();
        }
        mClipBottomAnimator = ObjectAnimator.ofInt(this, "clipBottom", bottom);
        mClipBottomAnimator.setDuration(duration);
        mClipBottomAnimator.setInterpolator(mConfig.fastOutSlowInInterpolator);
        mClipBottomAnimator.start();
    }

    /** Sets the bottom clip. */
    public void setClipBottom(int bottom) {
        if (bottom != mClipRect.bottom) {
@@ -156,19 +79,6 @@ public class AnimateableViewBounds extends ViewOutlineProvider {
        return mClipRect.bottom;
    }

    /** Sets the outline bottom clip. */
    public void setOutlineClipBottom(int bottom) {
        if (bottom != mOutlineClipRect.bottom) {
            mOutlineClipRect.bottom = bottom;
            mSourceView.invalidateOutline();
        }
    }

    /** Gets the outline bottom clip. */
    public int getOutlineClipBottom() {
        return mOutlineClipRect.bottom;
    }

    private void updateClipBounds() {
        mClipBounds.set(mClipRect.left, mClipRect.top,
                mSourceView.getWidth() - mClipRect.right,
Loading