List of usage examples for android.provider LiveFolders DISPLAY_MODE_GRID
int DISPLAY_MODE_GRID
To view the source code for android.provider LiveFolders DISPLAY_MODE_GRID.
Click Source Link
From source file:com.cognizant.trumobi.PersonaLauncher.java
static PersonaLiveFolderInfo addLiveFolder(Context context, Intent data, PersonaCellLayout.CellInfo cellInfo, boolean notify) { Intent baseIntent = data.getParcelableExtra(LiveFolders.EXTRA_LIVE_FOLDER_BASE_INTENT); String name = data.getStringExtra(LiveFolders.EXTRA_LIVE_FOLDER_NAME); Drawable icon = null;//from www . j a va 2s .c om boolean filtered = false; Intent.ShortcutIconResource iconResource = null; Parcelable extra = data.getParcelableExtra(LiveFolders.EXTRA_LIVE_FOLDER_ICON); if (extra != null && extra instanceof Intent.ShortcutIconResource) { try { iconResource = (Intent.ShortcutIconResource) extra; final PackageManager packageManager = context.getPackageManager(); Resources resources = packageManager.getResourcesForApplication(iconResource.packageName); final int id = resources.getIdentifier(iconResource.resourceName, null, null); icon = resources.getDrawable(id); } catch (Exception e) { PersonaLog.w(LOG_TAG, "Could not load live folder icon: " + extra); } } if (icon == null) { icon = context.getResources().getDrawable(R.drawable.pr_ic_launcher_folder); } final PersonaLiveFolderInfo info = new PersonaLiveFolderInfo(); info.icon = icon; info.filtered = filtered; info.title = name; info.iconResource = iconResource; info.uri = data.getData(); info.baseIntent = baseIntent; info.displayMode = data.getIntExtra(LiveFolders.EXTRA_LIVE_FOLDER_DISPLAY_MODE, LiveFolders.DISPLAY_MODE_GRID); PersonaLauncherModel.addItemToDatabase(context, info, PersonaLauncherSettings.Favorites.CONTAINER_DESKTOP, cellInfo.screen, cellInfo.cellX, cellInfo.cellY, notify); sModel.addFolder(info); return info; }