X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Fdialogs%2FMoveToFolderDialog.java;h=5149534486fc330b8cf6a86231d8b7da6a034bf9;hp=2bbd4e6674cbe2f9397aa8e70fe0c2b5d9a8d52f;hb=572449f6c66adfc1a3d88e761cb87581a7961df3;hpb=b17095e4a30d08098614c82d8ddab67896c8ceb0 diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/MoveToFolderDialog.java b/app/src/main/java/com/stoutner/privacybrowser/dialogs/MoveToFolderDialog.java index 2bbd4e66..51495344 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/MoveToFolderDialog.java +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/MoveToFolderDialog.java @@ -1,5 +1,5 @@ /* - * Copyright © 2016-2018 Soren Stoutner . + * Copyright © 2016-2019 Soren Stoutner . * * This file is part of Privacy Browser . * @@ -166,12 +166,15 @@ public class MoveToFolderDialog extends AppCompatDialogFragment { } // Get a `Cursor` containing the folders to display. - foldersCursor = bookmarksDatabaseHelper.getFoldersCursorExcept(exceptFolders.toString()); + foldersCursor = bookmarksDatabaseHelper.getFoldersExcept(exceptFolders.toString()); // Setup `foldersCursorAdaptor` with `this` context. `false` disables autoRequery. foldersCursorAdapter = new CursorAdapter(alertDialog.getContext(), foldersCursor, false) { @Override public View newView(Context context, Cursor cursor, ViewGroup parent) { + // Remove the incorrect lint warning that `.getLayoutInflator()` might be false. + assert getActivity() != null; + // Inflate the individual item layout. `false` does not attach it to the root. return getActivity().getLayoutInflater().inflate(R.layout.move_to_folder_item_linearlayout, parent, false); } @@ -233,7 +236,7 @@ public class MoveToFolderDialog extends AppCompatDialogFragment { } // Get a `Cursor` containing the folders to display. - foldersCursor = bookmarksDatabaseHelper.getFoldersCursorExcept(exceptFolders.toString()); + foldersCursor = bookmarksDatabaseHelper.getFoldersExcept(exceptFolders.toString()); // Combine `homeFolderMatrixCursor` and `foldersCursor`. MergeCursor foldersMergeCursor = new MergeCursor(new Cursor[]{homeFolderMatrixCursor, foldersCursor}); @@ -242,6 +245,9 @@ public class MoveToFolderDialog extends AppCompatDialogFragment { foldersCursorAdapter = new CursorAdapter(alertDialog.getContext(), foldersMergeCursor, false) { @Override public View newView(Context context, Cursor cursor, ViewGroup parent) { + // Remove the incorrect lint warning that `.getLayoutInflator()` might be false. + assert getActivity() != null; + // Inflate the individual item layout. `false` does not attach it to the root. return getActivity().getLayoutInflater().inflate(R.layout.move_to_folder_item_linearlayout, parent, false); } @@ -280,7 +286,7 @@ public class MoveToFolderDialog extends AppCompatDialogFragment { private void addSubfoldersToExceptFolders(String folderName) { // Get a `Cursor` will all the immediate subfolders. - Cursor subfoldersCursor = bookmarksDatabaseHelper.getSubfoldersCursor(folderName); + Cursor subfoldersCursor = bookmarksDatabaseHelper.getSubfolders(folderName); for (int i = 0; i < subfoldersCursor.getCount(); i++) { // Move `subfolderCursor` to the current item.