summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2013-11-11 18:49:56 +0000
committerDanesh M <daneshm90@gmail.com>2014-06-06 00:43:11 -0700
commitbdc238a6103739ab9750edfe458de2d773e29f09 (patch)
treecc17805d09c78eed7f7dad77d6cd688c5d361d20 /src/com/android
parentfb1fd749d37f95c355b51caa20353842e7f7fdb1 (diff)
downloadandroid_packages_apps_Trebuchet-bdc238a6103739ab9750edfe458de2d773e29f09.tar.gz
android_packages_apps_Trebuchet-bdc238a6103739ab9750edfe458de2d773e29f09.tar.bz2
android_packages_apps_Trebuchet-bdc238a6103739ab9750edfe458de2d773e29f09.zip
Small tweaks to custom content management
-> Never allow the custom content overhang onto the viewport when it is not the current page -> Never fade the custom content screen as a consequence of scrolling Change-Id: I91a4cfb3f740ee8b429084fce1c96258bac8dd9e
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/launcher3/PagedView.java20
-rw-r--r--src/com/android/launcher3/Workspace.java2
2 files changed, 20 insertions, 2 deletions
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index 36935401f..b1b3a9328 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -915,6 +915,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
int verticalPadding = getPaddingTop() + getPaddingBottom();
LayoutParams lp = (LayoutParams) getChildAt(startIndex).getLayoutParams();
+ LayoutParams nextLp;
int childLeft = offsetX + (lp.isFullScreenPage ? 0 : getPaddingLeft());
if (mPageScrolls == null || getChildCount() != mChildCountOnLastLayout) {
@@ -944,7 +945,24 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
int scrollOffsetLeft = lp.isFullScreenPage ? 0 : getPaddingLeft();
mPageScrolls[i] = childLeft - scrollOffsetLeft - offsetX;
- childLeft += childWidth + mPageSpacing;
+
+ int pageGap = mPageSpacing;
+ int next = i + delta;
+ if (next != endIndex) {
+ nextLp = (LayoutParams) getPageAt(next).getLayoutParams();
+ } else {
+ nextLp = null;
+ }
+
+ // Prevent full screen pages from showing in the viewport
+ // when they are not the current page.
+ if (lp.isFullScreenPage) {
+ pageGap = getPaddingLeft();
+ } else if (nextLp != null && nextLp.isFullScreenPage) {
+ pageGap = getPaddingRight();
+ }
+
+ childLeft += childWidth + pageGap;
}
}
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 078d25665..7dcacc7c9 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -1546,7 +1546,7 @@ public class Workspace extends SmoothPagedView
mState == State.NORMAL &&
!mIsSwitchingState &&
!isInOverscroll) {
- for (int i = 0; i < getChildCount(); i++) {
+ for (int i = numCustomPages(); i < getChildCount(); i++) {
CellLayout child = (CellLayout) getChildAt(i);
if (child != null) {
float scrollProgress = getScrollProgress(screenCenter, child, i);