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

Commit 3958658c authored by Filip Gruszczynski's avatar Filip Gruszczynski Committed by Android (Google) Code Review
Browse files

Merge "Remove blink during the freeform -> recents transition."

parents b68f9834 14b4e57c
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -149,6 +149,9 @@ interface IWindowManager
    void stopAppFreezingScreen(IBinder token, boolean force);
    void stopAppFreezingScreen(IBinder token, boolean force);
    void removeAppToken(IBinder token);
    void removeAppToken(IBinder token);


    /** Used by system ui to report that recents has shown itself. */
    void endProlongedAnimations();

    // Re-evaluate the current orientation from the caller's state.
    // Re-evaluate the current orientation from the caller's state.
    // If there is a change, the new Configuration is returned and the
    // If there is a change, the new Configuration is returned and the
    // caller must call setNewConfiguration() sometime later.
    // caller must call setNewConfiguration() sometime later.
+1 −1
Original line number Original line Diff line number Diff line
@@ -335,7 +335,7 @@ public interface WindowManagerPolicy {
         * Return true if this window (or a window it is attached to, but not
         * Return true if this window (or a window it is attached to, but not
         * considering its app token) is currently animating.
         * considering its app token) is currently animating.
         */
         */
        public boolean isAnimatingLw();
        boolean isAnimatingLw();


        /**
        /**
         * Is this window considered to be gone for purposes of layout?
         * Is this window considered to be gone for purposes of layout?
+21 −3
Original line number Original line Diff line number Diff line
@@ -35,6 +35,8 @@ import android.provider.Settings;
import android.view.KeyEvent;
import android.view.KeyEvent;
import android.view.View;
import android.view.View;
import android.view.ViewStub;
import android.view.ViewStub;
import android.view.ViewTreeObserver;

import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.MetricsLogger;
import com.android.systemui.R;
import com.android.systemui.R;
import com.android.systemui.recents.events.EventBus;
import com.android.systemui.recents.events.EventBus;
@@ -73,7 +75,8 @@ import java.util.ArrayList;
/**
/**
 * The main Recents activity that is started from AlternateRecentsComponent.
 * The main Recents activity that is started from AlternateRecentsComponent.
 */
 */
public class RecentsActivity extends Activity implements RecentsView.RecentsViewCallbacks {
public class RecentsActivity extends Activity implements RecentsView.RecentsViewCallbacks,
        ViewTreeObserver.OnPreDrawListener {


    private final static String TAG = "RecentsActivity";
    private final static String TAG = "RecentsActivity";
    private final static boolean DEBUG = false;
    private final static boolean DEBUG = false;
@@ -425,7 +428,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
        final RecentsActivityLaunchState state = Recents.getConfiguration().getLaunchState();
        final RecentsActivityLaunchState state = Recents.getConfiguration().getLaunchState();
        if (state.startHidden) {
        if (state.startHidden) {
            state.startHidden = false;
            state.startHidden = false;
            mRecentsView.setVisibility(View.INVISIBLE);
            mRecentsView.setStackViewVisibility(View.INVISIBLE);
        }
        }
    }
    }


@@ -666,7 +669,8 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
    }
    }


    public final void onBusEvent(EnterRecentsWindowLastAnimationFrameEvent event) {
    public final void onBusEvent(EnterRecentsWindowLastAnimationFrameEvent event) {
        mRecentsView.setVisibility(View.VISIBLE);
        mRecentsView.setStackViewVisibility(View.VISIBLE);
        mRecentsView.getViewTreeObserver().addOnPreDrawListener(this);
    }
    }


    public final void onBusEvent(AppWidgetProviderChangedEvent event) {
    public final void onBusEvent(AppWidgetProviderChangedEvent event) {
@@ -733,4 +737,18 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
            mRecentsView.setSearchBar(null);
            mRecentsView.setSearchBar(null);
        }
        }
    }
    }

    @Override
    public boolean onPreDraw() {
        mRecentsView.getViewTreeObserver().removeOnPreDrawListener(this);
        // We post to make sure that this information is delivered after this traversals is
        // finished.
        mRecentsView.post(new Runnable() {
            @Override
            public void run() {
                Recents.getSystemServices().endProlongedAnimations();
            }
        });
        return true;
    }
}
}
+11 −0
Original line number Original line Diff line number Diff line
@@ -787,4 +787,15 @@ public class SystemServicesProxy {
            e.printStackTrace();
            e.printStackTrace();
        }
        }
    }
    }

    public void endProlongedAnimations() {
        if (mWm == null) {
            return;
        }
        try {
            WindowManagerGlobal.getWindowManagerService().endProlongedAnimations();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
}
+10 −0
Original line number Original line Diff line number Diff line
@@ -75,6 +75,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
    private static final boolean DEBUG = false;
    private static final boolean DEBUG = false;


    private static final boolean ADD_HEADER_BITMAP = true;
    private static final boolean ADD_HEADER_BITMAP = true;
    private int mStackViewVisibility = View.VISIBLE;


    /** The RecentsView callbacks */
    /** The RecentsView callbacks */
    public interface RecentsViewCallbacks {
    public interface RecentsViewCallbacks {
@@ -151,6 +152,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
            mTaskStackView.setCallbacks(this);
            mTaskStackView.setCallbacks(this);
            addView(mTaskStackView);
            addView(mTaskStackView);
        }
        }
        mTaskStackView.setVisibility(mStackViewVisibility);


        // Trigger a new layout
        // Trigger a new layout
        requestLayout();
        requestLayout();
@@ -861,4 +863,12 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
            }
            }
        }
        }
    }
    }

    public void setStackViewVisibility(int stackViewVisibility) {
        mStackViewVisibility = stackViewVisibility;
        if (mTaskStackView != null) {
            mTaskStackView.setVisibility(stackViewVisibility);
            invalidate();
        }
    }
}
}
Loading