private OnTouchListener mInterceptTouchListener;
private float mBackgroundAlpha;
+ private float mBackgroundAlphaMultiplier = 1.0f;
private Drawable mBackground;
private Drawable mBackgroundMini;
bg = mHover ? mBackgroundHover : mBackground;
}
if (bg != null) {
- bg.setAlpha((int) (mBackgroundAlpha * 255));
+ bg.setAlpha((int) (mBackgroundAlpha * mBackgroundAlphaMultiplier * 255));
bg.setBounds(mBackgroundRect);
bg.draw(canvas);
}
return mBackgroundAlpha;
}
+ public void setBackgroundAlphaMultiplier(float multiplier) {
+ mBackgroundAlphaMultiplier = multiplier;
+ }
+
public void setBackgroundAlpha(float alpha) {
mBackgroundAlpha = alpha;
invalidate();
// These are extra scale factors to apply to the mini home screens
// so as to achieve the desired transform
- private static final float EXTRA_SCALE_FACTOR_0 = 0.97f;
+ private static final float EXTRA_SCALE_FACTOR_0 = 0.972f;
private static final float EXTRA_SCALE_FACTOR_1 = 1.0f;
- private static final float EXTRA_SCALE_FACTOR_2 = 1.08f;
+ private static final float EXTRA_SCALE_FACTOR_2 = 1.10f;
private static final int BACKGROUND_FADE_OUT_DELAY = 300;
private static final int BACKGROUND_FADE_OUT_DURATION = 300;
private ShrinkPosition mWaitingToShrinkPosition;
private boolean mInScrollArea = false;
+ private boolean mInDragMode = false;
private final HolographicOutlineHelper mOutlineHelper = new HolographicOutlineHelper();
private Bitmap mDragOutline = null;
mIsInUnshrinkAnimation = false;
}
};
-
mSnapVelocity = 600;
}
}
}
}
-
return folders;
}
protected void screenScrolled(int screenCenter) {
final int halfScreenSize = getMeasuredWidth() / 2;
for (int i = 0; i < getChildCount(); i++) {
- View v = getChildAt(i);
- if (v != null) {
- int totalDistance = v.getMeasuredWidth() + mPageSpacing;
+ CellLayout cl = (CellLayout) getChildAt(i);
+ if (cl != null) {
+ int totalDistance = cl.getMeasuredWidth() + mPageSpacing;
int delta = screenCenter - (getChildOffset(i) -
getRelativeChildOffset(i) + halfScreenSize);
scrollProgress = Math.min(scrollProgress, 1.0f);
scrollProgress = Math.max(scrollProgress, -1.0f);
+ float mult = mInDragMode ? 1.0f : Math.abs(scrollProgress);
+ cl.setBackgroundAlphaMultiplier(mult);
+
float rotation = WORKSPACE_ROTATION * scrollProgress;
- v.setRotationY(rotation);
+ cl.setRotationY(rotation);
}
}
}
mTouchState = TOUCH_STATE_REST;
mActivePointerId = INVALID_POINTER;
+ CellLayout currentPage = (CellLayout) getChildAt(mCurrentPage);
+ currentPage.setBackgroundAlphaMultiplier(1.0f);
+
final Resources res = getResources();
final int screenWidth = getWidth();
final int screenHeight = getHeight();
mDragTargetLayout = getCurrentDropLayout();
mDragTargetLayout.onDragEnter();
showOutlines();
+ mInDragMode = true;
+ CellLayout cl = (CellLayout) getChildAt(mCurrentPage);
+ cl.setBackgroundAlphaMultiplier(1.0f);
}
}
}
if (!mIsPageMoving) {
hideOutlines();
+ mInDragMode = false;
}
clearAllHovers();
}