diff options
author | Adam Cohen <adamcohen@google.com> | 2014-07-21 17:44:06 -0700 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2014-08-10 18:29:36 -0700 |
commit | 9bfdb76aaf5c8679b8f2ee3a9a3df2becefb947a (patch) | |
tree | f7a8c90e206701c2129eb5c7ed4956c265478329 /src/com/android/launcher3/AppsCustomizePagedView.java | |
parent | 6075170b838bfe7a040bbff25c2c22859b7d6ee5 (diff) | |
download | android_packages_apps_Trebuchet-9bfdb76aaf5c8679b8f2ee3a9a3df2becefb947a.tar.gz android_packages_apps_Trebuchet-9bfdb76aaf5c8679b8f2ee3a9a3df2becefb947a.tar.bz2 android_packages_apps_Trebuchet-9bfdb76aaf5c8679b8f2ee3a9a3df2becefb947a.zip |
Polishing the AllApps transition
-> separating HW layers during animation to be siblings
instead of parent-child (was destroying parent layer
on each frame)
-> Unifying material transition with pre-L, everything
is the same, just missing the reveal.
Change-Id: I8f7d5e658c2d9298bea83ce8199cb35e6fc0d44e
Diffstat (limited to 'src/com/android/launcher3/AppsCustomizePagedView.java')
-rw-r--r-- | src/com/android/launcher3/AppsCustomizePagedView.java | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/src/com/android/launcher3/AppsCustomizePagedView.java b/src/com/android/launcher3/AppsCustomizePagedView.java index 0e9969697..24f90c341 100644 --- a/src/com/android/launcher3/AppsCustomizePagedView.java +++ b/src/com/android/launcher3/AppsCustomizePagedView.java @@ -213,6 +213,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen int mWidgetLoadingId = -1; PendingAddWidgetInfo mCreateWidgetInfo = null; private boolean mDraggingWidget = false; + boolean mPageBackgroundsVisible; private Toast mWidgetInstructionToast; @@ -1003,12 +1004,26 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen int heightSpec = MeasureSpec.makeMeasureSpec(mContentHeight, MeasureSpec.AT_MOST); layout.setMinimumWidth(getPageContentWidth()); layout.measure(widthSpec, heightSpec); - layout.setPadding(mAllAppsPadding.left, mAllAppsPadding.top, mAllAppsPadding.right, - mAllAppsPadding.bottom); - setVisibilityOnChildren(layout, View.VISIBLE); Resources res = getContext().getResources(); - layout.setBackground(res.getDrawable(R.drawable.quantum_panel)); + Drawable bg = res.getDrawable(R.drawable.quantum_panel); + if (bg != null) { + layout.setBackground(bg); + bg.setVisible(mPageBackgroundsVisible, false); + } + + setVisibilityOnChildren(layout, View.VISIBLE); + } + + public void setPageBackgroundsVisible(boolean visible) { + mPageBackgroundsVisible = visible; + int childCount = getChildCount(); + for (int i = 0; i < childCount; ++i) { + Drawable bg = getChildAt(i).getBackground(); + if (bg != null) { + bg.setVisible(visible, false); + } + } } public void syncAppsPageItems(int page, boolean immediate) { @@ -1438,24 +1453,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen v.setRotationY(0f); } } - - // TODO: clean this up - alpha = 1; - translationX = 0; - scale = 1; - - v.setTranslationX(translationX); - v.setScaleX(scale); - v.setScaleY(scale); - v.setAlpha(alpha); - - // If the view has 0 alpha, we set it to be invisible so as to prevent - // it from accepting touches - if (alpha == 0) { - v.setVisibility(INVISIBLE); - } else if (v.getVisibility() != VISIBLE) { - v.setVisibility(VISIBLE); - } } } |