armcha / AutoLinkTextView

AutoLinkTextView is TextView that supports Hashtags (#), Mentions (@) , URLs (http://), Phone and Email automatically detecting and ability to handle clicks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AutoLinkTextView in RecyclerView Items

Arkar009 opened this issue · comments

Hello, @armcha . Firstly, Thank you for your AutoLinkTextView. I used it in my viewholder of recyclerview. But, it never trigger to setAutoLinkOnClickListener event. I already debugged.

Comment comment=commentList.get(position); commentHolder.txtComment.addAutoLinkMode( AutoLinkMode.MODE_HASHTAG, AutoLinkMode.MODE_PHONE, AutoLinkMode.MODE_URL, AutoLinkMode.MODE_EMAIL, AutoLinkMode.MODE_MENTION); commentHolder.txtComment.setUrlModeColor(ContextCompat.getColor(context, R.color.colorAccent)); commentHolder.txtComment.enableUnderLine(); commentHolder.txtComment.setText(comment.getContent()); commentHolder.txtComment.setAutoLinkOnClickListener(new AutoLinkOnClickListener() { @Override public void onAutoLinkTextClick(AutoLinkMode autoLinkMode, String matchedText) { Toast.makeText(context,autoLinkMode.toString()+" "+matchedText,Toast.LENGTH_SHORT).show(); } });

commentHolder.txtComment.setText(comment.getContent());
replace with.....
commentHolder.txtComment.setAutoLinkText(comment.getContent());

Thanks DevSunKo.