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();
}
Aggregations