mirror of
				https://github.com/KokaKiwi/BarInsta
				synced 2025-11-04 13:35:36 +00:00 
			
		
		
		
	fix natgeotravel
This commit is contained in:
		
							parent
							
								
									6ecec215b7
								
							
						
					
					
						commit
						6ea6a4b951
					
				@ -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'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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/"+
 | 
			
		||||
 | 
			
		||||
@ -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 {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user