Merge "Don't show the outline on the current page" into jb-dev

This commit is contained in:
Michael Jurka
2012-05-08 14:30:12 -07:00
committed by Android (Google) Code Review
2 changed files with 26 additions and 7 deletions

View File

@@ -1001,7 +1001,10 @@ public class CellLayout extends ViewGroup {
}
public void setBackgroundAlphaMultiplier(float multiplier) {
mBackgroundAlphaMultiplier = multiplier;
if (mBackgroundAlphaMultiplier != multiplier) {
mBackgroundAlphaMultiplier = multiplier;
invalidate();
}
}
public float getBackgroundAlphaMultiplier() {

View File

@@ -383,7 +383,7 @@ public class Workspace extends SmoothPagedView
mIsDragOccuring = true;
updateChildrenLayersEnabled();
mLauncher.lockScreenOrientation();
setChildrenBackgroundAlphaMultipliers(1f);
// Prevent any Un/InstallShortcutReceivers from updating the db while we are dragging
InstallShortcutReceiver.enableInstallQueue();
UninstallShortcutReceiver.enableUninstallQueue();
@@ -1194,10 +1194,7 @@ public class Workspace extends SmoothPagedView
return Math.min(r / threshold, 1.0f);
}
@Override
protected void screenScrolled(int screenCenter) {
super.screenScrolled(screenCenter);
private void updatePageAlphaValues(int screenCenter) {
boolean isInOverscroll = mOverScrollX < 0 || mOverScrollX > mMaxScrollX;
if (mWorkspaceFadeInAdjacentScreens &&
mState == State.NORMAL &&
@@ -1209,10 +1206,29 @@ public class Workspace extends SmoothPagedView
float scrollProgress = getScrollProgress(screenCenter, child, i);
float alpha = 1 - Math.abs(scrollProgress);
child.getShortcutsAndWidgets().setAlpha(alpha);
if (!mIsDragOccuring) {
child.setBackgroundAlphaMultiplier(
backgroundAlphaInterpolator(Math.abs(scrollProgress)));
} else {
child.setBackgroundAlphaMultiplier(1f);
}
}
}
invalidate();
}
}
private void setChildrenBackgroundAlphaMultipliers(float a) {
for (int i = 0; i < getChildCount(); i++) {
CellLayout child = (CellLayout) getChildAt(i);
child.setBackgroundAlphaMultiplier(a);
}
}
@Override
protected void screenScrolled(int screenCenter) {
super.screenScrolled(screenCenter);
updatePageAlphaValues(screenCenter);
if (mOverScrollX < 0 || mOverScrollX > mMaxScrollX) {
int index = mOverScrollX < 0 ? 0 : getChildCount() - 1;