use of com.google.samples.apps.iosched.archframework.UpdatableView in project iosched by google.
the class MyScheduleActivity method initPresenter.
private void initPresenter() {
MyScheduleModel model = ModelProvider.provideMyScheduleModel(new ScheduleHelper(this), this);
if (mWideMode) {
mPresenter = new PresenterImpl(model, (UpdatableView) getFragmentManager().findFragmentById(R.id.myScheduleWideFrag), MyScheduleModel.MyScheduleUserActionEnum.values(), MyScheduleModel.MyScheduleQueryEnum.values());
mPresenter.loadInitialQueries();
} else {
// Each fragment in the pager adapter is an updatable view that the presenter must know
MyScheduleSingleDayFragment[] fragments = mViewPagerAdapter.getFragments();
UpdatableView[] views = new UpdatableView[fragments.length];
for (int i = 0; i < fragments.length; i++) {
views[i] = fragments[i];
}
mPresenter = new PresenterImpl(model, views, MyScheduleModel.MyScheduleUserActionEnum.values(), MyScheduleModel.MyScheduleQueryEnum.values());
}
}
Aggregations