A little bit of cleanup

This commit is contained in:
Bradley Bickford 2025-04-13 19:33:09 -04:00
parent 0c1f050868
commit 46419f7d83
3 changed files with 7 additions and 4 deletions

6
.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -60,12 +60,9 @@ public class MainActivity extends AppCompatActivity {
});
if (db.noteDAO().getAll().isEmpty()) {
Log.d("UIVIS", "This should be what runs when the DB is empty");
noNotesText.setVisibility(VISIBLE);
notesRecyclerView.setVisibility(View.GONE);
} else {
Log.d("UIVIS", "This should only run if there is something in the DB");
Log.d("UIVIS", "DB Count: " + db.noteDAO().getAll().size());
noNotesText.setVisibility(View.GONE);
notesRecyclerView.setVisibility(VISIBLE);
}

View File

@ -18,7 +18,7 @@ public abstract class NoteDB extends RoomDatabase {
public static NoteDB getDB(Context applicationContext) {
if (db == null) {
db = Room.databaseBuilder(applicationContext, NoteDB.class, "Notes")
.allowMainThreadQueries()
.allowMainThreadQueries() // This is critical to make this whole thing work
.build();
}