Merge "Updating portals visuals:"

This commit is contained in:
Adam Cohen
2011-07-27 11:58:22 -07:00
committed by Android (Google) Code Review
16 changed files with 63 additions and 5 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 810 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

+3 -2
View File
@@ -45,8 +45,9 @@
android:paddingTop="@dimen/folder_content_name_gap"
android:background="#00000000"
android:hint="@string/folder_hint_text"
android:textSize="16sp"
android:textColor="#FFF"
android:textSize="14sp"
android:textColor="#ff33b5e5"
android:textColorHighlight="#ff333333"
android:gravity="center_horizontal"
android:singleLine="true"/>
</com.android.launcher2.Folder>
+1 -1
View File
@@ -92,7 +92,7 @@
<dimen name="folder_preview_size">64dp</dimen>
<!-- The amount that the preview contents are inset from the preview background -->
<dimen name="folder_preview_padding">4dp</dimen>
<dimen name="folder_content_name_gap">8dp</dimen>
<dimen name="folder_content_name_gap">4dp</dimen>
<dimen name="folder_width_gap">0dp</dimen>
<dimen name="folder_height_gap">0dp</dimen>
</resources>
+29
View File
@@ -85,6 +85,7 @@ public class CellLayout extends ViewGroup {
private OnTouchListener mInterceptTouchListener;
private ArrayList<FolderRingAnimator> mFolderOuterRings = new ArrayList<FolderRingAnimator>();
private int[] mFolderLeaveBehindCell = {-1, -1};
private float mBackgroundAlpha;
private float mBackgroundAlphaMultiplier = 1.0f;
@@ -557,6 +558,22 @@ public class CellLayout extends ViewGroup {
d.draw(canvas);
canvas.restore();
}
if (mFolderLeaveBehindCell[0] >= 0 && mFolderLeaveBehindCell[1] >= 0) {
Drawable d = FolderIcon.sSharedFolderLeaveBehind;
int width = d.getIntrinsicWidth();
int height = d.getIntrinsicHeight();
cellToPoint(mFolderLeaveBehindCell[0], mFolderLeaveBehindCell[1], mTempLocation);
int centerX = mTempLocation[0] + mCellWidth / 2;
int centerY = mTempLocation[1] + FolderRingAnimator.sPreviewSize / 2;
canvas.save();
canvas.translate(centerX - width / 2, centerY - width / 2);
d.setBounds(0, 0, width, height);
d.draw(canvas);
canvas.restore();
}
}
public void showFolderAccept(FolderRingAnimator fra) {
@@ -570,6 +587,18 @@ public class CellLayout extends ViewGroup {
invalidate();
}
public void setFolderLeaveBehindCell(int x, int y) {
mFolderLeaveBehindCell[0] = x;
mFolderLeaveBehindCell[1] = y;
invalidate();
}
public void clearFolderLeaveBehind() {
mFolderLeaveBehindCell[0] = -1;
mFolderLeaveBehindCell[1] = -1;
invalidate();
}
@Override
public void cancelLongPress() {
super.cancelLongPress();
+8 -1
View File
@@ -71,6 +71,8 @@ public class FolderIcon extends LinearLayout implements FolderListener {
// (0 means it's not scaled at all, 1 means it's scaled to nothing)
private static final float PERSPECTIVE_SCALE_FACTOR = 0.35f;
public static Drawable sSharedFolderLeaveBehind = null;
private ImageView mPreviewBackground;
private BubbleTextView mFolderName;
@@ -135,6 +137,11 @@ public class FolderIcon extends LinearLayout implements FolderListener {
folderInfo.addListener(icon);
Resources res = launcher.getResources();
if (sSharedFolderLeaveBehind == null) {
sSharedFolderLeaveBehind = res.getDrawable(R.drawable.portal_ring_rest);
}
return icon;
}
@@ -259,7 +266,7 @@ public class FolderIcon extends LinearLayout implements FolderListener {
final int itemType = item.itemType;
return ((itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION ||
itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) &&
!mFolder.isFull() && item != mInfo);
!mFolder.isFull() && item != mInfo && !mInfo.opened);
}
public boolean acceptDrop(Object dragInfo) {
+21
View File
@@ -1754,6 +1754,12 @@ public final class Launcher extends Activity
PropertyValuesHolder scaleX = PropertyValuesHolder.ofFloat("scaleX", 1.5f);
PropertyValuesHolder scaleY = PropertyValuesHolder.ofFloat("scaleY", 1.5f);
FolderInfo info = (FolderInfo) fi.getTag();
if (info.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
CellLayout cl = (CellLayout) fi.getParent().getParent();
cl.setFolderLeaveBehindCell(info.cellX, info.cellY);
}
ObjectAnimator oa = ObjectAnimator.ofPropertyValuesHolder(fi, alpha, scaleX, scaleY);
oa.setDuration(getResources().getInteger(R.integer.config_folderAnimDuration));
oa.start();
@@ -1764,8 +1770,23 @@ public final class Launcher extends Activity
PropertyValuesHolder scaleX = PropertyValuesHolder.ofFloat("scaleX", 1.0f);
PropertyValuesHolder scaleY = PropertyValuesHolder.ofFloat("scaleY", 1.0f);
FolderInfo info = (FolderInfo) fi.getTag();
CellLayout cl = null;
if (info.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
cl = (CellLayout) fi.getParent().getParent();
}
final CellLayout layout = cl;
ObjectAnimator oa = ObjectAnimator.ofPropertyValuesHolder(fi, alpha, scaleX, scaleY);
oa.setDuration(getResources().getInteger(R.integer.config_folderAnimDuration));
oa.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (layout != null) {
layout.clearFolderLeaveBehind();
}
}
});
oa.start();
}
@@ -143,7 +143,7 @@ class LauncherSettings {
/**
* The X coordinate of the cell holding the favorite
* (if container is CONTAINER_DESKTOP or CONTAINER_DOCK)
* (if container is CONTAINER_HOTSEAT or CONTAINER_HOTSEAT)
* <P>Type: INTEGER</P>
*/
static final String CELLX = "cellX";