version:2.2

fix:修复应用从第一屏开始排列
add:
This commit is contained in:
tt committed 2022-01-08 18:27:20 +08:00
1 parent 7f096b106c
commit 6f409d2922
49 files changed
+295 -310

No files matched your search

@@ -220,7 +220,9 @@ public class AddWorkspaceItemsTask extends BaseModelUpdateTask {
int screenCount = workspaceScreens.size();
// First check the preferred screen.
int preferredScreenIndex = workspaceScreens.isEmpty() ? 0 : 1;
// int preferredScreenIndex = workspaceScreens.isEmpty() ? 0 : 1;
/*从第一页开始显示*/
int preferredScreenIndex = 0;
if (preferredScreenIndex < screenCount) {
screenId = workspaceScreens.get(preferredScreenIndex);
found = findNextAvailableIconSpaceInScreen(
+37 -3
View File
@@ -27,6 +27,7 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
import android.content.pm.LauncherActivityInfo;
import android.content.pm.PackageInstaller;
import android.content.pm.PackageInstaller.SessionInfo;
@@ -250,7 +251,7 @@ public class LoaderTask implements Runnable {
/**
* 需要隐藏的图标
*/
private List<String> hideApp = new ArrayList<String>() {{
private HashSet<String> hideApp = new HashSet<String>() {{
this.add(BuildConfig.APPLICATION_ID);
this.add("com.android.quicksearchbox");
this.add("com.st.nfc.dta.mobile");
@@ -260,6 +261,36 @@ public class LoaderTask implements Runnable {
this.add("com.android.email");
}};
public static HashSet<String> showApp = new HashSet<String>() {{
// this.add(BuildConfig.APPLICATION_ID);
//aoleyun
this.add("com.aoleyun.sn");
this.add("com.aoleyun.appstore");
this.add("com.aoleyun.postern");
this.add("com.aoleyun.browser");
this.add("com.aoleyun.info");
this.add("com.aoleyun.file");
this.add("com.aoleyun.reos");
this.add("com.aoleyunos.dop1");
this.add("com.aoleyunos.dop2");
//system
this.add("com.android.documentsui");
this.add("com.android.messaging");
this.add("com.android.music");
this.add("com.android.camera");
this.add("com.android.camera2");
this.add("com.android.settings");
this.add("com.android.stk");
this.add("com.mediatek.camera");
this.add("com.mediatek.filemanager");
//uiui
this.add("com.calculator.uiui");
this.add("com.notepad.uiui");
this.add("com.calendar.uiui");
this.add("com.alarmclock.uiui");
this.add("com.uiui.videoplayer");
}};
//add for load all app on workspace
private void verifyApplications() {
final Context context = mApp.getContext();
@@ -270,8 +301,11 @@ public class LoaderTask implements Runnable {
ArrayList<InstallShortcutReceiver.PendingInstallShortcutInfo> added = new ArrayList<InstallShortcutReceiver.PendingInstallShortcutInfo>();
synchronized (this) {
for (LauncherActivityInfo app : apps) {
if (hideApp.contains(app.getApplicationInfo().packageName)) {
continue;
/*系统应用*/
if ((app.getApplicationFlags() & ApplicationInfo.FLAG_SYSTEM) == 1) {
if (!showApp.contains(app.getApplicationInfo().packageName)) {
continue;
}
}
InstallShortcutReceiver.PendingInstallShortcutInfo pendingInstallShortcutInfo = new InstallShortcutReceiver.PendingInstallShortcutInfo(app, context);
added.add(pendingInstallShortcutInfo);