]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkFolderDatabaseViewDialog.java
Migrate five dialogs to Kotlin. https://redmine.stoutner.com/issues/543
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / dialogs / EditBookmarkFolderDatabaseViewDialog.java
index 1b7c3d70849b499158fdb2281a2ec3e18da7a736..0f7eff1a7ee12ba00e092b6a525f1c5123cb7e74 100644 (file)
@@ -54,14 +54,12 @@ import androidx.core.content.ContextCompat;
 import androidx.fragment.app.DialogFragment;  // The AndroidX dialog fragment must be used or an error is produced on API <=22.
 
 import com.stoutner.privacybrowser.R;
+import com.stoutner.privacybrowser.activities.BookmarksDatabaseViewActivity;
 import com.stoutner.privacybrowser.helpers.BookmarksDatabaseHelper;
 
 import java.io.ByteArrayOutputStream;
 
 public class EditBookmarkFolderDatabaseViewDialog extends DialogFragment {
-    // Define the home folder database ID constant.
-    public static final int HOME_FOLDER_DATABASE_ID = -1;
-
     // Define the edit bookmark folder database view listener.
     private EditBookmarkFolderDatabaseViewListener editBookmarkFolderDatabaseViewListener;
 
@@ -71,7 +69,7 @@ public class EditBookmarkFolderDatabaseViewDialog extends DialogFragment {
         void onSaveBookmarkFolder(DialogFragment dialogFragment, int selectedFolderDatabaseId, Bitmap favoriteIconBitmap);
     }
 
-    public void onAttach(Context context) {
+    public void onAttach(@NonNull Context context) {
         // Run the default commands.
         super.onAttach(context);
 
@@ -224,7 +222,7 @@ public class EditBookmarkFolderDatabaseViewDialog extends DialogFragment {
         // Setup a matrix cursor for "Home Folder".
         String[] matrixCursorColumnNames = {BookmarksDatabaseHelper._ID, BookmarksDatabaseHelper.BOOKMARK_NAME};
         MatrixCursor matrixCursor = new MatrixCursor(matrixCursorColumnNames);
-        matrixCursor.addRow(new Object[]{HOME_FOLDER_DATABASE_ID, getString(R.string.home_folder)});
+        matrixCursor.addRow(new Object[]{BookmarksDatabaseViewActivity.HOME_FOLDER_DATABASE_ID, getString(R.string.home_folder)});
 
         // Add all subfolders of the current folder to the list of folders not to display.
         String exceptFolders = getStringOfSubfolders(currentFolderName, bookmarksDatabaseHelper);