Loading app/src/main/java/app/fedilab/android/mastodon/activities/ProfileActivity.java +1 −1 Original line number Diff line number Diff line Loading @@ -589,7 +589,7 @@ public class ProfileActivity extends BaseActivity { account.getSpanNote(ProfileActivity.this, new WeakReference<>(binding.accountNote)), TextView.BufferType.SPANNABLE); }), }, true), TextView.BufferType.SPANNABLE); binding.accountNote.setMovementMethod(LinkMovementMethod.getInstance()); Loading app/src/main/java/app/fedilab/android/mastodon/client/entities/api/Account.java +2 −2 Original line number Diff line number Diff line Loading @@ -112,8 +112,8 @@ public class Account implements Serializable { public synchronized Spannable getSpanNote(Context context, WeakReference<View> viewWeakReference) { return SpannableHelper.convert(context, note, null, this, null, viewWeakReference, null, true, false); } public synchronized Spannable getSpanNote(Context context, WeakReference<View> viewWeakReference, Status.Callback callback) { return SpannableHelper.convert(context, note, null, this, null, viewWeakReference, callback, true, false); public synchronized Spannable getSpanNote(Context context, WeakReference<View> viewWeakReference, Status.Callback callback, boolean keepOriginalBottomHashTags) { return SpannableHelper.convert(context, note, null, this, null, viewWeakReference, callback, true, false, keepOriginalBottomHashTags); } @Override Loading app/src/main/java/app/fedilab/android/mastodon/client/entities/api/Status.java +1 −1 Original line number Diff line number Diff line Loading @@ -195,7 +195,7 @@ public class Status implements Serializable, Cloneable { public synchronized Spannable getSpanContent(Context context, boolean checkRemotely, WeakReference<View> viewWeakReference, Callback callback) { if (contentSpan == null) { contentSpan = SpannableHelper.convert(context, content, this, null, null, checkRemotely, viewWeakReference, callback, true, true); contentSpan = SpannableHelper.convert(context, content, this, null, null, checkRemotely, viewWeakReference, callback, true, true, false); } return contentSpan; } Loading app/src/main/java/app/fedilab/android/mastodon/helper/SpannableHelper.java +14 −4 Original line number Diff line number Diff line Loading @@ -135,12 +135,22 @@ public class SpannableHelper { public static Spannable convert(Context context, String text, Status status, Account account, Announcement announcement, WeakReference<View> viewWeakReference, Status.Callback callback, boolean convertHtml, boolean convertMarkdown) { return convert(context, text, status, account, announcement, false, viewWeakReference, callback, convertHtml, convertMarkdown); return convert(context, text, status, account, announcement, false, viewWeakReference, callback, convertHtml, convertMarkdown, false); } public static Spannable convert(Context context, String text, Status status, Account account, Announcement announcement, boolean checkRemotely, WeakReference<View> viewWeakReference, Status.Callback callback, boolean convertHtml, boolean convertMarkdown) { Status status, Account account, Announcement announcement, WeakReference<View> viewWeakReference, Status.Callback callback, boolean convertHtml, boolean convertMarkdown, boolean keepOriginalBottomHashTags) { return convert(context, text, status, account, announcement, false, viewWeakReference, callback, convertHtml, convertMarkdown, keepOriginalBottomHashTags); } /** * @param keepOriginalBottomHashTags set this to {@code true} to preserve original bottom hash tags. For example, in account note * <i>(profile bio/description)</i> in {@link app.fedilab.android.mastodon.activities.ProfileActivity ProfileActivity} */ public static Spannable convert(Context context, String text, Status status, Account account, Announcement announcement, boolean checkRemotely, WeakReference<View> viewWeakReference, Status.Callback callback, boolean convertHtml, boolean convertMarkdown, boolean keepOriginalBottomHashTags) { if (text == null) { return null; } Loading Loading @@ -395,7 +405,7 @@ public class SpannableHelper { } boolean underlineBottomHashTags = sharedpreferences.getBoolean(context.getString(R.string.SET_UNDERLINE_BOTTOM_HASHTAGS), true); if(underlineBottomHashTags) { if(underlineBottomHashTags && !keepOriginalBottomHashTags) { SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(); final Pattern bottomTagsPattern = Pattern.compile(patternBottomTags, Pattern.CASE_INSENSITIVE); Matcher matcherBottomTags = bottomTagsPattern.matcher(content); Loading Loading
app/src/main/java/app/fedilab/android/mastodon/activities/ProfileActivity.java +1 −1 Original line number Diff line number Diff line Loading @@ -589,7 +589,7 @@ public class ProfileActivity extends BaseActivity { account.getSpanNote(ProfileActivity.this, new WeakReference<>(binding.accountNote)), TextView.BufferType.SPANNABLE); }), }, true), TextView.BufferType.SPANNABLE); binding.accountNote.setMovementMethod(LinkMovementMethod.getInstance()); Loading
app/src/main/java/app/fedilab/android/mastodon/client/entities/api/Account.java +2 −2 Original line number Diff line number Diff line Loading @@ -112,8 +112,8 @@ public class Account implements Serializable { public synchronized Spannable getSpanNote(Context context, WeakReference<View> viewWeakReference) { return SpannableHelper.convert(context, note, null, this, null, viewWeakReference, null, true, false); } public synchronized Spannable getSpanNote(Context context, WeakReference<View> viewWeakReference, Status.Callback callback) { return SpannableHelper.convert(context, note, null, this, null, viewWeakReference, callback, true, false); public synchronized Spannable getSpanNote(Context context, WeakReference<View> viewWeakReference, Status.Callback callback, boolean keepOriginalBottomHashTags) { return SpannableHelper.convert(context, note, null, this, null, viewWeakReference, callback, true, false, keepOriginalBottomHashTags); } @Override Loading
app/src/main/java/app/fedilab/android/mastodon/client/entities/api/Status.java +1 −1 Original line number Diff line number Diff line Loading @@ -195,7 +195,7 @@ public class Status implements Serializable, Cloneable { public synchronized Spannable getSpanContent(Context context, boolean checkRemotely, WeakReference<View> viewWeakReference, Callback callback) { if (contentSpan == null) { contentSpan = SpannableHelper.convert(context, content, this, null, null, checkRemotely, viewWeakReference, callback, true, true); contentSpan = SpannableHelper.convert(context, content, this, null, null, checkRemotely, viewWeakReference, callback, true, true, false); } return contentSpan; } Loading
app/src/main/java/app/fedilab/android/mastodon/helper/SpannableHelper.java +14 −4 Original line number Diff line number Diff line Loading @@ -135,12 +135,22 @@ public class SpannableHelper { public static Spannable convert(Context context, String text, Status status, Account account, Announcement announcement, WeakReference<View> viewWeakReference, Status.Callback callback, boolean convertHtml, boolean convertMarkdown) { return convert(context, text, status, account, announcement, false, viewWeakReference, callback, convertHtml, convertMarkdown); return convert(context, text, status, account, announcement, false, viewWeakReference, callback, convertHtml, convertMarkdown, false); } public static Spannable convert(Context context, String text, Status status, Account account, Announcement announcement, boolean checkRemotely, WeakReference<View> viewWeakReference, Status.Callback callback, boolean convertHtml, boolean convertMarkdown) { Status status, Account account, Announcement announcement, WeakReference<View> viewWeakReference, Status.Callback callback, boolean convertHtml, boolean convertMarkdown, boolean keepOriginalBottomHashTags) { return convert(context, text, status, account, announcement, false, viewWeakReference, callback, convertHtml, convertMarkdown, keepOriginalBottomHashTags); } /** * @param keepOriginalBottomHashTags set this to {@code true} to preserve original bottom hash tags. For example, in account note * <i>(profile bio/description)</i> in {@link app.fedilab.android.mastodon.activities.ProfileActivity ProfileActivity} */ public static Spannable convert(Context context, String text, Status status, Account account, Announcement announcement, boolean checkRemotely, WeakReference<View> viewWeakReference, Status.Callback callback, boolean convertHtml, boolean convertMarkdown, boolean keepOriginalBottomHashTags) { if (text == null) { return null; } Loading Loading @@ -395,7 +405,7 @@ public class SpannableHelper { } boolean underlineBottomHashTags = sharedpreferences.getBoolean(context.getString(R.string.SET_UNDERLINE_BOTTOM_HASHTAGS), true); if(underlineBottomHashTags) { if(underlineBottomHashTags && !keepOriginalBottomHashTags) { SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(); final Pattern bottomTagsPattern = Pattern.compile(patternBottomTags, Pattern.CASE_INSENSITIVE); Matcher matcherBottomTags = bottomTagsPattern.matcher(content); Loading