本文整理了Java中android.widget.TextView.setLinkTextColor()
方法的一些代码示例,展示了TextView.setLinkTextColor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.setLinkTextColor()
方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:setLinkTextColor
暂无
代码示例来源:origin: aa112901/remusic
private void applySupportTextLinkColorTint() {
if (mTextLinkColorTintInfo != null && mTextLinkColorTintInfo.mHasTintList) {
((TextView) mView).setLinkTextColor(mTextLinkColorTintInfo.mTintList);
}
}
代码示例来源:origin: rey5137/material
v.setLinkTextColor(appearance.getColorStateList(attr));
代码示例来源:origin: rey5137/material
v.setLinkTextColor(appearance.getColorStateList(attr));
v.setLinkTextColor(a.getColorStateList(attr));
代码示例来源:origin: GeekGhost/Ghost
public static void applyTextLinkColor(ColorUiInterface ci, Resources.Theme theme, int paramInt) {
TypedArray ta = theme.obtainStyledAttributes(new int[]{paramInt});
int resourceId = ta.getColor(0, 0);
if (null != ci && ci instanceof TextView) {
((TextView) ci.getView()).setLinkTextColor(resourceId);
}
ta.recycle();
}
代码示例来源:origin: dongjunkun/GanK
public static void applyTextLinkColor(ColorUiInterface ci, Resources.Theme theme, int paramInt) {
TypedArray ta = theme.obtainStyledAttributes(new int[]{paramInt});
int resourceId = ta.getColor(0, 0);
if (null != ci && ci instanceof TextView) {
((TextView) ci.getView()).setLinkTextColor(resourceId);
}
ta.recycle();
}
代码示例来源:origin: stackoverflow.com
void setLinks(TextView tv, String text) {
String[] linkPatterns = {
"([Hh][tT][tT][pP][sS]?:\\/\\/[^ ,'\">\\]\\)]*[^\\. ,'\">\\]\\)])",
"#[\\w]+", "@[\\w]+" };
for (String str : linkPatterns) {
Pattern pattern = Pattern.compile(str);
Matcher matcher = pattern.matcher(tv.getText());
while (matcher.find()) {
int x = matcher.start();
int y = matcher.end();
final android.text.SpannableString f = new android.text.SpannableString(
tv.getText());
InternalURLSpan span = new InternalURLSpan();
span.text = text.substring(x, y);
f.setSpan(span, x, y,
android.text.Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
tv.setText(f);
// tv.setOnLongClickListener(span.l);
}
}
tv.setLinkTextColor(Color.BLUE);
tv.setLinksClickable(true);
tv.setMovementMethod(LinkMovementMethod.getInstance());
tv.setFocusable(false);
}
代码示例来源:origin: dongjunkun/GanK
mImage.setVisibility(View.GONE);
mText.setVisibility(View.VISIBLE);
mText.setLinkTextColor(ThemeUtils.getThemeColor(getActivity(),R.attr.colorPrimary));
mText.setText(Html.fromHtml("<a href=\""
+ ganHuo.getUrl() + "\">"
代码示例来源:origin: flipkart-incubator/proteus
@Override
public void setColor(T view, int color) {
view.setLinkTextColor(color);
}
代码示例来源:origin: flipkart-incubator/proteus
@Override
public void setColor(T view, ColorStateList colors) {
view.setLinkTextColor(colors);
}
});
代码示例来源:origin: stackoverflow.com
TextView email = (TextView)findViewById(R.id.TextView04);
email.setText("sadasd asmn@gmail.com");
email.setLinkTextColor(Color.WHITE);
Linkify.addLinks(email,Linkify.EMAIL_ADDRESSES);
代码示例来源:origin: stackoverflow.com
TextView tv = (TextView)findViewById(R.id.TextView04);
tv.setText("sasd https://asd.com sadasd");
tv.setLinkTextColor(Color.WHITE);
Linkify.addLinks(tv,Linkify.WEB_URLS);
代码示例来源:origin: stackoverflow.com
TextView email = (TextView)findViewById(R.id.TextView04);
email.setText("sasd asd@gmai.com sadasd");
email.setLinkTextColor(Color.WHITE);
Linkify.addLinks(email,Linkify.EMAIL_ADDRESSES);
代码示例来源:origin: stackoverflow.com
String text = "Visit stackoverflow.com";
TextView label = new TextView(this);
label.setText(text);
Pattern pattern = Pattern.compile("stackoverflow.com");
Linkify.addLinks(label, pattern, "http://");
label.setLinkTextColor(Color.CYAN);
代码示例来源:origin: coding-blocks/GSoC-Info-Android
@Override
public void onBindViewHolder(final FaqHolder holder, int position) {
holder.question.setText(questions.get(position));
holder.answer.setVisibility(GONE);
holder.answer.setText(Html.fromHtml(answers.get(position)));
holder.answer.setClickable(true);
holder.answer.setMovementMethod(LinkMovementMethod.getInstance());
holder.answer.setLinkTextColor(context.getResources().getColor(R.color.colorPrimary));
}
代码示例来源:origin: ywwynm/EverythingDone
@SuppressLint("SetTextI18n")
@Override
public void onBindViewHolder(Holder holder, int position) {
License license = mItems.get(position);
holder.tvName.setText(license.name);
holder.tvLink.setText(license.link);
holder.tvLink.setLinkTextColor(mLinkColor);
String copyRight = license.copyRight;
if (!copyRight.isEmpty()) {
copyRight += "\n\n";
}
holder.tvContent.setText(copyRight + license.getContent());
}
代码示例来源:origin: stackoverflow.com
TextView text = (TextView) findViewById(R.id.textView1);
text.settext("Your text with url");
text.setLinkTextColor(Color.BLUE); // color whatever u want
Linkify.addLinks(text, Linkify.ALL);
代码示例来源:origin: stackoverflow.com
TextView text = (TextView) findViewById(R.id.textView1);
text.settext("Your text with url means your text value");// text having url
text.setLinkTextColor(Color.BLUE); // color whatever u want
Linkify.addLinks(text, Linkify.ALL);
代码示例来源:origin: googlesamples/android-unsplash
@Override
public void onAnimationEnd(Animator animation) {
textView.getOverlay().remove(drawable);
textView.setTextColor(textColors);
textView.setHintTextColor(hintColors);
textView.setHighlightColor(highlightColor);
textView.setLinkTextColor(linkColors);
}
代码示例来源:origin: DroidsOnRoids/Workcation
@Override
public void onAnimationEnd(Animator animation) {
textView.getOverlay().remove(drawable);
textView.setTextColor(textColors);
textView.setHintTextColor(hintColors);
textView.setHighlightColor(highlightColor);
textView.setLinkTextColor(linkColors);
}
代码示例来源:origin: layerhq/Atlas-Android
@Override
public CellHolder createCellHolder(ViewGroup cellView, boolean isMe, LayoutInflater layoutInflater) {
View v = layoutInflater.inflate(R.layout.atlas_message_item_cell_text, cellView, true);
v.setBackgroundResource(isMe ? R.drawable.atlas_message_item_cell_me : R.drawable.atlas_message_item_cell_them);
((GradientDrawable) v.getBackground()).setColor(isMe ? mMessageStyle.getMyBubbleColor() : mMessageStyle.getOtherBubbleColor());
TextView t = (TextView) v.findViewById(R.id.cell_text);
t.setTextSize(TypedValue.COMPLEX_UNIT_PX, isMe ? mMessageStyle.getMyTextSize() : mMessageStyle.getOtherTextSize());
t.setTextColor(isMe ? mMessageStyle.getMyTextColor() : mMessageStyle.getOtherTextColor());
t.setLinkTextColor(isMe ? mMessageStyle.getMyTextColor() : mMessageStyle.getOtherTextColor());
t.setTypeface(isMe ? mMessageStyle.getMyTextTypeface() : mMessageStyle.getOtherTextTypeface(), isMe ? mMessageStyle.getMyTextStyle() : mMessageStyle.getOtherTextStyle());
return new CellHolder(v);
}
内容来源于网络,如有侵权,请联系作者删除!