- // Check to see if the folder already exists.
- Cursor bookmarkFolderCursor = bookmarksDatabaseHelper.getFolderCursor(folderNameString);
- int existingFoldersWithNewName = bookmarkFolderCursor.getCount();
- bookmarkFolderCursor.close();
- if (folderNameString.isEmpty() || (existingFoldersWithNewName > 0)) {
- String cannotCreateFolder = getResources().getString(R.string.cannot_create_folder) + " \"" + folderNameString + "\"";
- Snackbar.make(findViewById(R.id.bookmarks_coordinatorlayout), cannotCreateFolder, Snackbar.LENGTH_INDEFINITE).show();
- } else { // Create the folder.
- // Get the new folder icon `Bitmap`.
- RadioButton defaultFolderIconRadioButton = (RadioButton) dialogFragment.getDialog().findViewById(R.id.create_folder_default_icon_radiobutton);
- Bitmap folderIconBitmap;
- if (defaultFolderIconRadioButton.isChecked()) {
- // Get the default folder icon `ImageView` from the `Dialog` and convert it to a `Bitmap`.
- ImageView folderIconImageView = (ImageView) dialogFragment.getDialog().findViewById(R.id.create_folder_default_icon);
- Drawable folderIconDrawable = folderIconImageView.getDrawable();
- BitmapDrawable folderIconBitmapDrawable = (BitmapDrawable) folderIconDrawable;
- folderIconBitmap = folderIconBitmapDrawable.getBitmap();
- } else { // Assign `favoriteIcon` from the `WebView`.
- folderIconBitmap = MainWebViewActivity.favoriteIconBitmap;
- }
+ // Get the new folder icon `Bitmap`.
+ RadioButton defaultFolderIconRadioButton = (RadioButton) dialogFragment.getDialog().findViewById(R.id.create_folder_default_icon_radiobutton);
+ Bitmap folderIconBitmap;
+ if (defaultFolderIconRadioButton.isChecked()) {
+ // Get the default folder icon `ImageView` from the `Dialog` and convert it to a `Bitmap`.
+ ImageView folderIconImageView = (ImageView) dialogFragment.getDialog().findViewById(R.id.create_folder_default_icon);
+ Drawable folderIconDrawable = folderIconImageView.getDrawable();
+ BitmapDrawable folderIconBitmapDrawable = (BitmapDrawable) folderIconDrawable;
+ folderIconBitmap = folderIconBitmapDrawable.getBitmap();
+ } else { // Assign `favoriteIcon` from the `WebView`.
+ folderIconBitmap = MainWebViewActivity.favoriteIconBitmap;
+ }