mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 19:38:21 +00:00
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
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user