diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2016-06-15 16:45:48 -0700 |
---|---|---|
committer | Hyunyoung Song <hyunyoungs@google.com> | 2016-06-15 16:45:48 -0700 |
commit | a9a8a4221709cc3fda48fd80d4213d25183b8bf7 (patch) | |
tree | 005e7472b77670a8293194f12808ab14b3d35962 /src/com/android/launcher3/allapps/AllAppsContainerView.java | |
parent | 9417686f73488ee3c2943bcd0498166c09cd4f0b (diff) | |
download | android_packages_apps_Trebuchet-a9a8a4221709cc3fda48fd80d4213d25183b8bf7.tar.gz android_packages_apps_Trebuchet-a9a8a4221709cc3fda48fd80d4213d25183b8bf7.tar.bz2 android_packages_apps_Trebuchet-a9a8a4221709cc3fda48fd80d4213d25183b8bf7.zip |
UI fixes to All apps pull up work
b/28917826
- nav bar change to light when top of the all apps container
passes y mid point of the status bar
- apps search edit box change when top of the all apps passes
the bottom of nav bar
- Restrict pull up to work only if the ACTION_DOWN event started
from the hotseat.
- Landscape: reverted old padding and margin. Only the interaction
is different.
- Tuning of the motion spec
- Animation duration respects fling speed more agressively.
- and many more small bugs...
Change-Id: Icde4093c41eeab8c9c6d9dc8b7d57adc3b171349
Diffstat (limited to 'src/com/android/launcher3/allapps/AllAppsContainerView.java')
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsContainerView.java | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index a74c4c5ab..b5dc0c086 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -185,7 +185,8 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc mApps.setAdapter(mAdapter); mLayoutManager = mAdapter.getLayoutManager(); mItemDecoration = mAdapter.getItemDecoration(); - if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) { + DeviceProfile grid = mLauncher.getDeviceProfile(); + if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP && !grid.isLandscape) { mRecyclerViewTopBottomPadding = 0; setPadding(0, 0, 0, 0); } else { @@ -350,7 +351,12 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc mAppsRecyclerView.setPremeasuredIconHeights(predIcon.getMeasuredHeight(), icon.getMeasuredHeight()); - updatePaddingsAndMargins(); + // TODO(hyunyoungs): clean up setting the content and the reveal view. + if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) { + getContentView().setBackground(null); + getRevealView().setVisibility(View.VISIBLE); + getRevealView().setAlpha(AllAppsTransitionController.ALL_APPS_FINAL_ALPHA); + } } @Override @@ -358,6 +364,7 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + updatePaddingsAndMargins(); mContentBounds.set(mHorizontalPadding, 0, MeasureSpec.getSize(widthMeasureSpec) - mHorizontalPadding, MeasureSpec.getSize(heightMeasureSpec)); @@ -366,6 +373,7 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc int availableWidth = (!mContentBounds.isEmpty() ? mContentBounds.width() : MeasureSpec.getSize(widthMeasureSpec)) - 2 * mAppsRecyclerView.getMaxScrollbarWidth(); + grid.updateAppsViewNumCols(getResources(), availableWidth); if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) { if (mNumAppsPerRow != grid.inv.numColumns || mNumPredictedAppsPerRow != grid.inv.numColumns) { @@ -378,6 +386,7 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc if (mNumAppsPerRow > 0) { int iconSize = availableWidth / mNumAppsPerRow; int iconSpacing = (iconSize - grid.allAppsIconSizePx) / 2; + mSearchInput.setPaddingRelative(iconSpacing, 0, iconSpacing, 0); } } super.onMeasure(widthMeasureSpec, heightMeasureSpec); @@ -450,23 +459,25 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc lp.leftMargin = bgPadding.left; lp.rightMargin = bgPadding.right; + DeviceProfile grid = mLauncher.getDeviceProfile(); if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) { - MarginLayoutParams mlp = (MarginLayoutParams) mAppsRecyclerView.getLayoutParams(); + if (!grid.isLandscape) { + MarginLayoutParams mlp = (MarginLayoutParams) mAppsRecyclerView.getLayoutParams(); - int navBarHeight = 84; /* replace with mInset.height() in dragLayer */ - DeviceProfile grid = mLauncher.getDeviceProfile(); - int height = navBarHeight + grid.hotseatCellHeightPx; + int navBarHeight = mLauncher.getDragLayer().getInsets().top; + int height = navBarHeight + grid.hotseatCellHeightPx; - mlp.topMargin = height; - mAppsRecyclerView.setLayoutParams(mlp); + mlp.topMargin = height; + mAppsRecyclerView.setLayoutParams(mlp); - LinearLayout.LayoutParams llp = - (LinearLayout.LayoutParams) mSearchInput.getLayoutParams(); - llp.topMargin = navBarHeight; - mSearchInput.setLayoutParams(llp); + LinearLayout.LayoutParams llp = + (LinearLayout.LayoutParams) mSearchInput.getLayoutParams(); + llp.topMargin = navBarHeight; + mSearchInput.setLayoutParams(llp); - lp.height = height; - mSearchContainer.setBackground(null); + lp.height = height; + } + mSearchContainer.getBackground().setAlpha(0); } mSearchContainer.setLayoutParams(lp); } |