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]);
}
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;
}
Aggregations