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

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

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

TextView.setClickable介绍

暂无

代码示例

代码示例来源:origin: TommyLemon/APIJSON

@Override
  public void onTick(long millisUntilFinished){//计时过程显示
    btnPasswordGetVerify.setClickable(false);
    btnPasswordGetVerify.setText((millisUntilFinished / 1000) +"秒");
  }
}

代码示例来源:origin: TommyLemon/APIJSON

@Override
public void onFinish() {//计时完毕时触发
  btnPasswordGetVerify.setText("重新获取");
  btnPasswordGetVerify.setClickable(true);
}
@Override

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

TextView textView =(TextView)findViewById(R.id.textView);
textView.setClickable(true);
textView.setMovementMethod(LinkMovementMethod.getInstance());
String text = "<a href='http://www.google.com'> Google </a>";
textView.setText(Html.fromHtml(text));

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

TextView tv1 = new TextView(this);
tv1.setLayoutParams(textOutLayoutParams);
tv1.setText(Html.fromHtml("<a href=\""+ l.getRightString() + "\">" + l.getLeftString() + "</a>"));
tv1.setClickable(true);
tv1.setMovementMethod (LinkMovementMethod.getInstance());
dialogLayout.addView(tv1);

代码示例来源:origin: wangdan/AisenWeiBo

public void bindOnTouchListener(TextView textView) {
  textView.setClickable(false);
  textView.setOnTouchListener(onTouchListener);
}

代码示例来源:origin: nickbutcher/plaid

/**
 * Work around some 'features' of TextView and URLSpans. i.e. vanilla URLSpans do not react to
 * touch so we replace them with our own {@link TouchableUrlSpan}
 * & {@link LinkTouchMovementMethod} to fix this.
 * <p/>
 * Setting a custom MovementMethod on a TextView also alters touch handling (see
 * TextView#fixFocusableAndClickableSettings) so we need to correct this.
 */
public static void setTextWithNiceLinks(TextView textView, CharSequence input) {
  textView.setText(input);
  textView.setMovementMethod(LinkTouchMovementMethod.getInstance());
  textView.setFocusable(false);
  textView.setClickable(false);
  textView.setLongClickable(false);
}

代码示例来源:origin: TeamNewPipe/NewPipe

@Override
public void onUpdateProgress(int currentProgress, int duration, int bufferPercent) {
  if (!isPrepared()) return;
  if (duration != playbackSeekBar.getMax()) {
    playbackEndTime.setText(getTimeString(duration));
    playbackSeekBar.setMax(duration);
  }
  if (currentState != STATE_PAUSED) {
    if (currentState != STATE_PAUSED_SEEK) playbackSeekBar.setProgress(currentProgress);
    playbackCurrentTime.setText(getTimeString(currentProgress));
  }
  if (simpleExoPlayer.isLoading() || bufferPercent > 90) {
    playbackSeekBar.setSecondaryProgress((int) (playbackSeekBar.getMax() * ((float) bufferPercent / 100)));
  }
  if (DEBUG && bufferPercent % 20 == 0) { //Limit log
    Log.d(TAG, "updateProgress() called with: isVisible = " + isControlsVisible() + ", currentProgress = [" + currentProgress + "], duration = [" + duration + "], bufferPercent = [" + bufferPercent + "]");
  }
  playbackLiveSync.setClickable(!isLiveEdge());
}

代码示例来源:origin: TeamNewPipe/NewPipe

@Override
public void onProgressUpdate(int currentProgress, int duration, int bufferPercent) {
  // Set buffer progress
  progressSeekBar.setSecondaryProgress((int) (progressSeekBar.getMax() * ((float) bufferPercent / 100)));
  // Set Duration
  progressSeekBar.setMax(duration);
  progressEndTime.setText(Localization.getDurationString(duration / 1000));
  // Set current time if not seeking
  if (!seeking) {
    progressSeekBar.setProgress(currentProgress);
    progressCurrentTime.setText(Localization.getDurationString(currentProgress / 1000));
  }
  if (player != null) {
    progressLiveSync.setClickable(!player.isLiveEdge());
  }
  // this will make shure progressCurrentTime has the same width as progressEndTime
  final ViewGroup.LayoutParams endTimeParams = progressEndTime.getLayoutParams();
  final ViewGroup.LayoutParams currentTimeParams = progressCurrentTime.getLayoutParams();
  currentTimeParams.width = progressEndTime.getWidth();
  progressCurrentTime.setLayoutParams(currentTimeParams);
}

代码示例来源:origin: Bearded-Hen/Android-Bootstrap

