Skip to content

Instantly share code, notes, and snippets.

Created Sep 14, 2017
What would you like to do?
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment