android.widget.TextView.getLinksClickable()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(188)

本文整理了Java中android.widget.TextView.getLinksClickable()方法的一些代码示例,展示了TextView.getLinksClickable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.getLinksClickable()方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:getLinksClickable

TextView.getLinksClickable介绍

暂无

代码示例

代码示例来源:origin: robolectric/robolectric

@Test
public void testLinksClickable() {
 assertThat(textView.getLinksClickable()).isTrue();
 textView.setLinksClickable(false);
 assertThat(textView.getLinksClickable()).isFalse();
 textView.setLinksClickable(true);
 assertThat(textView.getLinksClickable()).isTrue();
}

代码示例来源:origin: stackoverflow.com

private static final void addLinkMovementMethod(TextView t) {
  MovementMethod m = t.getMovementMethod();

  if ((m == null) || !(m instanceof LocalLinkMovementMethod)) {
    if (t.getLinksClickable()) {
      t.setMovementMethod(LocalLinkMovementMethod.getInstance());
    }
  }
}

代码示例来源:origin: stackoverflow.com

private void addLinkMovementMethod(TextView t) {
  MovementMethod m = t.getMovementMethod();

  if ((m == null) || !(m instanceof LinkMovementMethod)) {
    if (t.getLinksClickable()) {
      t.setMovementMethod(LinkMovementMethod.getInstance());
    }
  }
}

代码示例来源:origin: stackoverflow.com

private void addLinks(TextView textView, Pattern pattern) {
  SpannableString spannable = SpannableString.valueOf(textView.getText());
  Matcher matcher = pattern.matcher(spannable);

  // Create ActivitySpans for each match
  while (matcher.find())
    spannable.setSpan(new ActivitySpan(matcher.group()), matcher.start(), matcher.end(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

  // Set new spans in TextView
  textView.setText(spannable);

  // Listen for spannable clicks, if not already
  MovementMethod m = textView.getMovementMethod();
  if ((m == null) || !(m instanceof LinkMovementMethod)) {
    if (textView.getLinksClickable()) {
      textView.setMovementMethod(LinkMovementMethod.getInstance());
    }
  }
}

代码示例来源:origin: andforce/iBeebo

public static void addLinks(TextView view) {
  CharSequence content = view.getText();
  view.setText(convertNormalStringToSpannableString(content.toString()));
  if (view.getLinksClickable()) {
    view.setMovementMethod(LongClickableLinkMovementMethod.getInstance());
  }
}

代码示例来源:origin: stackoverflow.com

if ((m == null) || !(m instanceof LinkMovementMethod))
  if (link.getLinksClickable())

代码示例来源:origin: stackoverflow.com

MovementMethod m = tv.getMovementMethod();  
if ((m == null) || !(m instanceof LinkMovementMethod)) {  
  if (tv.getLinksClickable()) {  
    tv.setMovementMethod(LinkMovementMethod.getInstance());

代码示例来源:origin: stackoverflow.com

if (textView.getLinksClickable()) {
  textView.setMovementMethod(LinkMovementMethod.getInstance());

代码示例来源:origin: jbruchanov/AnUitor

values.put("TextColor", getStringColor(tv.getCurrentTextColor()));
values.put("HintTextColor", getStringColor(tv.getCurrentHintTextColor()));
values.put("LinksClickable", tv.getLinksClickable());
values.put("MovementMethod", String.valueOf(tv.getMovementMethod()));
values.put("Gravity", translator.gravity(tv.getGravity()));

代码示例来源:origin: stackoverflow.com

MovementMethod m = tv.getMovementMethod();
if ((m == null) || !(m instanceof LinkMovementMethod)) {
  if (tv.getLinksClickable()) {
    tv.setMovementMethod(LinkMovementMethod.getInstance());

相关文章

TextView类方法