Merge "Workaround for empty recents, defer the enter animation." into nyc-dev
am: 2b8dcdeda4
* commit '2b8dcdeda484c3ed92969420a19ba48c2f877c81':
Workaround for empty recents, defer the enter animation.
Change-Id: I9678058e4fdb7b207b9c9b0a2f1c2b40d47b8835
This commit is contained in:
@@ -107,6 +107,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
|||||||
private boolean mFinishedOnStartup;
|
private boolean mFinishedOnStartup;
|
||||||
private boolean mIgnoreAltTabRelease;
|
private boolean mIgnoreAltTabRelease;
|
||||||
private boolean mIsVisible;
|
private boolean mIsVisible;
|
||||||
|
private boolean mReceivedNewIntent;
|
||||||
|
|
||||||
// Top level views
|
// Top level views
|
||||||
private RecentsView mRecentsView;
|
private RecentsView mRecentsView;
|
||||||
@@ -120,6 +121,9 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
|||||||
private int mFocusTimerDuration;
|
private int mFocusTimerDuration;
|
||||||
private DozeTrigger mIterateTrigger;
|
private DozeTrigger mIterateTrigger;
|
||||||
private final UserInteractionEvent mUserInteractionEvent = new UserInteractionEvent();
|
private final UserInteractionEvent mUserInteractionEvent = new UserInteractionEvent();
|
||||||
|
private final Runnable mSendEnterWindowAnimationCompleteRunnable = () -> {
|
||||||
|
EventBus.getDefault().send(new EnterRecentsWindowAnimationCompletedEvent());
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A common Runnable to finish Recents by launching Home with an animation depending on the
|
* A common Runnable to finish Recents by launching Home with an animation depending on the
|
||||||
@@ -342,6 +346,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
|||||||
@Override
|
@Override
|
||||||
protected void onNewIntent(Intent intent) {
|
protected void onNewIntent(Intent intent) {
|
||||||
super.onNewIntent(intent);
|
super.onNewIntent(intent);
|
||||||
|
mReceivedNewIntent = true;
|
||||||
|
|
||||||
// Reload the stack view
|
// Reload the stack view
|
||||||
reloadStackView();
|
reloadStackView();
|
||||||
@@ -419,7 +424,16 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
|||||||
@Override
|
@Override
|
||||||
public void onEnterAnimationComplete() {
|
public void onEnterAnimationComplete() {
|
||||||
super.onEnterAnimationComplete();
|
super.onEnterAnimationComplete();
|
||||||
EventBus.getDefault().send(new EnterRecentsWindowAnimationCompletedEvent());
|
|
||||||
|
// Workaround for b/28705801, on first docking, we may receive the enter animation callback
|
||||||
|
// before the first layout, so in such cases, send the event on the next frame after all
|
||||||
|
// the views are laid out and attached (and registered to the EventBus).
|
||||||
|
mHandler.removeCallbacks(mSendEnterWindowAnimationCompleteRunnable);
|
||||||
|
if (!mReceivedNewIntent) {
|
||||||
|
mHandler.post(mSendEnterWindowAnimationCompleteRunnable);
|
||||||
|
} else {
|
||||||
|
mSendEnterWindowAnimationCompleteRunnable.run();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -478,6 +492,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
|||||||
|
|
||||||
// Notify that recents is now hidden
|
// Notify that recents is now hidden
|
||||||
mIsVisible = false;
|
mIsVisible = false;
|
||||||
|
mReceivedNewIntent = false;
|
||||||
EventBus.getDefault().send(new RecentsVisibilityChangedEvent(this, false));
|
EventBus.getDefault().send(new RecentsVisibilityChangedEvent(this, false));
|
||||||
MetricsLogger.hidden(this, MetricsEvent.OVERVIEW_ACTIVITY);
|
MetricsLogger.hidden(this, MetricsEvent.OVERVIEW_ACTIVITY);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user