Search in sources :

Example 1 with MedicineReminderRecyclerViewAdapter

use of m.co.rh.id.a_medic_log.app.ui.component.medicine.reminder.MedicineReminderRecyclerViewAdapter in project a-medic-log by rh-id.

the class MedicineDetailPage method provideComponent.

@Override
public void provideComponent(Provider provider) {
    boolean isUpdate = isUpdate();
    mExecutorService = provider.get(ExecutorService.class);
    mSvProvider = provider.get(StatefulViewProvider.class);
    mRxDisposer = mSvProvider.get(RxDisposer.class);
    mMedicineReminderChangeNotifier = mSvProvider.get(MedicineReminderChangeNotifier.class);
    if (isUpdate) {
        mNewMedicineCmd = mSvProvider.get(UpdateMedicineCmd.class);
    } else {
        mNewMedicineCmd = mSvProvider.get(NewMedicineCmd.class);
    }
    mQueryMedicineCmd = mSvProvider.get(QueryMedicineCmd.class);
    if (mAppBarSv == null) {
        mAppBarSv = new AppBarSV(R.menu.page_medicine_detail);
    }
    if (isUpdate) {
        mAppBarSv.setTitle(mNavigator.getActivity().getString(R.string.title_update_medicine));
    } else {
        mAppBarSv.setTitle(mNavigator.getActivity().getString(R.string.title_add_medicine));
    }
    mAppBarSv.setMenuItemListener(this);
    if (mMedicineState == null) {
        mMedicineState = getMedicineState();
        if (!isUpdate && shouldSave()) {
            mMedicineState.setNoteId(getNoteId());
        }
    }
    initTextWatcher();
    mMedicineReminderRecyclerViewAdapter = new MedicineReminderRecyclerViewAdapter(mMedicineState, this, this, this, mNavigator, this);
    mSuggestionQuery = s -> mQueryMedicineCmd.searchMedicineName(s).blockingGet();
}
Also used : MedicineReminderRecyclerViewAdapter(m.co.rh.id.a_medic_log.app.ui.component.medicine.reminder.MedicineReminderRecyclerViewAdapter) AppBarSV(m.co.rh.id.a_medic_log.app.ui.component.AppBarSV) QueryMedicineCmd(m.co.rh.id.a_medic_log.app.provider.command.QueryMedicineCmd) NewMedicineCmd(m.co.rh.id.a_medic_log.app.provider.command.NewMedicineCmd) ExecutorService(java.util.concurrent.ExecutorService) StatefulViewProvider(m.co.rh.id.a_medic_log.app.provider.StatefulViewProvider) MedicineReminderChangeNotifier(m.co.rh.id.a_medic_log.app.provider.notifier.MedicineReminderChangeNotifier) RxDisposer(m.co.rh.id.a_medic_log.app.rx.RxDisposer) UpdateMedicineCmd(m.co.rh.id.a_medic_log.app.provider.command.UpdateMedicineCmd)

Aggregations

ExecutorService (java.util.concurrent.ExecutorService)1 StatefulViewProvider (m.co.rh.id.a_medic_log.app.provider.StatefulViewProvider)1 NewMedicineCmd (m.co.rh.id.a_medic_log.app.provider.command.NewMedicineCmd)1 QueryMedicineCmd (m.co.rh.id.a_medic_log.app.provider.command.QueryMedicineCmd)1 UpdateMedicineCmd (m.co.rh.id.a_medic_log.app.provider.command.UpdateMedicineCmd)1 MedicineReminderChangeNotifier (m.co.rh.id.a_medic_log.app.provider.notifier.MedicineReminderChangeNotifier)1 RxDisposer (m.co.rh.id.a_medic_log.app.rx.RxDisposer)1 AppBarSV (m.co.rh.id.a_medic_log.app.ui.component.AppBarSV)1 MedicineReminderRecyclerViewAdapter (m.co.rh.id.a_medic_log.app.ui.component.medicine.reminder.MedicineReminderRecyclerViewAdapter)1