| | |
| | | package com.tejia.lijin.app.ui.trends; |
| | | |
| | | import android.app.Activity; |
| | | import android.content.ClipboardManager; |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.graphics.Color; |
| | |
| | | private Integer maxImgHeight = null; |
| | | |
| | | private DisplayImageOptions options; |
| | | |
| | | private Html.ImageGetter imageGetter = new Html.ImageGetter() { |
| | | @Override |
| | | public Drawable getDrawable(String source) { |
| | | try { |
| | | int resId = mContext.getResources().getIdentifier(source, "drawable", mContext.getPackageName()); |
| | | Drawable drawable = mContext.getResources().getDrawable(resId); |
| | | drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); |
| | | return drawable; |
| | | } catch (Exception e) { |
| | | return null; |
| | | } |
| | | } |
| | | }; |
| | | |
| | | |
| | | public SendCircleAdapter(Activity activity, List<HomeBanner> mBannerList, List<SendCircleContent> mContentList, AdapterEventActionListener actionListener) { |
| | |
| | | } |
| | | }); |
| | | |
| | | circleContentHolder.tv_recommend.setMaxLines(6); |
| | | //推荐语赋值 |
| | | circleContentHolder.tv_recommend.setText(circleContent.getTitle()); |
| | | circleContentHolder.tv_recommend.setMaxLines(8); |
| | | |
| | | circleContentHolder.tv_recommend.setText(TextViewUtil.getClickableHtml(Html.fromHtml(circleContent.getTitle(), imageGetter, null), mContext, Color.parseColor("#586b95"))); |
| | | |
| | | |
| | | circleContentHolder.tv_recommend.post(new Runnable() { |
| | | @Override |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | circleContentHolder.tv_recommend.setOnLongClickListener(new View.OnLongClickListener() { |
| | | @Override |
| | | public boolean onLongClick(View v) { |
| | | |
| | | if (adapterEventActionListener != null) |
| | | adapterEventActionListener.copyRecommendText(circleContent); |
| | | |
| | | return false; |
| | | } |
| | | }); |
| | | |
| | |
| | | holder.ll_content.setVisibility(View.VISIBLE); |
| | | String content = comment.getContent(); |
| | | content += "<img src='icon_common_emoji_link' /> <a href='test:http://www.baidu.com'>这是个可以点击的链接</a> 测试12312312123"; |
| | | holder.tv_content.setText(TextViewUtil.getClickableHtml(Html.fromHtml(content, new Html.ImageGetter() { |
| | | @Override |
| | | public Drawable getDrawable(String source) { |
| | | try { |
| | | int resId = context.getResources().getIdentifier(source, "drawable", context.getPackageName()); |
| | | Drawable drawable = context.getResources().getDrawable(resId); |
| | | drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); |
| | | return drawable; |
| | | } catch (Exception e) { |
| | | return null; |
| | | } |
| | | } |
| | | }, null), context, Color.parseColor("#586b95"))); |
| | | holder.tv_content.setText(TextViewUtil.getClickableHtml(Html.fromHtml(content, imageGetter, null), context, Color.parseColor("#586b95"))); |
| | | |
| | | holder.tv_content.setMovementMethod(LinkMovementMethod.getInstance()); |
| | | holder.tv_content.setFocusable(false); |
| | |
| | | } |
| | | }); |
| | | |
| | | holder.tv_content.setOnLongClickListener(new View.OnLongClickListener() { |
| | | @Override |
| | | public boolean onLongClick(View v) { |
| | | commentClickListener.onCopyClick(cposition); |
| | | return false; |
| | | } |
| | | }); |
| | | |
| | | holder.iv_comment_more.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |