Source:
<code>private void startObserving() { mEditorMedia.getUiState().observe(this, uiState -> { if (uiState != null) { updateAddingMediaToEditorProgressDialogState(uiState.getProgressDialogUiState()); if (uiState.getEditorOverlayVisibility()) { showOverlay(false); } else { hideOverlay(); } } }); mEditorMedia.getSnackBarMessage().observe(this, event -> { SnackbarMessageHolder messageHolder = event.getContentIfNotHandled(); <START> if (messageHolder != null && messageHolder.getMessage() instanceof UiStringRes) { <END> UiStringRes message = (UiStringRes) messageHolder.getMessage(); WPSnackbar .make(findViewById(R.id.editor_activity), message.getStringRes(), Snackbar.LENGTH_SHORT) .show(); } }); mEditorMedia.getToastMessage().observe(this, event -> { ToastMessageHolder contentIfNotHandled = event.getContentIfNotHandled(); if (contentIfNotHandled != null) { contentIfNotHandled.show(this); } }); mViewModel.getOnSavePostTriggered().observe(this, unitEvent -> unitEvent.applyIfNotHandled(unit -> { updateAndSavePostAsync(); return null; })); mViewModel.getOnFinish().observe(this, finishEvent -> finishEvent.applyIfNotHandled(activityFinishState -> { switch (activityFinishState) { case SAVED_ONLINE: saveResult(true, false); break; case SAVED_LOCALLY: saveResult(true, true); break; case CANCELLED: saveResult(false, true); break; } removePostOpenInEditorStickyEvent(); mEditorMedia.definitelyDeleteBackspaceDeletedMediaItemsAsync(); finish(); return null; })); mEditPostRepository.getPostChanged().observe(this, postEvent -> postEvent.applyIfNotHandled(post -> { mViewModel.savePostToDb(mEditPostRepository, mSite); return null; })); }</code><technical_language>Is reason accept UiStringRes UiStringText? considered mUiHelpers.getTextOfUiString(this, messageHolder.getMessage()).</technical_language>

Target:
private void startObserving() { mEditorMedia.getUiState().observe(this, uiState -> { if (uiState != null) { updateAddingMediaToEditorProgressDialogState(uiState.getProgressDialogUiState()); if (uiState.getEditorOverlayVisibility()) { showOverlay(false); } else { hideOverlay(); } } }); mEditorMedia.getSnackBarMessage().observe(this, event -> { SnackbarMessageHolder messageHolder = event.getContentIfNotHandled(); if (messageHolder != null) { WPSnackbar.make( findViewById(R.id.editor_activity), mUiHelpers.getTextOfUiString(this, messageHolder.getMessage()), Snackbar.LENGTH_SHORT ) .show(); } }); mEditorMedia.getToastMessage().observe(this, event -> { ToastMessageHolder contentIfNotHandled = event.getContentIfNotHandled(); if (contentIfNotHandled != null) { contentIfNotHandled.show(this); } }); mViewModel.getOnSavePostTriggered().observe(this, unitEvent -> unitEvent.applyIfNotHandled(unit -> { updateAndSavePostAsync(); return null; })); mViewModel.getOnFinish().observe(this, finishEvent -> finishEvent.applyIfNotHandled(activityFinishState -> { switch (activityFinishState) { case SAVED_ONLINE: saveResult(true, false); break; case SAVED_LOCALLY: saveResult(true, true); break; case CANCELLED: saveResult(false, true); break; } removePostOpenInEditorStickyEvent(); mEditorMedia.definitelyDeleteBackspaceDeletedMediaItemsAsync(); finish(); return null; })); mEditPostRepository.getPostChanged().observe(this, postEvent -> postEvent.applyIfNotHandled(post -> { mViewModel.savePostToDb(mEditPostRepository, mSite); return null; })); }