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

Commit 734c4530 authored by Stefan Andonian's avatar Stefan Andonian Committed by Android (Google) Code Review
Browse files

Merge "Add null check for NPE in FolderIcon." into tm-qpr-dev

parents 3a0e420e 8b85f837
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import android.view.ViewGroup;
import android.widget.FrameLayout;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.android.launcher3.Alarm;
import com.android.launcher3.BubbleTextView;
@@ -181,8 +182,11 @@ public class FolderIcon extends FrameLayout implements FolderListener, IconLabel
        return icon;
    }

    public static FolderIcon inflateIcon(int resId, ActivityContext activity, ViewGroup group,
            FolderInfo folderInfo) {
    /**
     * Builds a FolderIcon to be added to the Launcher
     */
    public static FolderIcon inflateIcon(int resId, ActivityContext activity,
            @Nullable ViewGroup group, FolderInfo folderInfo) {
        @SuppressWarnings("all") // suppress dead code warning
        final boolean error = INITIAL_ITEM_ANIMATION_DURATION >= DROP_IN_ANIMATION_DURATION;
        if (error) {
@@ -192,8 +196,10 @@ public class FolderIcon extends FrameLayout implements FolderListener, IconLabel
        }

        DeviceProfile grid = activity.getDeviceProfile();
        FolderIcon icon = (FolderIcon) LayoutInflater.from(group.getContext())
                .inflate(resId, group, false);
        LayoutInflater inflater = (group != null)
                ? LayoutInflater.from(group.getContext())
                : activity.getLayoutInflater();
        FolderIcon icon = (FolderIcon) inflater.inflate(resId, group, false);

        icon.setClipToPadding(false);
        icon.mFolderName = icon.findViewById(R.id.folder_icon_name);