diff options
author | Alex Ning <chineseperson5@gmail.com> | 2021-11-07 06:43:34 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2021-11-07 06:43:34 +0000 |
commit | eb34cfecce0d1ce7af01783b1c0eacb487cc342f (patch) | |
tree | 5cb049766b0d2ddefc1bb6d5d750dbc5b253166e /app | |
parent | 23368c89a86f7bd7c65ae7492efa82ec9a0ad152 (diff) | |
download | infinity-for-reddit-eb34cfecce0d1ce7af01783b1c0eacb487cc342f.tar infinity-for-reddit-eb34cfecce0d1ce7af01783b1c0eacb487cc342f.tar.gz infinity-for-reddit-eb34cfecce0d1ce7af01783b1c0eacb487cc342f.tar.bz2 infinity-for-reddit-eb34cfecce0d1ce7af01783b1c0eacb487cc342f.tar.lz infinity-for-reddit-eb34cfecce0d1ce7af01783b1c0eacb487cc342f.tar.xz infinity-for-reddit-eb34cfecce0d1ce7af01783b1c0eacb487cc342f.tar.zst infinity-for-reddit-eb34cfecce0d1ce7af01783b1c0eacb487cc342f.zip |
Fix clicking tab text does not change page in ViewUserDetailActivity, ViewSubredditDetailActivity or AccoundSavedThingActivity.
Diffstat (limited to '')
4 files changed, 13 insertions, 16 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java index 18f16d5d..2f534fb0 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java @@ -396,7 +396,7 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp builder.linkColor(mCustomThemeWrapper.getLinkColor()); } }) - .usePlugin(MovementMethodPlugin.create(BetterLinkMovementMethod.linkify(Linkify.WEB_URLS, this).setOnLinkLongClickListener((textView, url) -> { + .usePlugin(MovementMethodPlugin.create(BetterLinkMovementMethod.linkify(Linkify.WEB_URLS, descriptionTextView).setOnLinkLongClickListener((textView, url) -> { UrlMenuBottomSheetFragment urlMenuBottomSheetFragment = new UrlMenuBottomSheetFragment(); Bundle bundle = new Bundle(); bundle.putString(UrlMenuBottomSheetFragment.EXTRA_URL, url); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsListingRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsListingRecyclerViewAdapter.java index 15dce401..78fb5796 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsListingRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsListingRecyclerViewAdapter.java @@ -43,7 +43,6 @@ import io.noties.markwon.core.MarkwonTheme; import io.noties.markwon.ext.strikethrough.StrikethroughPlugin; import io.noties.markwon.html.HtmlPlugin; import io.noties.markwon.linkify.LinkifyPlugin; -import io.noties.markwon.movement.MovementMethodPlugin; import me.saket.bettermovementmethod.BetterLinkMovementMethod; import ml.docilealligator.infinityforreddit.NetworkState; import ml.docilealligator.infinityforreddit.R; @@ -192,16 +191,6 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter<Comment } }) - .usePlugin(MovementMethodPlugin.create(BetterLinkMovementMethod.linkify(Linkify.WEB_URLS, activity).setOnLinkLongClickListener((textView, url) -> { - if (activity != null && !activity.isDestroyed() && !activity.isFinishing()) { - UrlMenuBottomSheetFragment urlMenuBottomSheetFragment = new UrlMenuBottomSheetFragment(); - Bundle bundle = new Bundle(); - bundle.putString(UrlMenuBottomSheetFragment.EXTRA_URL, url); - urlMenuBottomSheetFragment.setArguments(bundle); - urlMenuBottomSheetFragment.show(activity.getSupportFragmentManager(), urlMenuBottomSheetFragment.getTag()); - } - return true; - }))) .usePlugin(LinkifyPlugin.create(Linkify.WEB_URLS)) .usePlugin(StrikethroughPlugin.create()) .build(); @@ -541,6 +530,16 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter<Comment } }); + commentMarkdownView.setMovementMethod(BetterLinkMovementMethod.linkify(Linkify.WEB_URLS, commentMarkdownView).setOnLinkLongClickListener((textView, url) -> { + if (mActivity != null && !mActivity.isDestroyed() && !mActivity.isFinishing()) { + UrlMenuBottomSheetFragment urlMenuBottomSheetFragment = new UrlMenuBottomSheetFragment(); + Bundle bundle = new Bundle(); + bundle.putString(UrlMenuBottomSheetFragment.EXTRA_URL, url); + urlMenuBottomSheetFragment.setArguments(bundle); + urlMenuBottomSheetFragment.show(mActivity.getSupportFragmentManager(), urlMenuBottomSheetFragment.getTag()); + } + return true; + })); upvoteButton.setOnClickListener(view -> { if (mAccessToken == null) { Toast.makeText(mActivity, R.string.login_first, Toast.LENGTH_SHORT).show(); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/CommentsListingFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/CommentsListingFragment.java index 04cabb7a..34c67ecd 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/CommentsListingFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/CommentsListingFragment.java @@ -307,9 +307,7 @@ public class CommentsListingFragment extends Fragment implements FragmentCommuni if (hasComment) { mFetchCommentInfoLinearLayout.setVisibility(View.GONE); } else { - mFetchCommentInfoLinearLayout.setOnClickListener(view -> { - //Do nothing - }); + mFetchCommentInfoLinearLayout.setOnClickListener(null); showErrorView(R.string.no_comments); } }); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/SidebarFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/SidebarFragment.java index d7a77b07..ef3d6925 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/SidebarFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/SidebarFragment.java @@ -137,6 +137,7 @@ public class SidebarFragment extends Fragment { } }) .usePlugin(StrikethroughPlugin.create()) + .usePlugin(LinkifyPlugin.create(Linkify.WEB_URLS)) .usePlugin(MovementMethodPlugin.create(BetterLinkMovementMethod.linkify(Linkify.WEB_URLS, recyclerView).setOnLinkLongClickListener((textView, url) -> { UrlMenuBottomSheetFragment urlMenuBottomSheetFragment = new UrlMenuBottomSheetFragment(); Bundle bundle = new Bundle(); @@ -145,7 +146,6 @@ public class SidebarFragment extends Fragment { urlMenuBottomSheetFragment.show(getChildFragmentManager(), urlMenuBottomSheetFragment.getTag()); return true; }))) - .usePlugin(LinkifyPlugin.create(Linkify.WEB_URLS)) .usePlugin(TableEntryPlugin.create(activity)) .build(); MarkwonAdapter markwonAdapter = MarkwonAdapter.builder(R.layout.adapter_default_entry, R.id.text) |