public class BookmarksDatabaseViewActivity extends AppCompatActivity {
// `bookmarksDatabaseHandler` is used in `onCreate()` and `updateBookmarksListView()`.
public class BookmarksDatabaseViewActivity extends AppCompatActivity {
// `bookmarksDatabaseHandler` is used in `onCreate()` and `updateBookmarksListView()`.
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
// Inflate the individual item layout. `false` does not attach it to the root.
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
// Inflate the individual item layout. `false` does not attach it to the root.
- return getLayoutInflater().inflate(R.layout.bookmarks_database_view_linearlayout, parent, false);
+ return getLayoutInflater().inflate(R.layout.bookmarks_database_view_item_linearlayout, parent, false);
bookmarkNameTextView.setTypeface(null, Typeface.BOLD);
} else { // Reset the font to default.
bookmarkNameTextView.setTypeface(Typeface.DEFAULT);
bookmarkNameTextView.setTypeface(null, Typeface.BOLD);
} else { // Reset the font to default.
bookmarkNameTextView.setTypeface(Typeface.DEFAULT);
// Get the parent folder from the `Cursor` and display it in `bookmarkParentFolder`.
String bookmarkParentFolder = cursor.getString(cursor.getColumnIndex(BookmarksDatabaseHandler.PARENT_FOLDER));
// Get the parent folder from the `Cursor` and display it in `bookmarkParentFolder`.
String bookmarkParentFolder = cursor.getString(cursor.getColumnIndex(BookmarksDatabaseHandler.PARENT_FOLDER));
TextView bookmarkParentFolderTextView = (TextView) view.findViewById(R.id.bookmarks_database_view_parent_folder);
// Make the folder name gray if it is the home folder.
if (bookmarkParentFolder.isEmpty()) {
TextView bookmarkParentFolderTextView = (TextView) view.findViewById(R.id.bookmarks_database_view_parent_folder);
// Make the folder name gray if it is the home folder.
if (bookmarkParentFolder.isEmpty()) {
bookmarkParentFolderTextView.setText(bookmarkParentFolder);
bookmarkParentFolderTextView.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.black));
}
bookmarkParentFolderTextView.setText(bookmarkParentFolder);
bookmarkParentFolderTextView.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.black));
}