diff options
author | Adam Cohen <adamcohen@google.com> | 2014-08-10 18:30:55 -0700 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2014-08-11 15:40:37 +0000 |
commit | 4e243a2dad3700868035256af1882d7a4fee2385 (patch) | |
tree | 47545a50e089337b8c912ac8bd406970cdf6e7f1 /src/com/android/launcher3/Launcher.java | |
parent | 9bfdb76aaf5c8679b8f2ee3a9a3df2becefb947a (diff) | |
download | android_packages_apps_Trebuchet-4e243a2dad3700868035256af1882d7a4fee2385.tar.gz android_packages_apps_Trebuchet-4e243a2dad3700868035256af1882d7a4fee2385.tar.bz2 android_packages_apps_Trebuchet-4e243a2dad3700868035256af1882d7a4fee2385.zip |
Updating the widget tray
-> adding dark panel / associated visual updates
-> cleaning up the sizing / padding / to match all apps
-> fixing a couple things from previous CL
-> (removed Context#getDrawable() calls, L-only)
Change-Id: Ia65a6eb704b35f74e7305be9334c27971b22235a
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 75ba8fd99..ebf3cc2ff 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -3205,6 +3205,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); @@ -3227,24 +3233,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); @@ -3267,7 +3276,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 @@ -3396,6 +3407,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); @@ -3410,7 +3428,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); @@ -3420,23 +3438,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); @@ -3479,7 +3500,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(); } |