Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Integer maxItems = 0;
- for(List<SchedulePojo> day: weekListing){
- if(day.size()>maxItems){
- maxItems = day.size();
- }
- }
- for(String position:positions) {
- List<SchedulePojo> sectionItems = new ArrayList<>();
- for (int i = 0; i < maxItems; i++) {
- for (List<SchedulePojo> day : weekListing) {
- if(!day.isEmpty()) {
- if(day.size()>i) {
- if (day.get(i).getPositionName().equals(position)) {
- sectionItems.add(day.get(i));
- }
- }
- }
- else sectionItems.add(new SchedulePojo());
- }
- }
- sections.add(new ScheduleSection(position, sectionItems));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement