feat: 增加壁纸显示,增加天气事件分发,增加HotSeat
This commit is contained in:
@@ -96,6 +96,23 @@ public class AppManager {
|
||||
this.add("com.ss.android.ugc.aweme");
|
||||
}};
|
||||
|
||||
public static final Set<String> DEFAULT_DIALER_PACKAGE = new HashSet<String>() {{
|
||||
this.add("com.android.dialer");
|
||||
}};
|
||||
|
||||
public static final Set<String> DEFAULT_CONTACT_PACKAGE = new HashSet<String>() {{
|
||||
this.add("com.android.contacts");
|
||||
}};
|
||||
|
||||
public static final Set<String> DEFAULT_MESSAGE_PACKAGE = new HashSet<String>() {{
|
||||
this.add("com.android.messaging");
|
||||
}};
|
||||
|
||||
public static final Set<String> DEFAULT_SETTINGS_PACKAGE = new HashSet<String>() {{
|
||||
this.add("com.android.settings");
|
||||
}};
|
||||
|
||||
|
||||
public static void init(Context context) {
|
||||
if (INSTANCE == null) {
|
||||
synchronized (AppManager.class) {
|
||||
@@ -197,6 +214,7 @@ public class AppManager {
|
||||
.sorted(getAppComparator())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
final int[] hotseatCounter = {0};
|
||||
IntStream.range(0, allFirstApps.size())
|
||||
.forEach(new IntConsumer() {
|
||||
@Override
|
||||
@@ -207,6 +225,24 @@ public class AppManager {
|
||||
} else {
|
||||
appInfo.setOutside(0);
|
||||
}
|
||||
|
||||
if (DEFAULT_DIALER_PACKAGE.contains(appInfo.getPackageName())) {
|
||||
appInfo.setHotseat(1);
|
||||
appInfo.setHotseatPosition(hotseatCounter[0]++);
|
||||
} else if (DEFAULT_CONTACT_PACKAGE.contains(appInfo.getPackageName())) {
|
||||
appInfo.setHotseat(1);
|
||||
appInfo.setHotseatPosition(hotseatCounter[0]++);
|
||||
} else if (DEFAULT_MESSAGE_PACKAGE.contains(appInfo.getPackageName())) {
|
||||
appInfo.setHotseat(1);
|
||||
appInfo.setHotseatPosition(hotseatCounter[0]++);
|
||||
} else if (DEFAULT_SETTINGS_PACKAGE.contains(appInfo.getPackageName())) {
|
||||
appInfo.setHotseat(1);
|
||||
appInfo.setHotseatPosition(hotseatCounter[0]++);
|
||||
} else {
|
||||
appInfo.setHotseat(0);
|
||||
appInfo.setHotseatPosition(0);
|
||||
}
|
||||
|
||||
appInfo.setPosition(index);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user