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

Commit ca0cc050 authored by Tony Wickham's avatar Tony Wickham Committed by android-build-merger
Browse files

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

am: d570c040

Change-Id: Ife54bfe7a33d98bae7e71cecdc577e70fe6997e6
parents e97b9704 d570c040
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -498,11 +498,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 */);
            }
        }
    }