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

Commit d570c040 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix updateIconBadges() in All Apps" into ub-launcher3-dorval

parents 7e077553 4926ebfe
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import android.view.ViewGroup;

import com.android.launcher3.AppInfo;
import com.android.launcher3.BaseContainerView;
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.DeleteDropTarget;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.DragSource;
@@ -485,11 +486,15 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc

    public void updateIconBadges(Set<PackageUserKey> updatedBadges) {
        final PackageUserKey packageUserKey = new PackageUserKey(null, null);
        for (AlphabeticalAppsList.AdapterItem app : mApps.getAdapterItems()) {
            if (app.appInfo != null && packageUserKey.updateFromItemInfo(app.appInfo)) {
                if (updatedBadges.contains(packageUserKey)) {
                    mAdapter.notifyItemChanged(app.position);
                }
        final int n = mAppsRecyclerView.getChildCount();
        for (int i = 0; i < n; i++) {
            View child = mAppsRecyclerView.getChildAt(i);
            if (!(child instanceof BubbleTextView) || !(child.getTag() instanceof ItemInfo)) {
                continue;
            }
            ItemInfo info = (ItemInfo) child.getTag();
            if (packageUserKey.updateFromItemInfo(info) && updatedBadges.contains(packageUserKey)) {
                ((BubbleTextView) child).applyBadgeState(info, true /* animate */);
            }
        }
    }