summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2016-06-30 00:41:36 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-06-30 00:41:36 +0000
commit3ccedd234acb1534190c596351cf293e8ef4727a (patch)
treeb287d78e1ec4369bb5f75ceb10d28e4bfdbaaa85 /src/com/android
parentdff510c0a55b375b3d1b46b3762a896ebdc17bdc (diff)
parent83fb07bb6cb8817f5c35ff63206a9fe2a1d3ebce (diff)
downloadandroid_packages_apps_Trebuchet-3ccedd234acb1534190c596351cf293e8ef4727a.tar.gz
android_packages_apps_Trebuchet-3ccedd234acb1534190c596351cf293e8ef4727a.tar.bz2
android_packages_apps_Trebuchet-3ccedd234acb1534190c596351cf293e8ef4727a.zip
Merge "Make very first pull up should always work" into ub-launcher3-calgary
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/launcher3/allapps/AllAppsTransitionController.java38
1 files changed, 16 insertions, 22 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
index 97be4ed4a..304e8989e 100644
--- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java
+++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
@@ -175,9 +175,8 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
if (mAppsView == null) {
return false; // early termination.
}
- if (0 <= mShiftStart + displacement && mShiftStart + displacement < mShiftRange) {
- setProgress(mShiftStart + displacement);
- }
+ float progress = Math.min(Math.max(0, mShiftStart + displacement), mShiftRange);
+ setProgress(progress);
return true;
}
@@ -233,11 +232,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
mStatusBarHeight = mLauncher.getDragLayer().getInsets().top;
mHotseat.setVisibility(View.VISIBLE);
mHotseat.bringToFront();
- if (!mLauncher.getDeviceProfile().isVerticalBarLayout()) {
- mShiftRange = mHotseat.getTop();
- } else {
- mShiftRange = mHotseat.getBottom();
- }
+
if (!mLauncher.isAllAppsVisible()) {
mLauncher.tryAndUpdatePredictedApps();
@@ -248,20 +243,6 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
mAppsView.getContentView().setBackground(null);
mAppsView.getRevealView().setVisibility(View.VISIBLE);
mAppsView.getRevealView().setAlpha(mHotseatBackgroundAlpha);
-
- DeviceProfile grid= mLauncher.getDeviceProfile();
- if (!grid.isVerticalBarLayout()) {
- mShiftRange = mHotseat.getTop();
- } else {
- mShiftRange = mHotseat.getBottom();
- }
- mAppsView.getRevealView().setAlpha(mHotseatBackgroundAlpha);
- setProgress(mShiftRange);
- } else {
- View child = ((CellLayout) mWorkspace.getChildAt(mWorkspace.getNextPage()))
- .getShortcutsAndWidgets();
- child.setVisibility(View.VISIBLE);
- child.setAlpha(1f);
}
} else {
setProgress(mShiftCurrent);
@@ -445,5 +426,18 @@ public class AllAppsTransitionController implements TouchController, VerticalPul
mAppsView = appsView;
mHotseat = hotseat;
mWorkspace = workspace;
+ mHotseat.addOnLayoutChangeListener(new View.OnLayoutChangeListener(){
+ public void onLayoutChange(View v, int left, int top, int right, int bottom,
+ int oldLeft, int oldTop, int oldRight, int oldBottom) {
+ if (!mLauncher.getDeviceProfile().isVerticalBarLayout()) {
+ mShiftRange = top;
+ } else {
+ mShiftRange = bottom;
+ }
+ if (!mLauncher.isAllAppsVisible()) {
+ setProgress(mShiftRange);
+ }
+ }
+ });
}
}