summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2011-07-26 21:07:43 -0700
committerAdam Cohen <adamcohen@google.com>2011-07-26 21:14:39 -0700
commitc51934bfdfed6a5011c6d6c5b7b70f2d75613d41 (patch)
treef7a71fe9c418dea673413bb9df396a6cf8993c7f
parent2f84ef259314b0bef20f6e7e503377212fadc88c (diff)
downloadandroid_packages_apps_Trebuchet-c51934bfdfed6a5011c6d6c5b7b70f2d75613d41.tar.gz
android_packages_apps_Trebuchet-c51934bfdfed6a5011c6d6c5b7b70f2d75613d41.tar.bz2
android_packages_apps_Trebuchet-c51934bfdfed6a5011c6d6c5b7b70f2d75613d41.zip
Updating portals visuals:
-> added leave behind asset to dock, issue 5052467 -> new assets -> modified text Change-Id: Ie395b768658dd5c02443b37c4f58a02cf3e86e59
-rw-r--r--res/drawable-hdpi/portal_container_holo.9.pngbin9722 -> 1290 bytes
-rw-r--r--res/drawable-hdpi/portal_ring_inner_holo.pngbin10310 -> 10584 bytes
-rw-r--r--res/drawable-hdpi/portal_ring_outer_holo.pngbin17408 -> 15330 bytes
-rw-r--r--res/drawable-hdpi/portal_ring_rest.pngbin0 -> 5101 bytes
-rw-r--r--res/drawable-mdpi/portal_container_holo.9.pngbin5392 -> 810 bytes
-rw-r--r--res/drawable-mdpi/portal_ring_inner_holo.pngbin5672 -> 5698 bytes
-rw-r--r--res/drawable-mdpi/portal_ring_outer_holo.pngbin8856 -> 7821 bytes
-rw-r--r--res/drawable-mdpi/portal_ring_rest.pngbin0 -> 2904 bytes
-rw-r--r--res/drawable-xhdpi/portal_container_holo.9.pngbin2103 -> 2012 bytes
-rw-r--r--res/drawable-xhdpi/portal_ring_inner_holo.pngbin16265 -> 16805 bytes
-rw-r--r--res/layout/user_folder.xml5
-rw-r--r--res/values/dimens.xml2
-rw-r--r--src/com/android/launcher2/CellLayout.java29
-rw-r--r--src/com/android/launcher2/FolderIcon.java9
-rw-r--r--src/com/android/launcher2/Launcher.java21
-rw-r--r--src/com/android/launcher2/LauncherSettings.java2
16 files changed, 63 insertions, 5 deletions
diff --git a/res/drawable-hdpi/portal_container_holo.9.png b/res/drawable-hdpi/portal_container_holo.9.png
index ab846f66e..20e880867 100644
--- a/res/drawable-hdpi/portal_container_holo.9.png
+++ b/res/drawable-hdpi/portal_container_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/portal_ring_inner_holo.png b/res/drawable-hdpi/portal_ring_inner_holo.png
index cd40594b9..7f48e7363 100644
--- a/res/drawable-hdpi/portal_ring_inner_holo.png
+++ b/res/drawable-hdpi/portal_ring_inner_holo.png
Binary files differ
diff --git a/res/drawable-hdpi/portal_ring_outer_holo.png b/res/drawable-hdpi/portal_ring_outer_holo.png
index 1a66a44b1..4ad47bffe 100644
--- a/res/drawable-hdpi/portal_ring_outer_holo.png
+++ b/res/drawable-hdpi/portal_ring_outer_holo.png
Binary files differ
diff --git a/res/drawable-hdpi/portal_ring_rest.png b/res/drawable-hdpi/portal_ring_rest.png
new file mode 100644
index 000000000..5e215d34d
--- /dev/null
+++ b/res/drawable-hdpi/portal_ring_rest.png
Binary files differ
diff --git a/res/drawable-mdpi/portal_container_holo.9.png b/res/drawable-mdpi/portal_container_holo.9.png
index 56a5b8754..90fb1d102 100644
--- a/res/drawable-mdpi/portal_container_holo.9.png
+++ b/res/drawable-mdpi/portal_container_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/portal_ring_inner_holo.png b/res/drawable-mdpi/portal_ring_inner_holo.png
index 9addb3054..4dbae0626 100644
--- a/res/drawable-mdpi/portal_ring_inner_holo.png
+++ b/res/drawable-mdpi/portal_ring_inner_holo.png
Binary files differ
diff --git a/res/drawable-mdpi/portal_ring_outer_holo.png b/res/drawable-mdpi/portal_ring_outer_holo.png
index 610386934..a70acf25d 100644
--- a/res/drawable-mdpi/portal_ring_outer_holo.png
+++ b/res/drawable-mdpi/portal_ring_outer_holo.png
Binary files differ
diff --git a/res/drawable-mdpi/portal_ring_rest.png b/res/drawable-mdpi/portal_ring_rest.png
new file mode 100644
index 000000000..c3203d942
--- /dev/null
+++ b/res/drawable-mdpi/portal_ring_rest.png
Binary files differ
diff --git a/res/drawable-xhdpi/portal_container_holo.9.png b/res/drawable-xhdpi/portal_container_holo.9.png
index 55c701bcc..3c8193bd3 100644
--- a/res/drawable-xhdpi/portal_container_holo.9.png
+++ b/res/drawable-xhdpi/portal_container_holo.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/portal_ring_inner_holo.png b/res/drawable-xhdpi/portal_ring_inner_holo.png
index dfdd622a4..fc3d3c0c4 100644
--- a/res/drawable-xhdpi/portal_ring_inner_holo.png
+++ b/res/drawable-xhdpi/portal_ring_inner_holo.png
Binary files differ
diff --git a/res/layout/user_folder.xml b/res/layout/user_folder.xml
index 6b19603f3..7597bc78e 100644
--- a/res/layout/user_folder.xml
+++ b/res/layout/user_folder.xml
@@ -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>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 215f698e3..dc18a7234 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -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>
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index 65ca16270..518c79fc2 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -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();
diff --git a/src/com/android/launcher2/FolderIcon.java b/src/com/android/launcher2/FolderIcon.java
index 949a25e58..684ecd770 100644
--- a/src/com/android/launcher2/FolderIcon.java
+++ b/src/com/android/launcher2/FolderIcon.java
@@ -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) {
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index bc341ef81..0f302a012 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -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();
}
diff --git a/src/com/android/launcher2/LauncherSettings.java b/src/com/android/launcher2/LauncherSettings.java
index fcacdec5f..ee003716b 100644
--- a/src/com/android/launcher2/LauncherSettings.java
+++ b/src/com/android/launcher2/LauncherSettings.java
@@ -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";