use of com.alamkanak.weekview.sample.apiclient.MyJsonService in project Android-Week-View by alamkanak.
the class AsynchronousActivity method onMonthChange.
@Override
public List<? extends WeekViewEvent> onMonthChange(int newYear, int newMonth) {
// downloaded using retrofit, visit http://square.github.io/retrofit
if (!calledNetwork) {
RestAdapter retrofit = new RestAdapter.Builder().setEndpoint("https://api.myjson.com/bins").build();
MyJsonService service = retrofit.create(MyJsonService.class);
service.listEvents(this);
calledNetwork = true;
}
// Return only the events that matches newYear and newMonth.
List<WeekViewEvent> matchedEvents = new ArrayList<WeekViewEvent>();
for (WeekViewEvent event : events) {
if (eventMatches(event, newYear, newMonth)) {
matchedEvents.add(event);
}
}
return matchedEvents;
}
Aggregations