Skip to content

Commit

Permalink
Fixed #53 ; v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamuno committed Jun 6, 2019
1 parent aaadea8 commit 53b7fd7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "org.secuso.privacyfriendlyfoodtracker"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
versionCode 2
versionName "1.0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,12 +534,15 @@ private boolean editDatabaseEntry(String amountString, String idString) {
private void refreshFoodList() {
Date d = getDateForActivity();
DatabaseFacade facade = getDbFacade();
DatabaseEntry[] entries = facade.getEntriesForDay(d);
ViewGroup foodList = getEntryList();
foodList.removeAllViews();
for (DatabaseEntry e : entries) {
CardView c = createCardViewForEntry(e);
foodList.addView(c);
// Fix Issue #53
if(facade != null) {
DatabaseEntry[] entries = facade.getEntriesForDay(d);
ViewGroup foodList = getEntryList();
foodList.removeAllViews();
for (DatabaseEntry e : entries) {
CardView c = createCardViewForEntry(e);
foodList.addView(c);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public class DatabaseFacade {
ProductDao productDao;
ConsumedEntriesDao consumedEntriesDao;
ConsumedEntrieAndProductDao consumedEntrieAndProductDao;
public DatabaseFacade(Context context) throws Exception{

public DatabaseFacade(Context context) throws Exception {
this.productDao = ApplicationDatabase.getInstance(context).getProductDao();
this.consumedEntriesDao = ApplicationDatabase.getInstance(context).getConsumedEntriesDao();
this.consumedEntrieAndProductDao = ApplicationDatabase.getInstance(context).getConsumedEntrieAndProductDao();
Expand Down

0 comments on commit 53b7fd7

Please sign in to comment.