Search in sources :

Example 6 with AppInfo

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;
    }
}
Also used : PackageManagerHelper(com.android.launcher3.util.PackageManagerHelper) AppInfo(com.android.launcher3.model.data.AppInfo)

Example 7 with AppInfo

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);
    }
}
Also used : AppInfo(com.android.launcher3.model.data.AppInfo)

Example 8 with AppInfo

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 "";
}
Also used : WorkspaceItemInfo(com.android.launcher3.model.data.WorkspaceItemInfo) ItemInfo(com.android.launcher3.model.data.ItemInfo) View(android.view.View) FolderInfo(com.android.launcher3.model.data.FolderInfo) AppInfo(com.android.launcher3.model.data.AppInfo) WorkspaceItemInfo(com.android.launcher3.model.data.WorkspaceItemInfo)

Example 9 with AppInfo

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();
        }
    }
}
Also used : AppInfo(com.android.launcher3.model.data.AppInfo)

Example 10 with AppInfo

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);
            }
    }
}
Also used : BubbleTextView(com.android.launcher3.BubbleTextView) TextView(android.widget.TextView) BubbleTextView(com.android.launcher3.BubbleTextView) AppInfo(com.android.launcher3.model.data.AppInfo)

Aggregations

AppInfo (com.android.launcher3.model.data.AppInfo)181 WorkspaceItemInfo (com.android.launcher3.model.data.WorkspaceItemInfo)86 ItemInfo (com.android.launcher3.model.data.ItemInfo)46 ArrayList (java.util.ArrayList)46 ComponentName (android.content.ComponentName)36 AppInfo (com.android.launcher3.AppInfo)33 View (android.view.View)32 LauncherActivityInfo (android.content.pm.LauncherActivityInfo)31 Intent (android.content.Intent)30 FolderInfo (com.android.launcher3.model.data.FolderInfo)30 LauncherAppWidgetInfo (com.android.launcher3.model.data.LauncherAppWidgetInfo)30 UserHandle (android.os.UserHandle)21 PackageItemInfo (com.android.launcher3.model.data.PackageItemInfo)21 PendingAddShortcutInfo (com.android.launcher3.widget.PendingAddShortcutInfo)21 Point (android.graphics.Point)19 BubbleTextView (com.android.launcher3.BubbleTextView)19 LauncherApps (android.content.pm.LauncherApps)17 ItemInfoWithIcon (com.android.launcher3.model.data.ItemInfoWithIcon)17 PendingAddItemInfo (com.android.launcher3.PendingAddItemInfo)15 AppWidgetHostView (android.appwidget.AppWidgetHostView)14