-
-
Save jezinka/cea3c8b8bf08302a23903eb7dbbbef65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void fillList(boolean onlyEmpty) { | |
Calendar calendarInstance = Calendar.getInstance(); | |
calendarInstance.setTime(TimeUtils.getWeekStartDate(new Date())); | |
List<Meal> meals = mealContract.getRandomMeals(dbHelper, getPlanLength()); | |
for (Meal meal : meals) { | |
if (!onlyEmpty || dinnerAdapter.isDayEmpty(calendarInstance.getTime())) { | |
dinnerContract.insert(dbHelper, meal.getId(), calendarInstance.getTime()); | |
} | |
calendarInstance.add(Calendar.DATE, 1); | |
} | |
dinnerAdapter.updateResults(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment