Skip to content

Instantly share code, notes, and snippets.

@jezinka
Created Sep 14, 2017
Embed
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);
}
dinnerAdapter.updateResults();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment