Fixing issues with spring loaded adding.
- Delaying until items are added - Showing bg when going into spring loaded mode - Fixing regression where dropping widgets on full page would not trigger a notification - Fixing regression on tablet where pages were no longer being rotated or shown Change-Id: Iadc0c406f0c065c5029addea1abfee395eed81b9
This commit is contained in:
@@ -368,8 +368,11 @@ public abstract class PagedView extends ViewGroup {
|
||||
// we moved this functionality to a helper function so SmoothPagedView can reuse it
|
||||
protected boolean computeScrollHelper() {
|
||||
if (mScroller.computeScrollOffset()) {
|
||||
mDirtyPageAlpha = true;
|
||||
scrollTo(mScroller.getCurrX(), mScroller.getCurrY());
|
||||
// Don't bother scrolling if the page does not need to be moved
|
||||
if (mScrollX != mScroller.getCurrX() || mScrollY != mScroller.getCurrY()) {
|
||||
mDirtyPageAlpha = true;
|
||||
scrollTo(mScroller.getCurrX(), mScroller.getCurrY());
|
||||
}
|
||||
invalidate();
|
||||
return true;
|
||||
} else if (mNextPage != INVALID_PAGE) {
|
||||
@@ -652,7 +655,7 @@ public abstract class PagedView extends ViewGroup {
|
||||
if (pageCount > 0) {
|
||||
final int pageWidth = getScaledMeasuredWidth(getChildAt(0));
|
||||
final int screenWidth = getMeasuredWidth();
|
||||
int x = getRelativeChildOffset(0) + pageWidth;
|
||||
int x = getScaledRelativeChildOffset(0) + pageWidth;
|
||||
int leftScreen = 0;
|
||||
int rightScreen = 0;
|
||||
while (x <= mScrollX) {
|
||||
@@ -1255,6 +1258,10 @@ public abstract class PagedView extends ViewGroup {
|
||||
return (getMeasuredWidth() - getChildWidth(index)) / 2;
|
||||
}
|
||||
|
||||
protected int getScaledRelativeChildOffset(int index) {
|
||||
return (getMeasuredWidth() - getScaledMeasuredWidth(getChildAt(index))) / 2;
|
||||
}
|
||||
|
||||
protected int getChildOffset(int index) {
|
||||
if (getChildCount() == 0)
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user