aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDocile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>2023-11-19 04:30:10 +0000
committerDocile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>2023-11-19 04:30:10 +0000
commitd6c9450648af7f614d47587c140cb91a0e35c0a0 (patch)
tree02cacbfba0dbb7ad0c211bc9a194678f71173a23 /app
parent93067af4fe84edce9274579cc501dd0cb5837500 (diff)
downloadinfinity-for-reddit-d6c9450648af7f614d47587c140cb91a0e35c0a0.tar
infinity-for-reddit-d6c9450648af7f614d47587c140cb91a0e35c0a0.tar.gz
infinity-for-reddit-d6c9450648af7f614d47587c140cb91a0e35c0a0.tar.bz2
infinity-for-reddit-d6c9450648af7f614d47587c140cb91a0e35c0a0.tar.lz
infinity-for-reddit-d6c9450648af7f614d47587c140cb91a0e35c0a0.tar.xz
infinity-for-reddit-d6c9450648af7f614d47587c140cb91a0e35c0a0.tar.zst
infinity-for-reddit-d6c9450648af7f614d47587c140cb91a0e35c0a0.zip
Fix unable to submit gallery posts.
Diffstat (limited to 'app')
-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();