diff options
author | Adam Cohen <adamcohen@google.com> | 2014-08-11 15:42:28 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-09 00:40:15 +0000 |
commit | 6551b7ef07b4d73c096cbfb22002e080b498cbbb (patch) | |
tree | c99b07defc44f522cf51bdf9006c5bc7e139530c /src/com/android/launcher3/Launcher.java | |
parent | 5337aea1536c11e5bfef49a14297fd4649baa3a3 (diff) | |
parent | 4e243a2dad3700868035256af1882d7a4fee2385 (diff) | |
download | android_packages_apps_Trebuchet-6551b7ef07b4d73c096cbfb22002e080b498cbbb.tar.gz android_packages_apps_Trebuchet-6551b7ef07b4d73c096cbfb22002e080b498cbbb.tar.bz2 android_packages_apps_Trebuchet-6551b7ef07b4d73c096cbfb22002e080b498cbbb.zip |
Merge "Updating the widget tray" into ub-now-porkchop
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 87 |
1 files changed, 55 insertions, 32 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 9e176f076..5eedc8a3a 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -3248,6 +3248,12 @@ public class Launcher extends Activity final View page = content.getPageAt(content.getCurrentPage()); final View revealView = toView.findViewById(R.id.fake_page); + if (contentType == AppsCustomizePagedView.ContentType.Widgets) { + revealView.setBackground(res.getDrawable(R.drawable.quantum_panel_dark)); + } else { + revealView.setBackground(res.getDrawable(R.drawable.quantum_panel)); + } + // Hide the real page background, and swap in the fake one revealView.setVisibility(View.VISIBLE); content.setPageBackgroundsVisible(false); @@ -3270,24 +3276,27 @@ public class Launcher extends Activity mStateAnimation.play(panelAlphaAndDrift); - page.setVisibility(View.VISIBLE); - page.setLayerType(View.LAYER_TYPE_HARDWARE, null); - - ObjectAnimator pageDrift = ObjectAnimator.ofFloat(page, "translationY", yDrift, 0); - pageDrift.setDuration(revealDuration); - pageDrift.setInterpolator(new LogDecelerateInterpolator(100, 0)); - mStateAnimation.play(pageDrift); - - // TODO (adamcohen): remove this 0.01f hack once fw is fixed - // it's there to work around a framework bug (16918357) - page.setAlpha(0.01f); - ObjectAnimator itemsAlpha = ObjectAnimator.ofFloat(page, "alpha", 0.01f, 1f); - itemsAlpha.setDuration(revealDuration); - itemsAlpha.setInterpolator(new AccelerateInterpolator(1.5f)); - itemsAlpha.setStartDelay(itemsAlphaStagger); - mStateAnimation.play(itemsAlpha); + if (page != null) { + page.setVisibility(View.VISIBLE); + page.setLayerType(View.LAYER_TYPE_HARDWARE, null); + + ObjectAnimator pageDrift = ObjectAnimator.ofFloat(page, "translationY", yDrift, 0); + pageDrift.setDuration(revealDuration); + pageDrift.setInterpolator(new LogDecelerateInterpolator(100, 0)); + mStateAnimation.play(pageDrift); + + // TODO (adamcohen): remove this 0.01f hack once fw is fixed + // it's there to work around a framework bug (16918357) + page.setAlpha(0.01f); + ObjectAnimator itemsAlpha = ObjectAnimator.ofFloat(page, "alpha", 0.01f, 1f); + itemsAlpha.setDuration(revealDuration); + itemsAlpha.setInterpolator(new AccelerateInterpolator(1.5f)); + itemsAlpha.setStartDelay(itemsAlphaStagger); + mStateAnimation.play(itemsAlpha); + } - View pageIndicators = fromView.findViewById(R.id.apps_customize_page_indicator); + View pageIndicators = toView.findViewById(R.id.apps_customize_page_indicator); + pageIndicators.setAlpha(0.01f); ObjectAnimator indicatorsAlpha = ObjectAnimator.ofFloat(pageIndicators, "alpha", 1f); indicatorsAlpha.setDuration(revealDuration); @@ -3310,7 +3319,9 @@ public class Launcher extends Activity revealView.setVisibility(View.INVISIBLE); revealView.setLayerType(View.LAYER_TYPE_NONE, null); - page.setLayerType(View.LAYER_TYPE_NONE, null); + if (page != null) { + page.setLayerType(View.LAYER_TYPE_NONE, null); + } content.setPageBackgroundsVisible(true); // Hide the search bar @@ -3439,6 +3450,13 @@ public class Launcher extends Activity final View page = content.getPageAt(content.getNextPage()); final View revealView = fromView.findViewById(R.id.fake_page); + AppsCustomizePagedView.ContentType contentType = content.getContentType(); + if (contentType == AppsCustomizePagedView.ContentType.Widgets) { + revealView.setBackground(res.getDrawable(R.drawable.quantum_panel_dark)); + } else { + revealView.setBackground(res.getDrawable(R.drawable.quantum_panel)); + } + int width = revealView.getMeasuredWidth(); int height = revealView.getMeasuredHeight(); float revealRadius = (float) Math.sqrt((width * width) / 4 + (height * height) / 4); @@ -3453,7 +3471,7 @@ public class Launcher extends Activity PropertyValuesHolder panelAlpha = PropertyValuesHolder.ofFloat(View.ALPHA, 1f, 0f); PropertyValuesHolder panelDrift = - PropertyValuesHolder.ofFloat(View.TRANSLATION_Y, 0, yDrift); + PropertyValuesHolder.ofFloat("translationY", 0, yDrift); ObjectAnimator panelAlphaAndDrift = ObjectAnimator.ofPropertyValuesHolder(revealView, panelAlpha, panelDrift); panelAlphaAndDrift.setDuration(revealDuration); @@ -3463,23 +3481,26 @@ public class Launcher extends Activity mStateAnimation.play(panelAlphaAndDrift); - page.setLayerType(View.LAYER_TYPE_HARDWARE, null); + if (page != null) { + page.setLayerType(View.LAYER_TYPE_HARDWARE, null); - ObjectAnimator pageDrift = ObjectAnimator.ofFloat(page, View.TRANSLATION_Y, 0, yDrift); - pageDrift.setDuration(revealDuration); - pageDrift.setInterpolator(new LogDecelerateInterpolator(100, 0)); - pageDrift.setStartDelay(itemsAlphaStagger); - mStateAnimation.play(pageDrift); + ObjectAnimator pageDrift = ObjectAnimator.ofFloat(page, "translationY", 0, yDrift); + pageDrift.setDuration(revealDuration); + pageDrift.setInterpolator(new LogDecelerateInterpolator(100, 0)); + pageDrift.setStartDelay(itemsAlphaStagger); + mStateAnimation.play(pageDrift); - page.setAlpha(1f); - ObjectAnimator itemsAlpha = ObjectAnimator.ofFloat(page, View.ALPHA, 1f, 0f); - itemsAlpha.setDuration(revealDuration); - itemsAlpha.setInterpolator(new LogDecelerateInterpolator(100, 0)); - mStateAnimation.play(itemsAlpha); + page.setAlpha(1f); + ObjectAnimator itemsAlpha = ObjectAnimator.ofFloat(page, View.ALPHA, 1f, 0f); + itemsAlpha.setDuration(revealDuration); + itemsAlpha.setInterpolator(new LogDecelerateInterpolator(100, 0)); + mStateAnimation.play(itemsAlpha); + } View pageIndicators = fromView.findViewById(R.id.apps_customize_page_indicator); + pageIndicators.setAlpha(1f); ObjectAnimator indicatorsAlpha = - ObjectAnimator.ofFloat(pageIndicators, View.ALPHA, 0f); + ObjectAnimator.ofFloat(pageIndicators, "alpha", 0f); indicatorsAlpha.setDuration(revealDuration); indicatorsAlpha.setInterpolator(new DecelerateInterpolator(1.5f)); mStateAnimation.play(indicatorsAlpha); @@ -3522,7 +3543,9 @@ public class Launcher extends Activity } revealView.setLayerType(View.LAYER_TYPE_NONE, null); - page.setLayerType(View.LAYER_TYPE_NONE, null); + if (page != null) { + page.setLayerType(View.LAYER_TYPE_NONE, null); + } content.setPageBackgroundsVisible(true); mAppsCustomizeContent.updateCurrentPageScroll(); } |