Search in sources :

Example 1 with AppIndex

use of com.google.android.apps.nexuslauncher.search.nano.SearchProto.AppIndex in project Neo-Launcher by NeoApplications.

the class ConfigBuilder method setHotseatSearchView.

private void setHotseatSearchView() {
    mNano.allAppsCols = mActivity.getDeviceProfile().inv.numColumns;
    final int width = mActivity.getHotseat().getWidth();
    final int dimensionPixelSize = mActivity.getResources().getDimensionPixelSize(R.dimen.dynamic_grid_edge_margin);
    final Columns appCol = new Columns();
    appCol.edgeMargin = dimensionPixelSize;
    appCol.iconDistance = width - dimensionPixelSize - dimensionPixelSize;
    appCol.height = mActivity.getDeviceProfile().allAppsCellHeightPx;
    mNano.apps = appCol;
    updateHotseatSearchDimens();
    AlphabeticalAppsList apps = getAppsView().getApps();
    mBubbleTextView = (BubbleTextView) mActivity.getLayoutInflater().inflate(R.layout.all_apps_icon, getAppsView(), false);
    ViewGroup.LayoutParams layoutParams = mBubbleTextView.getLayoutParams();
    layoutParams.height = appCol.height;
    layoutParams.width = appCol.iconDistance / mNano.allAppsCols;
    if (!apps.getApps().isEmpty()) {
        mBubbleTextView.applyFromApplicationInfo(apps.getApps().get(0));
    }
    mBubbleTextView.measure(View.MeasureSpec.makeMeasureSpec(layoutParams.width, View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(layoutParams.height, View.MeasureSpec.EXACTLY));
    mBubbleTextView.layout(0, 0, layoutParams.width, layoutParams.height);
    final ArrayList<AppIndex> list = new ArrayList<>(mNano.allAppsCols);
    mNano.index = list.toArray(new AppIndex[0]);
}
Also used : ViewGroup(android.view.ViewGroup) AlphabeticalAppsList(com.android.launcher3.allapps.AlphabeticalAppsList) ArrayList(java.util.ArrayList) Columns(com.google.android.apps.nexuslauncher.search.nano.SearchProto.Columns) AppIndex(com.google.android.apps.nexuslauncher.search.nano.SearchProto.AppIndex) Point(android.graphics.Point)

Example 2 with AppIndex

use of com.google.android.apps.nexuslauncher.search.nano.SearchProto.AppIndex in project Neo-Launcher by NeoApplications.

the class ConfigBuilder method updatePredictions.

public final AppIndex updatePredictions(AppInfo appInfo, int n) {
    final AppIndex apps = new AppIndex();
    apps.label = appInfo.title.toString();
    apps.iconBitmap = "icon_bitmap_" + n;
    mBundle.putParcelable(apps.iconBitmap, appInfo.iconBitmap);
    Uri uri = AppSearchProvider.buildUri(appInfo, mUserManager);
    apps.searchUri = uri.toString();
    apps.predictionRank = new Intent("com.google.android.apps.nexuslauncher.search.APP_LAUNCH", uri.buildUpon().appendQueryParameter("predictionRank", Integer.toString(n)).build()).toUri(0);
    return apps;
}
Also used : Intent(android.content.Intent) PendingIntent(android.app.PendingIntent) AppIndex(com.google.android.apps.nexuslauncher.search.nano.SearchProto.AppIndex) Uri(android.net.Uri)

Aggregations

AppIndex (com.google.android.apps.nexuslauncher.search.nano.SearchProto.AppIndex)2 PendingIntent (android.app.PendingIntent)1 Intent (android.content.Intent)1 Point (android.graphics.Point)1 Uri (android.net.Uri)1 ViewGroup (android.view.ViewGroup)1 AlphabeticalAppsList (com.android.launcher3.allapps.AlphabeticalAppsList)1 Columns (com.google.android.apps.nexuslauncher.search.nano.SearchProto.Columns)1 ArrayList (java.util.ArrayList)1