Moving some utility methods around

Change-Id: I8abca49a0dbf656212b21e0552502036a1619164
This commit is contained in:
Sunny Goyal
2019-01-31 16:05:58 -08:00
parent 9018627d05
commit aae6fbb903
8 changed files with 38 additions and 50 deletions

View File

@@ -98,6 +98,7 @@ import com.android.launcher3.widget.PendingAppWidgetHostView;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import java.util.function.Predicate;
/**
* The workspace is a wide area with a wallpaper and a finite number of pages.
@@ -3059,7 +3060,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
});
}
public void updateNotificationDots(final Set<PackageUserKey> updatedDots) {
public void updateNotificationDots(Predicate<PackageUserKey> updatedDots) {
final PackageUserKey packageUserKey = new PackageUserKey(null, null);
final IntSet folderIds = new IntSet();
mapOverItems(MAP_RECURSE, new ItemOperator() {
@@ -3067,7 +3068,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
public boolean evaluate(ItemInfo info, View v) {
if (info instanceof ShortcutInfo && v instanceof BubbleTextView) {
if (!packageUserKey.updateFromItemInfo(info)
|| updatedDots.contains(packageUserKey)) {
|| updatedDots.test(packageUserKey)) {
((BubbleTextView) v).applyDotState(info, true /* animate */);
folderIds.add(info.container);
}