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

Commit 480dd72d authored by Winson Chung's avatar Winson Chung
Browse files

Fixing issue with the lock-to-app setting not being refreshed when entering recents.

Change-Id: I8236aebc18a0d7194bfe50fe2c61659caa39b04c
parent ed69bd66
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -67,8 +67,7 @@
        android:layout_width="match_parent"
        android:layout_height="@dimen/recents_task_view_lock_to_app_button_height"
        android:layout_gravity="center_horizontal|bottom"
        android:background="@drawable/recents_lock_to_task_button_bg"
        android:visibility="invisible">
        android:background="@drawable/recents_lock_to_task_button_bg">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
+3 −0
Original line number Diff line number Diff line
@@ -431,6 +431,9 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
        super.onNewIntent(intent);
        setIntent(intent);

        // Reinitialize the configuration
        RecentsConfiguration.reinitialize(this, RecentsTaskLoader.getInstance().getSystemServicesProxy());

        // Clear any debug rects
        if (mDebugOverlay != null) {
            mDebugOverlay.clear();
+5 −0
Original line number Diff line number Diff line
@@ -305,6 +305,11 @@ public class RecentsConfiguration {
                (!transposeRecentsLayoutWithOrientation || !isLandscape);
    }

    /** Returns whether the current layout is horizontal. */
    public boolean hasHorizontalLayout() {
        return isLandscape && transposeRecentsLayoutWithOrientation;
    }

    /**
     * Returns the task stack bounds in the current orientation. These bounds do not account for
     * the system insets.
+41 −8
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
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;
@@ -34,6 +35,7 @@ public class AnimateableViewBounds extends ViewOutlineProvider {
    int mCornerRadius;

    ObjectAnimator mClipTopAnimator;
    ObjectAnimator mClipRightAnimator;
    ObjectAnimator mClipBottomAnimator;

    public AnimateableViewBounds(View source, int cornerRadius) {
@@ -42,6 +44,7 @@ public class AnimateableViewBounds extends ViewOutlineProvider {
        mCornerRadius = cornerRadius;
        mSourceView.setClipToOutline(true);
        setClipTop(getClipTop());
        setClipRight(getClipRight());
        setClipBottom(getClipBottom());
        setOutlineClipBottom(getOutlineClipBottom());
    }
@@ -56,7 +59,7 @@ public class AnimateableViewBounds extends ViewOutlineProvider {
    }

    /** Animates the top clip. */
    void animateClipTop(int top, int duration) {
    void animateClipTop(int top, int duration, ValueAnimator.AnimatorUpdateListener updateListener) {
        if (mClipTopAnimator != null) {
            mClipTopAnimator.removeAllListeners();
            mClipTopAnimator.cancel();
@@ -64,6 +67,9 @@ public class AnimateableViewBounds extends ViewOutlineProvider {
        mClipTopAnimator = ObjectAnimator.ofInt(this, "clipTop", top);
        mClipTopAnimator.setDuration(duration);
        mClipTopAnimator.setInterpolator(mConfig.fastOutSlowInInterpolator);
        if (updateListener != null) {
            mClipTopAnimator.addUpdateListener(updateListener);
        }
        mClipTopAnimator.start();
    }

@@ -80,16 +86,41 @@ public class AnimateableViewBounds extends ViewOutlineProvider {
        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();
        }
    }

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

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

    /** Sets the bottom clip. */
@@ -105,6 +136,7 @@ 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;
@@ -112,6 +144,7 @@ public class AnimateableViewBounds extends ViewOutlineProvider {
        }
    }

    /** Gets the outline bottom clip. */
    public int getOutlineClipBottom() {
        return mOutlineClipRect.bottom;
    }
+0 −19
Original line number Diff line number Diff line
@@ -16,12 +16,9 @@

package com.android.systemui.recents.views;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import com.android.systemui.recents.RecentsConfiguration;

@@ -82,9 +79,6 @@ public class TaskFooterView extends FrameLayout {
    void animateFooterVisibility(final boolean visible, int duration) {
        // Return early if there is no footer
        if (mMaxFooterHeight <= 0) return;
        // Return early if we are already in the final state
        if (!visible && getVisibility() != View.VISIBLE) return;
        if (visible && getVisibility() == View.VISIBLE) return;

        // Cancel the previous animation
        if (mFooterAnimator != null) {
@@ -93,25 +87,12 @@ public class TaskFooterView extends FrameLayout {
        }
        int finalHeight = visible ? mMaxFooterHeight : 0;
        if (duration > 0) {
            // Make the view visible for the animation
            if (visible && getVisibility() != View.VISIBLE) {
                setVisibility(View.VISIBLE);
            }
            mFooterAnimator = ObjectAnimator.ofInt(this, "footerHeight", finalHeight);
            mFooterAnimator.setDuration(duration);
            mFooterAnimator.setInterpolator(mConfig.fastOutSlowInInterpolator);
            mFooterAnimator.addListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    if (!visible) {
                        setVisibility(View.INVISIBLE);
                    }
                }
            });
            mFooterAnimator.start();
        } else {
            setFooterHeight(finalHeight);
            setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
        }
    }
}
Loading