childView.setText(text.replaceFirst(REPLACE_REGEX_HEADER, ""));
childView.setTextSize((baselineDropDownViewFontSize - 2F) * bootstrapSize);
childView.setClickable(false);
childView.setTextColor(ColorUtils.resolveColor(R.color.bootstrap_gray_light,
                        getContext()));
childView.setClickable(false);
childView.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 3));

代码示例来源:origin: DaxiaK/MyDiary

private TextView buildTextLayout(final String character) {
  sortTextList.add(character);
  LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, 1);
  TextView sortTextView = new TextView(mContext);
  sortTextView.setLayoutParams(layoutParams);
  sortTextView.setGravity(Gravity.CENTER);
  sortTextView.setClickable(true);
  sortTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13);
  sortTextView.setText(character);
  sortTextView.setTextColor(ColorTools.getColor(getContext(), R.color.contacts_latter_text));
  sortTextView.setShadowLayer(1, 1, 1, R.color.contacts_latter_text_shadow);
  return sortTextView;
}

代码示例来源:origin: TakWolf/CNode-Material-Design

tvText.setVisibility(View.INVISIBLE);
  tvText.setText(null);
  tvText.setClickable(false);
  break;
case STATE_LOADING:
  tvText.setVisibility(View.INVISIBLE);
  tvText.setText(null);
  tvText.setClickable(false);
  break;
case STATE_FINISHED:
  tvText.setVisibility(View.VISIBLE);
  tvText.setText(R.string.load_more_finished);
  tvText.setClickable(false);
  break;
case STATE_ENDLESS:
  tvText.setVisibility(View.VISIBLE);
  tvText.setText(null);
  tvText.setClickable(true);
  break;
case STATE_FAILED:
  tvText.setVisibility(View.VISIBLE);
  tvText.setText(R.string.load_more_failed);
  tvText.setClickable(true);
  break;
default:

代码示例来源:origin: JavaNoober/BackgroundLibrary

.build();
TextView tvTest1 = findViewById(R.id.tvTest1);
tvTest1.setClickable(true);
ColorStateList colors = new DrawableCreator.Builder().setPressedTextColor(Color.RED).setUnPressedTextColor(Color.BLUE).buildTextColor();
tvTest1.setTextColor(colors);
    .setUnPressedDrawable(ContextCompat.getDrawable(this, R.drawable.circle_like_normal))
    .build();
tvTest4.setClickable(true);
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN){
  tvTest4.setBackground(drawable4);

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

private void bindOnTouchListener(DMViewHolder holder) {
  holder.username.setClickable(false);
  holder.time.setClickable(false);
  holder.content.setClickable(false);
  if (holder.content != null) {
    holder.content.setOnTouchListener(onTouchListener);
  }
}

代码示例来源:origin: zsoltk/GameOfLife

protected void initInfo() {
  info.setClickable(true);
  info.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      uiHelper.showInfoDialog();
    }
  });
}

代码示例来源:origin: openMF/mobile-wallet

@Override
public void showVpa(String vpa) {
  this.vpa = vpa;
  tvClientVpa.setText(vpa);
  btnShowQr.setClickable(true);
}

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

textView.setText(text);
textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.START);
textView.setClickable(false);
textView.setFocusable(false);
textView.setFocusableInTouchMode(false);

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

public static void setTextViewLinkClickable(TextView textView) {
  textView.setMovementMethod(ClickableMovementMethod.getInstance());
  // Reset for TextView.fixFocusableAndClickableSettings(). We don't want View.onTouchEvent()
  // to consume touch events.
  textView.setClickable(false);
  textView.setLongClickable(false);
}

代码示例来源:origin: SiberiaDante/TitleLayout

/**
 * 设置右侧文字是否可以点击
 */
public void setRightTextClickable(boolean isClickable) {
  mTvRight.setClickable(isClickable);
  mTvRight.setFocusable(isClickable);
}

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

private void bindOnTouchListener(ViewHolder holder) {
  holder.listview_root.setClickable(false);
  holder.username.setClickable(false);
  holder.time.setClickable(false);
  holder.weiboTextContent.setClickable(false);
  if (holder.weiboTextContent != null) {
    holder.weiboTextContent.setOnTouchListener(onTouchListener);
  }
}

代码示例来源:origin: donkingliang/LabelsView

/**
 * 确保标签是否能响应事件,如果标签可选或者标签设置了点击事件监听,则响应事件。
 */
private void ensureLabelClickable() {
  int count = getChildCount();
  for (int i = 0; i < count; i++) {
    TextView label = (TextView) getChildAt(i);
    label.setClickable(mLabelClickListener != null || mSelectType != SelectType.NONE);
  }
}

相关文章

TextView类方法