More folder cleanup

-> Eliminating out ring
-> Fixing the cursor color
-> Using "nolip" asset appropriately

Change-Id: Ie0e341e865298555dcb0fcb5644e1f3e6b5e39e6
This commit is contained in:
Adam Cohen 2013-09-20 17:04:51 -07:00
parent 477828cc83
commit 5108bc0fd9
4 changed files with 21 additions and 19 deletions

View File

@ -46,6 +46,7 @@
android:textSize="14sp" android:textSize="14sp"
android:textColor="#ff777777" android:textColor="#ff777777"
android:textColorHighlight="#ff333333" android:textColorHighlight="#ff333333"
android:textCursorDrawable="@null"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:singleLine="true" android:singleLine="true"
android:imeOptions="flagNoExtractUi" android:imeOptions="flagNoExtractUi"

View File

@ -491,31 +491,30 @@ public class CellLayout extends ViewGroup {
for (int i = 0; i < mFolderOuterRings.size(); i++) { for (int i = 0; i < mFolderOuterRings.size(); i++) {
FolderRingAnimator fra = mFolderOuterRings.get(i); FolderRingAnimator fra = mFolderOuterRings.get(i);
// Draw outer ring Drawable d;
Drawable d = FolderRingAnimator.sSharedOuterRingDrawable; int width, height;
int width = (int) (fra.getOuterRingSize() * getChildrenScale());
int height = width;
cellToPoint(fra.mCellX, fra.mCellY, mTempLocation); cellToPoint(fra.mCellX, fra.mCellY, mTempLocation);
View child = getChildAt(fra.mCellX, fra.mCellY); View child = getChildAt(fra.mCellX, fra.mCellY);
int centerX = mTempLocation[0] + mCellWidth / 2;
int centerY = mTempLocation[1] + previewOffset / 2 +
child.getPaddingTop() + grid.folderBackgroundOffset;
if (child != null) { if (child != null) {
int centerX = mTempLocation[0] + mCellWidth / 2; // Draw outer ring, if it exists
int centerY = mTempLocation[1] + previewOffset / 2 + if (FolderIcon.HAS_OUTER_RING) {
child.getPaddingTop() + grid.folderBackgroundOffset; d = FolderRingAnimator.sSharedOuterRingDrawable;
width = (int) (fra.getOuterRingSize() * getChildrenScale());
canvas.save(); height = width;
canvas.translate(centerX - width / 2, centerY - height / 2); canvas.save();
d.setBounds(0, 0, width, height); canvas.translate(centerX - width / 2, centerY - height / 2);
d.draw(canvas); d.setBounds(0, 0, width, height);
canvas.restore(); d.draw(canvas);
canvas.restore();
}
// Draw inner ring // Draw inner ring
d = FolderRingAnimator.sSharedInnerRingDrawable; d = FolderRingAnimator.sSharedInnerRingDrawable;
width = (int) (fra.getInnerRingSize() * getChildrenScale()); width = (int) (fra.getInnerRingSize() * getChildrenScale());
height = width; height = width;
centerX = mTempLocation[0] + mCellWidth / 2;
centerY = mTempLocation[1] + previewOffset / 2 +
child.getPaddingTop() + grid.folderBackgroundOffset;
canvas.save(); canvas.save();
canvas.translate(centerX - width / 2, centerY - width / 2); canvas.translate(centerX - width / 2, centerY - width / 2);
d.setBounds(0, 0, width, height); d.setBounds(0, 0, width, height);

View File

@ -73,6 +73,9 @@ public class FolderIcon extends LinearLayout implements FolderListener {
// The amount of vertical spread between items in the stack [0...1] // The amount of vertical spread between items in the stack [0...1]
private static final float PERSPECTIVE_SHIFT_FACTOR = 0.24f; private static final float PERSPECTIVE_SHIFT_FACTOR = 0.24f;
// Flag as to whether or not to draw an outer ring. Currently none is designed.
public static final boolean HAS_OUTER_RING = false;
// The degree to which the item in the back of the stack is scaled [0...1] // The degree to which the item in the back of the stack is scaled [0...1]
// (0 means it's not scaled at all, 1 means it's scaled to nothing) // (0 means it's not scaled at all, 1 means it's scaled to nothing)
private static final float PERSPECTIVE_SCALE_FACTOR = 0.35f; private static final float PERSPECTIVE_SCALE_FACTOR = 0.35f;
@ -201,7 +204,7 @@ public class FolderIcon extends LinearLayout implements FolderListener {
sPreviewSize = grid.folderIconSizePx; sPreviewSize = grid.folderIconSizePx;
sPreviewPadding = res.getDimensionPixelSize(R.dimen.folder_preview_padding); sPreviewPadding = res.getDimensionPixelSize(R.dimen.folder_preview_padding);
sSharedOuterRingDrawable = res.getDrawable(R.drawable.portal_ring_outer_holo); sSharedOuterRingDrawable = res.getDrawable(R.drawable.portal_ring_outer_holo);
sSharedInnerRingDrawable = res.getDrawable(R.drawable.portal_ring_inner_holo); sSharedInnerRingDrawable = res.getDrawable(R.drawable.portal_ring_inner_nolip_holo);
sSharedFolderLeaveBehind = res.getDrawable(R.drawable.portal_ring_rest); sSharedFolderLeaveBehind = res.getDrawable(R.drawable.portal_ring_rest);
sStaticValuesDirty = false; sStaticValuesDirty = false;
} }

View File

@ -991,7 +991,6 @@ public class Workspace extends SmoothPagedView
clearChildrenCache(); clearChildrenCache();
} }
if (mDragController.isDragging()) { if (mDragController.isDragging()) {
if (isSmall()) { if (isSmall()) {
// If we are in springloaded mode, then force an event to check if the current touch // If we are in springloaded mode, then force an event to check if the current touch