use of com.android.launcher3.model.data.AppInfo in project android_packages_apps_Launcher3 by crdroidandroid.
the class AllAppsList method addPromiseApp.
public void addPromiseApp(Context context, PackageInstallInfo installInfo) {
// only if not yet installed
if (!new PackageManagerHelper(context).isAppInstalled(installInfo.packageName, installInfo.user)) {
AppInfo info = new AppInfo(installInfo);
mIconCache.getTitleAndIcon(info, info.usingLowResIcon());
info.sectionName = mIndex.computeSectionName(info.title);
data.add(info);
mDataChanged = true;
}
}
use of com.android.launcher3.model.data.AppInfo in project android_packages_apps_Launcher3 by crdroidandroid.
the class AllAppsList method removeApp.
private void removeApp(int index) {
AppInfo removed = data.remove(index);
if (removed != null) {
mDataChanged = true;
mRemoveListener.accept(removed);
}
}
use of com.android.launcher3.model.data.AppInfo in project android_packages_apps_Launcher3 by crdroidandroid.
the class WorkspaceAccessibilityHelper method getConfirmationForIconDrop.
@Override
protected String getConfirmationForIconDrop(int id) {
int x = id % mView.getCountX();
int y = id / mView.getCountX();
LauncherAccessibilityDelegate.DragInfo dragInfo = mDelegate.getDragInfo();
View child = mView.getChildAt(x, y);
if (child == null || child == dragInfo.item) {
return mContext.getString(R.string.item_moved);
} else {
ItemInfo info = (ItemInfo) child.getTag();
if (info instanceof AppInfo || info instanceof WorkspaceItemInfo) {
return mContext.getString(R.string.folder_created);
} else if (info instanceof FolderInfo) {
return mContext.getString(R.string.added_to_folder);
}
}
return "";
}
use of com.android.launcher3.model.data.AppInfo in project android_packages_apps_Launcher3 by crdroidandroid.
the class AllAppsContainerView method onAppsUpdated.
private void onAppsUpdated() {
boolean hasWorkApps = false;
for (AppInfo app : mAllAppsStore.getApps()) {
if (mWorkMatcher.matches(app, null)) {
hasWorkApps = true;
break;
}
}
mHasWorkApps = hasWorkApps;
if (!mAH[AdapterHolder.MAIN].appsList.hasFilter()) {
rebindAdapters();
if (mHasWorkApps) {
resetWorkProfile();
}
}
}
use of com.android.launcher3.model.data.AppInfo in project android_packages_apps_Launcher3 by crdroidandroid.
the class AllAppsGridAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
switch(holder.getItemViewType()) {
case VIEW_TYPE_ICON:
AdapterItem adapterItem = mApps.getAdapterItems().get(position);
AppInfo info = adapterItem.appInfo;
BubbleTextView icon = (BubbleTextView) holder.itemView;
icon.reset();
icon.applyFromApplicationInfo(info);
break;
case VIEW_TYPE_EMPTY_SEARCH:
TextView emptyViewText = (TextView) holder.itemView;
emptyViewText.setText(mEmptySearchMessage);
emptyViewText.setGravity(mApps.hasNoFilteredResults() ? Gravity.CENTER : Gravity.START | Gravity.CENTER_VERTICAL);
break;
case VIEW_TYPE_SEARCH_MARKET:
TextView searchView = (TextView) holder.itemView;
if (mMarketSearchIntent != null) {
searchView.setVisibility(View.VISIBLE);
} else {
searchView.setVisibility(View.GONE);
}
break;
case VIEW_TYPE_ALL_APPS_DIVIDER:
// nothing to do
break;
default:
BaseAdapterProvider adapterProvider = getAdapterProvider(holder.getItemViewType());
if (adapterProvider != null) {
adapterProvider.onBindView(holder, position);
}
}
}
Aggregations