diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-04-02 11:23:39 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2016-07-28 10:13:30 -0700 |
commit | b5b9ad68b707154fcc2c3b04b1b6c0b17127e415 (patch) | |
tree | 1ed2cd99b473ae33122f6225d9d302c74acbf6e5 /src/com/android/launcher3/Launcher.java | |
parent | a2454ad2d8dcffa94f670853eb464726c73597f1 (diff) | |
download | android_packages_apps_Trebuchet-b5b9ad68b707154fcc2c3b04b1b6c0b17127e415.tar.gz android_packages_apps_Trebuchet-b5b9ad68b707154fcc2c3b04b1b6c0b17127e415.tar.bz2 android_packages_apps_Trebuchet-b5b9ad68b707154fcc2c3b04b1b6c0b17127e415.zip |
Fading in the first screen, when launcher loads for the first time
Bug: 29007436
Bug: 27705838
Change-Id: I95891d0bad19a67985b689bb96d6068dcd85004a
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index d668d2a74..df856c1b6 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -465,7 +465,11 @@ public class Launcher extends Activity } else { // We only load the page synchronously if the user rotates (or triggers a // configuration change) while launcher is in the foreground - mModel.startLoader(mWorkspace.getRestorePage()); + if (!mModel.startLoader(mWorkspace.getRestorePage())) { + // If we are not binding synchronously, show a fade in animation when + // the first page bind completes. + mDragLayer.setAlpha(0); + } } } @@ -4003,6 +4007,32 @@ public class Launcher extends Activity } } + @Override + public void finishFirstPageBind(final ViewOnDrawExecutor executor) { + Runnable r = new Runnable() { + public void run() { + finishFirstPageBind(executor); + } + }; + if (waitUntilResume(r)) { + return; + } + + Runnable onComplete = new Runnable() { + @Override + public void run() { + if (executor != null) { + executor.onLoadAnimationCompleted(); + } + } + }; + if (mDragLayer.getAlpha() < 1) { + mDragLayer.animate().alpha(1).withEndAction(onComplete).start(); + } else { + onComplete.run(); + } + } + /** * Callback saying that there aren't any more items to bind. * |