aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorDocile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>2023-11-25 02:08:59 +0000
committerDocile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>2023-11-25 02:08:59 +0000
commit56dd0a9acb6f5eeb18c337a83a1b49569071564e (patch)
tree905826a565ee24a3f9d404858535fc5a375f9591 /app/src/main/java
parenta22600ceefdb43c3a74292d92fb3e26fbbf1504d (diff)
downloadinfinity-for-reddit-56dd0a9acb6f5eeb18c337a83a1b49569071564e.tar
infinity-for-reddit-56dd0a9acb6f5eeb18c337a83a1b49569071564e.tar.gz
infinity-for-reddit-56dd0a9acb6f5eeb18c337a83a1b49569071564e.tar.bz2
infinity-for-reddit-56dd0a9acb6f5eeb18c337a83a1b49569071564e.tar.lz
infinity-for-reddit-56dd0a9acb6f5eeb18c337a83a1b49569071564e.tar.xz
infinity-for-reddit-56dd0a9acb6f5eeb18c337a83a1b49569071564e.tar.zst
infinity-for-reddit-56dd0a9acb6f5eeb18c337a83a1b49569071564e.zip
Fix markdown link not rendered in EmoteCloseBracketInlineProcessor.
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/AccountSavedThingActivity.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/markdown/EmoteCloseBracketInlineProcessor.java29
2 files changed, 17 insertions, 13 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/AccountSavedThingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/AccountSavedThingActivity.java
index 5c99c275..76d8b4c6 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/AccountSavedThingActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/AccountSavedThingActivity.java
@@ -156,7 +156,6 @@ public class AccountSavedThingActivity extends BaseActivity implements ActivityT
private void initializeViewPager() {
sectionsPagerAdapter = new SectionsPagerAdapter(this);
binding.accountSavedThingViewPager2.setAdapter(sectionsPagerAdapter);
- binding.accountSavedThingViewPager2.setOffscreenPageLimit(2);
binding.accountSavedThingViewPager2.setUserInputEnabled(!mSharedPreferences.getBoolean(SharedPreferencesUtils.DISABLE_SWIPING_BETWEEN_TABS, false));
new TabLayoutMediator(binding.accountSavedThingTabLayout, binding.accountSavedThingViewPager2, (tab, position) -> {
switch (position) {
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/EmoteCloseBracketInlineProcessor.java b/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/EmoteCloseBracketInlineProcessor.java
index c5c24b30..b24dc484 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/EmoteCloseBracketInlineProcessor.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/markdown/EmoteCloseBracketInlineProcessor.java
@@ -101,21 +101,26 @@ public class EmoteCloseBracketInlineProcessor extends InlineProcessor {
if (isLinkOrImage) {
// If we got here, open is a potential opener
- if (mediaMetadataMap == null) {
- index = startIndex;
- removeLastBracket();
+ Node linkOrImage;
+ if (opener.image) {
+ if (mediaMetadataMap == null) {
+ index = startIndex;
+ removeLastBracket();
- return text("]");
- }
- MediaMetadata mediaMetadata = mediaMetadataMap.get(dest);
- if (mediaMetadata == null) {
- index = startIndex;
- removeLastBracket();
+ return text("]");
+ }
+ MediaMetadata mediaMetadata = mediaMetadataMap.get(dest);
+ if (mediaMetadata == null) {
+ index = startIndex;
+ removeLastBracket();
- return text("]");
- }
+ return text("]");
+ }
- Node linkOrImage = opener.image ? new Emote(mediaMetadata, title) : new Link(dest, title);
+ linkOrImage = new Emote(mediaMetadata, title);
+ } else {
+ linkOrImage = new Link(dest, title);
+ }
Node node = opener.node.getNext();
while (node != null) {