Source:
<code>private RemotePreviewLogicHelper.RemotePreviewHelperFunctions getEditPostActivityStrategyFunctions() { return new RemotePreviewLogicHelper.RemotePreviewHelperFunctions() { @Override public boolean isNewPost() { return EditPostActivity.this.isNewPost(); } @Override public void notifyNoNetwork() { UploadUtils.showSnackbar(findViewById(R.id.editor_activity), R.string.no_network_message); } @Override public boolean notifyUploadInProgress(PostModel post) { if (UploadService.hasInProgressMediaUploadsForPost(post)) { ToastUtils.showToast(EditPostActivity.this, getString(R.string.editor_toast_uploading_please_wait), Duration.SHORT); return true; } else { return false; } } @Nullable @Override public PostModel updatePostIfNeeded() { updatePostObject(); return mPost; } @Override public boolean canDiscard() { <START> return isDiscardable(); <END> } @Override public void notifyEmptyDraft() { ToastUtils.showToast(EditPostActivity.this, getString(R.string.error_preview_empty_draft), Duration.SHORT); } @Override public void startUploading(boolean isRemoteAutoSave, @Nullable PostModel post) { if (isRemoteAutoSave) { updatePostLoadingAndDialogState(PostLoadingState.REMOTE_AUTO_SAVING_FOR_PREVIEW, post); savePostAndOptionallyFinish(false, true); } else { updatePostLoadingAndDialogState(PostLoadingState.UPLOADING_FOR_PREVIEW, post); savePostAndOptionallyFinish(false); } } @Override public void notifyEmptyPost() { String message = getString( mIsPage ? R.string.error_preview_empty_page : R.string.error_preview_empty_post ); ToastUtils.showToast(EditPostActivity.this, message, Duration.SHORT); } }; }</code><technical_language>I want PostUtils.isPublishable instead of isDiscardable here. rename if change that. I guess remove canDiscard helper completely (and PostUtils directly). isDiscardable check if post is "freshly created" impact kind of save do showing preview</technical_language>

Target:
private RemotePreviewLogicHelper.RemotePreviewHelperFunctions getEditPostActivityStrategyFunctions() { return new RemotePreviewLogicHelper.RemotePreviewHelperFunctions() { @Override public boolean notifyUploadInProgress(PostModel post) { if (UploadService.hasInProgressMediaUploadsForPost(post)) { ToastUtils.showToast(EditPostActivity.this, getString(R.string.editor_toast_uploading_please_wait), Duration.SHORT); return true; } else { return false; } } @Nullable @Override public PostModel updatePostIfNeeded() { updatePostObject(); return mPost; } @Override public void notifyEmptyDraft() { ToastUtils.showToast(EditPostActivity.this, getString(R.string.error_preview_empty_draft), Duration.SHORT); } @Override public void startUploading(boolean isRemoteAutoSave, @Nullable PostModel post) { if (isRemoteAutoSave) { updatePostLoadingAndDialogState(PostLoadingState.REMOTE_AUTO_SAVING_FOR_PREVIEW, post); savePostAndOptionallyFinish(false, true); } else { updatePostLoadingAndDialogState(PostLoadingState.UPLOADING_FOR_PREVIEW, post); savePostAndOptionallyFinish(false); } } @Override public void notifyEmptyPost() { String message = getString( mIsPage ? R.string.error_preview_empty_page : R.string.error_preview_empty_post ); ToastUtils.showToast(EditPostActivity.this, message, Duration.SHORT); } }; }