use of m.co.rh.id.a_medic_log.app.ui.component.AppBarSV in project a-medic-log by rh-id.
the class MedicineReminderDetailPage method provideComponent.
@Override
public void provideComponent(Provider provider) {
boolean isUpdate = isUpdate();
mSvProvider = provider.get(StatefulViewProvider.class);
mRxDisposer = mSvProvider.get(RxDisposer.class);
if (isUpdate) {
mNewMedicineReminderCmd = mSvProvider.get(UpdateMedicineReminderCmd.class);
} else {
mNewMedicineReminderCmd = mSvProvider.get(NewMedicineReminderCmd.class);
}
if (mAppBarSv == null) {
mAppBarSv = new AppBarSV(R.menu.page_medicine_reminder_detail);
}
if (isUpdate) {
mAppBarSv.setTitle(mNavigator.getActivity().getString(R.string.title_update_medicine_reminder));
} else {
mAppBarSv.setTitle(mNavigator.getActivity().getString(R.string.title_add_medicine_reminder));
}
mAppBarSv.setMenuItemListener(this);
initTextWatcher();
}
use of m.co.rh.id.a_medic_log.app.ui.component.AppBarSV in project a-medic-log by rh-id.
the class NoteAttachmentDetailPage method provideComponent.
@Override
public void provideComponent(Provider provider) {
mSvProvider = provider.get(StatefulViewProvider.class);
mExecutorService = mSvProvider.get(ExecutorService.class);
mRxDisposer = mSvProvider.get(RxDisposer.class);
mFileHelper = mSvProvider.get(FileHelper.class);
mLogger = mSvProvider.get(ILogger.class);
mNewNoteAttachmentFileCmd = mSvProvider.get(NewNoteAttachmentFileCmd.class);
mDeleteNoteAttachmentFileCmd = mSvProvider.get(DeleteNoteAttachmentFileCmd.class);
boolean isUpdate = isUpdate();
if (isUpdate) {
mNewNoteAttachmentCmd = mSvProvider.get(UpdateNoteAttachmentCmd.class);
} else {
mNewNoteAttachmentCmd = mSvProvider.get(NewNoteAttachmentCmd.class);
}
if (mAppBarSV == null) {
mAppBarSV = new AppBarSV(R.menu.page_note_attachment_detail);
}
if (mNoteAttachmentState == null) {
if (isUpdate) {
mNoteAttachmentState = getNoteAttachmentState();
} else {
mNoteAttachmentState = new NoteAttachmentState();
if (shouldSave()) {
mNoteAttachmentState.setNoteId(getNoteId());
}
}
}
mNameTextWatcher = new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
// leave blank
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
// leave blank
}
@Override
public void afterTextChanged(Editable editable) {
String name = editable.toString();
mNoteAttachmentState.setName(name);
mNewNoteAttachmentCmd.valid(mNoteAttachmentState);
}
};
mNoteAttachmentFileRecyclerViewAdapter = new NoteAttachmentFileRecyclerViewAdapter(mNoteAttachmentState, this, mNavigator, this);
}
use of m.co.rh.id.a_medic_log.app.ui.component.AppBarSV in project a-medic-log by rh-id.
the class NoteDetailPage method provideComponent.
@Override
public void provideComponent(Provider provider) {
mExecutorService = provider.get(ExecutorService.class);
mSvProvider = provider.get(StatefulViewProvider.class);
mLogger = mSvProvider.get(ILogger.class);
mRxDisposer = mSvProvider.get(RxDisposer.class);
mMedicineReminderChangeNotifier = mSvProvider.get(MedicineReminderChangeNotifier.class);
mNoteAttachmentFileChangeNotifier = mSvProvider.get(NoteAttachmentFileChangeNotifier.class);
mQueryNoteCmd = mSvProvider.get(QueryNoteCmd.class);
boolean isUpdate = isUpdate();
if (isUpdate) {
mNewNoteCmd = mSvProvider.get(UpdateNoteCmd.class);
} else {
mNewNoteCmd = mSvProvider.get(NewNoteCmd.class);
}
mDeleteNoteTagCmd = mSvProvider.get(DeleteNoteTagCmd.class);
mDeleteNoteAttachmentCmd = mSvProvider.get(DeleteNoteAttachmentCmd.class);
if (mNoteState == null) {
mNoteState = new NoteState();
if (isUpdate) {
mNoteState.setNoteId(getNoteId());
mRxDisposer.add("provideComponent_queryNoteInfo", mQueryNoteCmd.queryNoteInfo(mNoteState).subscribe((noteState, throwable) -> {
if (throwable != null) {
mLogger.e(TAG, throwable.getMessage(), throwable);
}
}));
} else {
mNoteState.setNoteProfileId(getProfileId());
}
}
if (mAppBarSv == null) {
mAppBarSv = new AppBarSV(R.menu.page_note_detail);
}
if (isUpdate) {
mAppBarSv.setTitle(mNavigator.getActivity().getString(R.string.title_update_note));
} else {
mAppBarSv.setTitle(mNavigator.getActivity().getString(R.string.title_add_note));
}
mAppBarSv.setMenuItemListener(this);
initTextWatcher();
mMedicineRecyclerViewAdapter = new MedicineRecyclerViewAdapter(mNoteState, this, this, this, this, mNavigator, this);
mNoteAttachmentRecyclerViewAdapter = new NoteAttachmentRecyclerViewAdapter(mNoteState, this, this, mNavigator, this);
mCompositeDisposable = new CompositeDisposable();
}
use of m.co.rh.id.a_medic_log.app.ui.component.AppBarSV 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();
}
use of m.co.rh.id.a_medic_log.app.ui.component.AppBarSV in project a-medic-log by rh-id.
the class NoteListPage method provideComponent.
@Override
public void provideComponent(Provider provider) {
Activity activity = mNavigator.getActivity();
if (mAppBarSV == null) {
mAppBarSV = new AppBarSV(R.menu.page_profile_list);
}
mAppBarSV.setTitle(activity.getString(R.string.title_note_list));
mAppBarSV.setMenuItemListener(this);
if (mNoteListSV == null) {
mNoteListSV = new NoteListSV(getProfileId());
}
}
Aggregations