去掉抽屉,去掉取消按钮
This commit is contained in:
@@ -18,10 +18,12 @@ package com.android.uiuios.model;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.LauncherActivityInfo;
|
||||
import android.content.pm.ShortcutInfo;
|
||||
import android.os.Process;
|
||||
import android.os.UserHandle;
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
|
||||
import com.android.uiuios.AllAppsList;
|
||||
import com.android.uiuios.AppInfo;
|
||||
@@ -155,6 +157,9 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
|
||||
final ArrayList<AppInfo> addedOrModified = new ArrayList<>();
|
||||
addedOrModified.addAll(appsList.added);
|
||||
|
||||
updateToWorkSpace(context, app, appsList);
|
||||
|
||||
appsList.added.clear();
|
||||
addedOrModified.addAll(appsList.modified);
|
||||
appsList.modified.clear();
|
||||
@@ -352,6 +357,33 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
}
|
||||
}
|
||||
|
||||
//add for load new install app on workspace
|
||||
public void updateToWorkSpace(Context context, LauncherAppState app , AllAppsList appsList){
|
||||
ArrayList<Pair<ItemInfo, Object>> installQueue = new ArrayList<>();
|
||||
final List<UserHandle> profiles = UserManagerCompat.getInstance(context).getUserProfiles();
|
||||
ArrayList<InstallShortcutReceiver.PendingInstallShortcutInfo> added
|
||||
= new ArrayList<InstallShortcutReceiver.PendingInstallShortcutInfo>();
|
||||
|
||||
for (UserHandle user : profiles) {
|
||||
final List<LauncherActivityInfo> apps = LauncherAppsCompat.getInstance(context).getActivityList(null, user);
|
||||
synchronized (this) {
|
||||
for (LauncherActivityInfo info : apps) {
|
||||
for (AppInfo appInfo : appsList.added) {
|
||||
if(info.getComponentName().equals(appInfo.componentName)){
|
||||
InstallShortcutReceiver.PendingInstallShortcutInfo mPendingInstallShortcutInfo
|
||||
= new InstallShortcutReceiver.PendingInstallShortcutInfo(info,context);
|
||||
added.add(mPendingInstallShortcutInfo);
|
||||
installQueue.add(mPendingInstallShortcutInfo.getItemInfo());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!added.isEmpty()) {
|
||||
app.getModel().addAndBindAddedWorkspaceItems(installQueue);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates {@param si}'s intent to point to a new ComponentName.
|
||||
* @return Whether the shortcut intent was changed.
|
||||
|
||||
Reference in New Issue
Block a user