aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java3
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/markdown/ImageAndGifBlockParser.java2
2 files changed, 4 insertions, 1 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java
index c18ba059..e66eb57f 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java
@@ -567,6 +567,7 @@ public class PostGalleryActivity extends BaseActivity implements FlairBottomShee
promptAlertDialog(R.string.exit_when_submit, R.string.exit_when_submit_post_detail);
return true;
} else {
+ redditGalleryImageInfoList = adapter.getRedditGalleryImageInfoList();
if (!titleEditText.getText().toString().equals("") || redditGalleryImageInfoList != null) {
promptAlertDialog(R.string.discard, R.string.discard_detail);
return true;
@@ -585,6 +586,7 @@ public class PostGalleryActivity extends BaseActivity implements FlairBottomShee
return true;
}
+ redditGalleryImageInfoList = adapter.getRedditGalleryImageInfoList();
if (redditGalleryImageInfoList == null || redditGalleryImageInfoList.isEmpty()) {
Snackbar.make(coordinatorLayout, R.string.select_an_image, Snackbar.LENGTH_SHORT).show();
return true;
@@ -635,6 +637,7 @@ public class PostGalleryActivity extends BaseActivity implements FlairBottomShee
if (isPosting) {
promptAlertDialog(R.string.exit_when_submit, R.string.exit_when_submit_post_detail);
} else {
+ redditGalleryImageInfoList = adapter.getRedditGalleryImageInfoList();
if (!titleEditText.getText().toString().equals("") || redditGalleryImageInfoList != null) {
promptAlertDialog(R.string.discard, R.string.discard_detail);
} else {
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/ImageAndGifBlockParser.java b/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/ImageAndGifBlockParser.java
index 01e0f9e7..029a5b83 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/ImageAndGifBlockParser.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/ImageAndGifBlockParser.java
@@ -33,7 +33,7 @@ public class ImageAndGifBlockParser extends AbstractBlockParser {
}
public static class Factory extends AbstractBlockParserFactory {
- private Pattern redditPreviewPattern = Pattern.compile("!\\[img]\\(https://preview.redd.it/\\w+.(jpg|png)((\\?+[-a-zA-Z0-9()@:%_+.~#?&/=]*)|)\\)");
+ private final Pattern redditPreviewPattern = Pattern.compile("!\\[img]\\(https://preview.redd.it/\\w+.(jpg|png)((\\?+[-a-zA-Z0-9()@:%_+.~#?&/=]*)|)\\)");
private Map<String, Post.MediaMetadata> mediaMetadataMap;
private final int fromIndex = "![img](https://preview.redd.it/".length();