应用可以通过控制通知的条数来控制通知圆点的个数显示,例如未接电话在电话应用中将通知限制成8条,故在Launcher中未读小圆点及条数最多只能显示8(但是由于广播发送延迟,会先显示9,被应用remove后又马上变为8),如需修改最大条数限制,则需要对应模块的app对其条数限制进行修改。 launcher相关逻辑:src/com/android/launcher3/dot/DotInfo.java public boolean addOrUpdateNotificationKey(NotificationKeyData notificationKey) { int indexOfPrevKey = mNotificationKeys.indexOf(notificationKey); NotificationKeyData prevKey = indexOfPrevKey == -1 ? null : mNotificationKeys.get(indexOfPrevKey); if (prevKey != null) { if (prevKey.count == notificationKey.count) { return false; } // Notification was updated with a new count. mTotalCount -= prevKey.count; mTotalCount += notificationKey.count; prevKey.count = notificationKey.count; return true; } boolean added = mNotificationKeys.add(notificationKey); if (added) { mTotalCount += notificationKey.count; //圆点显示个数 } return added; }
展锐android launcher通知圆点的个数显示
于 2023-07-13 14:03:35 首次发布