Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6de1ba33 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Fixing crash in empty folders. (Bug 11627191)" into jb-ub-now-jolly-elf

parents a67d1ea0 68b66784
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -408,6 +408,15 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
            mFolderName.setText("");
        }
        updateItemLocationsInDatabase();

        // In case any children didn't come across during loading, clean up the folder accordingly
        mFolderIcon.post(new Runnable() {
            public void run() {
                if (getItemCount() <= 1) {
                    replaceFolderWithFinalItem();
                }
            }
        });
    }

    /**
@@ -1095,6 +1104,8 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
        View finalChild = getItemAt(0);
        if (finalChild != null) {
            mFolderIcon.performDestroyAnimation(finalChild, onCompleteRunnable);
        } else {
            onCompleteRunnable.run();
        }
        mDestroyed = true;
    }
+2 −2
Original line number Diff line number Diff line
@@ -16,10 +16,10 @@

package com.android.launcher3;

import java.util.ArrayList;

import android.content.ContentValues;

import java.util.ArrayList;

/**
 * Represents a folder containing shortcuts or apps.
 */
+3 −2
Original line number Diff line number Diff line
@@ -584,8 +584,9 @@ public class LauncherModel extends BroadcastReceiver {
            // as in Workspace.onDrop. Here, we just add/remove them from the list of items
            // that are on the desktop, as appropriate
            ItemInfo modelItem = sBgItemsIdMap.get(itemId);
            if (modelItem.container == LauncherSettings.Favorites.CONTAINER_DESKTOP ||
                    modelItem.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
            if (modelItem != null &&
                    (modelItem.container == LauncherSettings.Favorites.CONTAINER_DESKTOP ||
                     modelItem.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT)) {
                switch (modelItem.itemType) {
                    case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
                    case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT: