mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-02 14:27:10 +01:00
Directly edit post in FullMarkdownActivity for EditPostActivity.
This commit is contained in:
parent
d2900b66c4
commit
346cb491f3
@ -70,6 +70,7 @@ public class EditPostActivity extends BaseActivity implements UploadImageEnabled
|
|||||||
|
|
||||||
private static final int PICK_IMAGE_REQUEST_CODE = 100;
|
private static final int PICK_IMAGE_REQUEST_CODE = 100;
|
||||||
private static final int CAPTURE_IMAGE_REQUEST_CODE = 200;
|
private static final int CAPTURE_IMAGE_REQUEST_CODE = 200;
|
||||||
|
private static final int MARKDOWN_PREVIEW_REQUEST_CODE = 300;
|
||||||
|
|
||||||
private static final String UPLOADED_IMAGES_STATE = "UIS";
|
private static final String UPLOADED_IMAGES_STATE = "UIS";
|
||||||
|
|
||||||
@ -219,8 +220,18 @@ public class EditPostActivity extends BaseActivity implements UploadImageEnabled
|
|||||||
Intent intent = new Intent(this, FullMarkdownActivity.class);
|
Intent intent = new Intent(this, FullMarkdownActivity.class);
|
||||||
intent.putExtra(FullMarkdownActivity.EXTRA_COMMENT_MARKDOWN, contentEditText.getText().toString());
|
intent.putExtra(FullMarkdownActivity.EXTRA_COMMENT_MARKDOWN, contentEditText.getText().toString());
|
||||||
intent.putExtra(FullMarkdownActivity.EXTRA_SUBMIT_POST, true);
|
intent.putExtra(FullMarkdownActivity.EXTRA_SUBMIT_POST, true);
|
||||||
startActivity(intent);
|
startActivityForResult(intent, MARKDOWN_PREVIEW_REQUEST_CODE);
|
||||||
} else if (item.getItemId() == R.id.action_send_edit_post_activity) {
|
} else if (item.getItemId() == R.id.action_send_edit_post_activity) {
|
||||||
|
editPost();
|
||||||
|
return true;
|
||||||
|
} else if (item.getItemId() == android.R.id.home) {
|
||||||
|
onBackPressed();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void editPost() {
|
||||||
if (!isSubmitting) {
|
if (!isSubmitting) {
|
||||||
isSubmitting = true;
|
isSubmitting = true;
|
||||||
|
|
||||||
@ -250,12 +261,6 @@ public class EditPostActivity extends BaseActivity implements UploadImageEnabled
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
} else if (item.getItemId() == android.R.id.home) {
|
|
||||||
onBackPressed();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -272,6 +277,8 @@ public class EditPostActivity extends BaseActivity implements UploadImageEnabled
|
|||||||
} else if (requestCode == CAPTURE_IMAGE_REQUEST_CODE) {
|
} else if (requestCode == CAPTURE_IMAGE_REQUEST_CODE) {
|
||||||
Utils.uploadImageToReddit(this, mExecutor, mOauthRetrofit, mUploadMediaRetrofit,
|
Utils.uploadImageToReddit(this, mExecutor, mOauthRetrofit, mUploadMediaRetrofit,
|
||||||
mAccessToken, contentEditText, coordinatorLayout, capturedImageUri, uploadedImages);
|
mAccessToken, contentEditText, coordinatorLayout, capturedImageUri, uploadedImages);
|
||||||
|
} else if (requestCode == MARKDOWN_PREVIEW_REQUEST_CODE) {
|
||||||
|
editPost();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user