use of ca.etsmtl.applets.etsmobile.ui.calendar_decorator.TodayDecorator in project ETSMobile-Android2 by ApplETS.
the class HoraireFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.calendar_horaire_layout, container, false);
ButterKnife.bind(this, v);
databaseHelper = new DatabaseHelper(getActivity());
seanceAdapter = new SeanceAdapter(getActivity());
allseanceAdapter = new SeanceAdapter(getActivity());
upcomingseanceAdapter = new SeanceAdapter(getActivity());
fillSeancesList(dateTime.toDate());
fillListView();
setDaysList();
calendar_listview.setAdapter(upcomingseanceAdapter);
mCalendarView.setCurrentDate(new Date());
mCalendarView.setSelectedDate(new Date());
mCalendarView.setOnDateChangedListener(this);
mCalendarView.addDecorators(new CourseDecorator(getActivity(), courseDays), new FinalExamDecorator(getActivity(), finalExamDays), new EventDecorator(eventDays, ContextCompat.getColor(getActivity(), R.color.black)), new TodayDecorator(getActivity()), new CourseTodayDecorator(getActivity(), courseDays));
horaireManager = new HoraireManager(this, getActivity());
horaireManager.addObserver(this);
progressBarSyncHoraire = (ProgressBar) v.findViewById(R.id.progressBar_sync_horaire);
progressBarSyncHoraire.setVisibility(ProgressBar.VISIBLE);
// customProgressDialog = new CustomProgressDialog(getActivity(), R.drawable.loading_spinner, "Synchronisation en cours");
// customProgressDialog.show();
dataManager.getDataFromSignet(DataManager.SignetMethods.LIST_SESSION, ApplicationManager.userCredentials, this);
dataManager.getDataFromSignet(SignetMethods.LIST_SEANCES_CURRENT_AND_NEXT_SESSION, ApplicationManager.userCredentials, this);
dataManager.getDataFromSignet(SignetMethods.LIST_JOURSREMPLACES_CURRENT_AND_NEXT_SESSION, ApplicationManager.userCredentials, this);
// @TODO Eventually, we might want to make the call for ETS Events here instead of in the onRequestSuccess.
// The problem right now is getting the endDate without using the ListeDeSessions
/*String dateStart = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
dataManager.sendRequest(new AppletsApiCalendarRequest(getActivity(), dateStart, "2016-04-30"), this);*/
AnalyticsHelper.getInstance(getActivity()).sendScreenEvent(getClass().getSimpleName());
return v;
}
Aggregations