import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
-import android.database.CursorWindow;
-import android.database.sqlite.SQLiteCursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Typeface;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
-import android.os.Build;
import android.os.Bundle;
import android.util.SparseBooleanArray;
import android.view.ActionMode;
// `bookmarksCursor` is used in `onCreate()`, `onCreateBookmark()`, `onCreateBookmarkFolder()`, `onSaveBookmark()`, `onSaveBookmarkFolder()`, `onMoveToFolder()`, `deleteBookmarkFolderContents()`,
// `loadFolder()`, and `onDestroy()`.
- // TODO This should be switched back to a `Cursor` after the release of 2.17.1.
- private SQLiteCursor bookmarksCursor;
+ private Cursor bookmarksCursor;
// `bookmarksCursorAdapter` is used in `onCreate(), `onCreateBookmark()`, `onCreateBookmarkFolder()`, `onSaveBookmark()`, `onSaveBookmarkFolder()`, `onMoveToFolder()`, and `onLoadFolder()`.
private CursorAdapter bookmarksCursorAdapter;
}
// Update the bookmarks cursor with the current contents of the bookmarks database.
- // TODO Change this back to a `Cursor` after 2.17.1 is released.
- bookmarksCursor = (SQLiteCursor) bookmarksDatabaseHelper.getBookmarksByDisplayOrder(currentFolder);
+ bookmarksCursor = bookmarksDatabaseHelper.getBookmarksByDisplayOrder(currentFolder);
// Update the `ListView`.
bookmarksCursorAdapter.changeCursor(bookmarksCursor);
}
// Update the bookmarks cursor with the current contents of the bookmarks database.
- // TODO Change this back to a `Cursor` after 2.17.1 is released.
- bookmarksCursor = (SQLiteCursor) bookmarksDatabaseHelper.getBookmarksByDisplayOrder(currentFolder);
+ bookmarksCursor = bookmarksDatabaseHelper.getBookmarksByDisplayOrder(currentFolder);
// Update the `ListView`.
bookmarksCursorAdapter.changeCursor(bookmarksCursor);
selectedBookmarksPositionsSparseBooleanArray = bookmarksListView.getCheckedItemPositions().clone();
// Update the bookmarks cursor with the current contents of the bookmarks database except for the specified database IDs.
- // TODO Change this back to a `Cursor` after 2.17.1 is released.
- bookmarksCursor = (SQLiteCursor) bookmarksDatabaseHelper.getBookmarksByDisplayOrderExcept(selectedBookmarksIdsLongArray, currentFolder);
+ bookmarksCursor = bookmarksDatabaseHelper.getBookmarksByDisplayOrderExcept(selectedBookmarksIdsLongArray, currentFolder);
// Update the list view.
bookmarksCursorAdapter.changeCursor(bookmarksCursor);
// The user pushed the `Undo` button.
case Snackbar.Callback.DISMISS_EVENT_ACTION:
// Update the bookmarks cursor with the current contents of the bookmarks database, including the "deleted" bookmarks.
- // TODO Change this back to a `Cursor` after 2.17.1 is released.
- bookmarksCursor = (SQLiteCursor) bookmarksDatabaseHelper.getBookmarksByDisplayOrder(currentFolder);
+ bookmarksCursor = bookmarksDatabaseHelper.getBookmarksByDisplayOrder(currentFolder);
// Update the list view.
bookmarksCursorAdapter.changeCursor(bookmarksCursor);
bookmarksDatabaseHelper.createBookmark(bookmarkNameString, bookmarkUrlString, currentFolder, newBookmarkDisplayOrder, favoriteIconByteArray);
// Update the bookmarks cursor with the current contents of this folder.
- // TODO Change this back to a `Cursor` after 2.17.1 is released.
- bookmarksCursor = (SQLiteCursor) bookmarksDatabaseHelper.getBookmarksByDisplayOrder(currentFolder);
+ bookmarksCursor = bookmarksDatabaseHelper.getBookmarksByDisplayOrder(currentFolder);
// Update the `ListView`.
bookmarksCursorAdapter.changeCursor(bookmarksCursor);
bookmarksDatabaseHelper.createFolder(folderNameString, currentFolder, folderIconByteArray);
// Update the bookmarks cursor with the current contents of this folder.
- // TODO Change this back to a `Cursor` after 2.17.1 is released.
- bookmarksCursor = (SQLiteCursor) bookmarksDatabaseHelper.getBookmarksByDisplayOrder(currentFolder);
+ bookmarksCursor = bookmarksDatabaseHelper.getBookmarksByDisplayOrder(currentFolder);
// Update the `ListView`.
bookmarksCursorAdapter.changeCursor(bookmarksCursor);
contextualActionMode.finish();
// Update the bookmarks cursor with the contents of the current folder.
- // TODO Change this back to a `Cursor` after 2.17.1 is released.
- bookmarksCursor = (SQLiteCursor) bookmarksDatabaseHelper.getBookmarksByDisplayOrder(currentFolder);
+ bookmarksCursor = bookmarksDatabaseHelper.getBookmarksByDisplayOrder(currentFolder);
// Update the `ListView`.
bookmarksCursorAdapter.changeCursor(bookmarksCursor);
}
// Update the bookmarks cursor with the current contents of this folder.
- // TODO Change this back to a `Cursor` after 2.17.1 is released.
- bookmarksCursor = (SQLiteCursor) bookmarksDatabaseHelper.getBookmarksByDisplayOrder(currentFolder);
+ bookmarksCursor = bookmarksDatabaseHelper.getBookmarksByDisplayOrder(currentFolder);
// Update the `ListView`.
bookmarksCursorAdapter.changeCursor(bookmarksCursor);
}
// Update the bookmarks cursor with the current contents of this folder.
- // TODO Change this back to a `Cursor` after 2.17.1 is released.
- bookmarksCursor = (SQLiteCursor) bookmarksDatabaseHelper.getBookmarksByDisplayOrder(currentFolder);
+ bookmarksCursor = bookmarksDatabaseHelper.getBookmarksByDisplayOrder(currentFolder);
// Update the `ListView`.
bookmarksCursorAdapter.changeCursor(bookmarksCursor);
private void loadFolder() {
// Update bookmarks cursor with the contents of the bookmarks database for the current folder.
- // TODO Change this back to a `Cursor` after 2.17.1 is released.
- bookmarksCursor = (SQLiteCursor) bookmarksDatabaseHelper.getBookmarksByDisplayOrder(currentFolder);
-
- // TODO Remove after the release of 2.17.1.
- if (Build.VERSION.SDK_INT >= 28) {
- // Create a big cursor window.
- CursorWindow bigCursorWindow = new CursorWindow("Big Cursor Window", 4194304);
-
- bookmarksCursor.setWindow(bigCursorWindow);
- }
+ bookmarksCursor = bookmarksDatabaseHelper.getBookmarksByDisplayOrder(currentFolder);
// Setup a `CursorAdapter`. `this` specifies the `Context`. `false` disables `autoRequery`.
bookmarksCursorAdapter = new CursorAdapter(this, bookmarksCursor, false) {