Search in sources :

Example 1 with ScheduleHelper

use of com.google.samples.apps.iosched.model.ScheduleHelper 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());
    }
}
Also used : PresenterImpl(com.google.samples.apps.iosched.archframework.PresenterImpl) ScheduleHelper(com.google.samples.apps.iosched.model.ScheduleHelper) UpdatableView(com.google.samples.apps.iosched.archframework.UpdatableView)

Aggregations

PresenterImpl (com.google.samples.apps.iosched.archframework.PresenterImpl)1 UpdatableView (com.google.samples.apps.iosched.archframework.UpdatableView)1 ScheduleHelper (com.google.samples.apps.iosched.model.ScheduleHelper)1