diff options
2 files changed, 15 insertions, 11 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditCommentActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditCommentActivity.java index 9daff3ef..04976d31 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditCommentActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditCommentActivity.java @@ -236,7 +236,7 @@ public class EditCommentActivity extends BaseActivity implements UploadImageEnab mOauthRetrofit.create(RedditAPI.class) .editPostOrComment(APIUtils.getOAuthHeader(mAccessToken), params) - .enqueue(new Callback<String>() { + .enqueue(new Callback<>() { @Override public void onResponse(@NonNull Call<String> call, @NonNull Response<String> response) { isSubmitting = false; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/RichTextJSONConverter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/RichTextJSONConverter.java index 6ff044b5..d8b9cd31 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/RichTextJSONConverter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/RichTextJSONConverter.java @@ -677,16 +677,20 @@ public class RichTextJSONConverter implements Visitor { } nodeJSON.put(CONTENT, cArray); - switch (((TableCell) customNode).getAlignment()) { - case LEFT: - nodeJSON.put(TABLE_CELL_ALIGNMENT, TABLE_CELL_ALIGNMENT_LEFT); - break; - case CENTER: - nodeJSON.put(TABLE_CELL_ALIGNMENT, TABLE_CELL_ALIGNMENT_CENTER); - break; - case RIGHT: - nodeJSON.put(TABLE_CELL_ALIGNMENT, TABLE_CELL_ALIGNMENT_RIGHT); - break; + if (((TableCell) customNode).getAlignment() == null) { + nodeJSON.put(TABLE_CELL_ALIGNMENT, TABLE_CELL_ALIGNMENT_LEFT); + } else { + switch (((TableCell) customNode).getAlignment()) { + case CENTER: + nodeJSON.put(TABLE_CELL_ALIGNMENT, TABLE_CELL_ALIGNMENT_CENTER); + break; + case RIGHT: + nodeJSON.put(TABLE_CELL_ALIGNMENT, TABLE_CELL_ALIGNMENT_RIGHT); + break; + default: + nodeJSON.put(TABLE_CELL_ALIGNMENT, TABLE_CELL_ALIGNMENT_LEFT); + break; + } } contentArrayStack.peek().put(nodeJSON); |