summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/FolderIcon.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2011-05-18 15:26:57 -0700
committerAdam Cohen <adamcohen@google.com>2011-05-18 15:26:57 -0700
commit7c6932140dcbd2db88d7a809ba72ee04abb5bf26 (patch)
treec3a63efb70998c4caa0d23b4d87545d41adcfeda /src/com/android/launcher2/FolderIcon.java
parentf4b08913677e18a8412930972237b91d5a946d95 (diff)
downloadandroid_packages_apps_Trebuchet-7c6932140dcbd2db88d7a809ba72ee04abb5bf26.tar.gz
android_packages_apps_Trebuchet-7c6932140dcbd2db88d7a809ba72ee04abb5bf26.tar.bz2
android_packages_apps_Trebuchet-7c6932140dcbd2db88d7a809ba72ee04abb5bf26.zip
Fixing folder bugs:
-> Folders were not loading with ordering properly persisted -> When an item was put in the trash directly from a folder it was trying to remove the item from the folder again, sometimes removing an extra item from the folder -> Making sure the FolderIcon always shows the _last_ 4 items; this was not working when the launcher was being restarted -> Fixed a tiny rotation bug in the FolderIcon Change-Id: I27423f17fd2f2b396f844c055f1e7abb4f4d5d19
Diffstat (limited to 'src/com/android/launcher2/FolderIcon.java')
-rw-r--r--src/com/android/launcher2/FolderIcon.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/com/android/launcher2/FolderIcon.java b/src/com/android/launcher2/FolderIcon.java
index f49297eb1..939dc44de 100644
--- a/src/com/android/launcher2/FolderIcon.java
+++ b/src/com/android/launcher2/FolderIcon.java
@@ -16,6 +16,8 @@
package com.android.launcher2;
+import java.util.ArrayList;
+
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
@@ -27,6 +29,7 @@ import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
+import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.TextView;
@@ -265,13 +268,14 @@ public class FolderIcon extends FrameLayout implements DropTarget, FolderListene
int yShift = (mOriginalHeight - d.getIntrinsicHeight()) / 2;
canvas.translate(xShift, yShift);
- for (int i = Math.max(0, mFolder.getItemCount() - NUM_ITEMS_IN_PREVIEW);
- i < mFolder.getItemCount(); i++) {
- v = (TextView) mFolder.getItemAt(i);
+ ArrayList<View> items = mFolder.getItemsInReadingOrder();
+ int firstItemIndex = Math.max(0, items.size() - NUM_ITEMS_IN_PREVIEW);
+ for (int i = firstItemIndex; i < mFolder.getItemCount(); i++) {
+ v = (TextView) items.get(i);
d = v.getCompoundDrawables()[1];
canvas.translate(d.getIntrinsicWidth() / 2, d.getIntrinsicHeight() / 2);
- canvas.rotate(i == 0 ? ICON_ANGLE : -ICON_ANGLE);
+ canvas.rotate(i == firstItemIndex ? ICON_ANGLE : -ICON_ANGLE);
canvas.translate(-d.getIntrinsicWidth() / 2, -d.getIntrinsicHeight() / 2);
if (d != null) {