fix natgeotravel

This commit is contained in:
Austin Huang 2020-07-24 15:37:00 -04:00
parent 6ecec215b7
commit 6ea6a4b951
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
3 changed files with 5 additions and 23 deletions

View File

@ -12,6 +12,8 @@ android {
// REMEMBER TO CHANGE versionCode as well
// 16.7 is 32
// next version: fixed natgeotravel mention text problem
versionCode 32
versionName '16.7'

View File

@ -962,11 +962,6 @@ public final class MainHelper implements SwipeRefreshLayout.OnRefreshListener {
boolean ok = false;
String action;
// arg: follow / restrict / block
// restrict https://www.instagram.com/web/restrict_action/(un)restrict/
// requires form data "target_user_id: <id>"
protected Void doInBackground(String... rawAction) {
action = rawAction[0];
final String url = "https://www.instagram.com/web/"+

View File

@ -227,7 +227,7 @@ public final class FeedAdapter extends RecyclerView.Adapter<FeedItemViewHolder>
if (!captionEmpty && Utils.hasMentions(postCaption)) {
postCaption = Utils.getMentionText(postCaption);
//feedModel.setPostCaption(postCaption);
feedModel.setPostCaption(postCaption);
viewHolder.viewerCaption.setText(postCaption, TextView.BufferType.SPANNABLE);
viewHolder.viewerCaption.setMentionClickListener(mentionClickListener);
} else {
@ -363,23 +363,8 @@ public final class FeedAdapter extends RecyclerView.Adapter<FeedItemViewHolder>
final int minTrim = Math.min(255, i);
if (captionLen <= minTrim) return false;
final CharSequence mentionText = caption.subSequence(0, Math.min(captionLen, minTrim));
final SpannableStringBuilder stringBuilder = new SpannableStringBuilder(mentionText).append(ellipsize);
final int spanLen = stringBuilder.length();
// fixed @mention...more merging into one span
final CommentMentionClickSpan[] spans = stringBuilder.getSpans(0, mentionText.length(), CommentMentionClickSpan.class);
if (spans != null) {
for (final CommentMentionClickSpan span : spans) {
final int spanStart = stringBuilder.getSpanStart(span);
stringBuilder.removeSpan(span);
stringBuilder.setSpan(span, spanStart, mentionText.length(), 0);
}
}
stringBuilder.setSpan(new StyleSpan(Typeface.BOLD), spanLen - ellipsize.length(), spanLen, 0);
textView.setText(stringBuilder, bufferType);
if (Utils.hasMentions(caption))
textView.setText(Utils.getMentionText(caption), TextView.BufferType.SPANNABLE);
textView.setCaptionIsExpandable(true);
textView.setCaptionIsExpanded(true);
} else {