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

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

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

TextView.setActivated介绍

暂无

代码示例

代码示例来源:origin: SimonMarquis/Android-PreferencesManager

@Override
  public void onFocusChange(View view, boolean focused) {
    mLabel.setActivated(focused);
  }
});

代码示例来源:origin: com.albedinsky.android/ui-widget-input

/**
 * Invoked whenever focus of the edit text contained within this edit layout has changed.
 * <p>
 * By default this edit layout activates/deactivates here its label view.
 */
protected void onEditFocusChange(boolean focused) {
  if (mLabelView != null) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
      mLabelView.setActivated(focused);
    } else {
      mLabelView.setSelected(focused);
    }
  }
}

代码示例来源:origin: com.albedinsky.android/ui

/**
 * Invoked whenever focus of the edit text contained within this edit layout has changed.
 * <p>
 * By default this edit layout activates/deactivates here its label view.
 */
protected void onEditFocusChange(boolean focused) {
  if (mLabelView != null) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
      mLabelView.setActivated(focused);
    } else {
      mLabelView.setSelected(focused);
    }
  }
}

代码示例来源:origin: yissan/CalendarView

viewHolder.mPriceTv.setText("");
if (i%7==0||i%7==6){
  viewHolder.mTextView.setActivated(true);
}else{
  viewHolder.mTextView.setActivated(false);

代码示例来源:origin: guofudong/EShop

@OnClick({R.id.text_is_hot, R.id.text_most_expensive, R.id.text_cheapest})
void chooseQueryOrder(TextView textView) {
  if (mSearchCall != null) return;
  if (textView.isActivated()) return;
  for (TextView tv : tvOrderList) {
    tv.setActivated(false);
  }
  textView.setActivated(true);
  String sortBy;
  switch (textView.getId()) {
    case R.id.text_is_hot:
      sortBy = Filter.SORT_IS_HOT;
      break;
    case R.id.text_most_expensive:
      sortBy = Filter.SORT_PRICE_DESC;
      break;
    case R.id.text_cheapest:
      sortBy = Filter.SORT_PRICE_ASC;
      break;
    default:
      throw new UnsupportedOperationException();
  }
  mFilter.setSortBy(sortBy);
  mPtrWrapper.autoRefresh();
}

代码示例来源:origin: casific/murmur

viewHolder.likes.setActivated(cursor.getInt(liked_colIndex) == MessageStore.TRUE);
viewHolder.favorite.setActivated(cursor.getInt(favorite_colIndex) == MessageStore.TRUE);

代码示例来源:origin: derry/delion

private void updateLabelVisibility(boolean animate) {
  boolean hasText = !TextUtils.isEmpty(mEditText.getText());
  boolean isFocused = mEditText.isFocused();
  mLabel.setActivated(isFocused);
  if (hasText || isFocused) {
    // We should be showing the label so do so if it isn't already
    if (mLabel.getVisibility() != VISIBLE) {
      showLabel(animate);
    }
  } else {
    // We should not be showing the label so hide it
    if (mLabel.getVisibility() == VISIBLE) {
      hideLabel(animate);
    }
  }
}

代码示例来源:origin: guofudong/EShop

@Override protected void initView() {
  new ToolbarWrapper(this);
  tvOrderList.get(0).setActivated(true);

代码示例来源:origin: geniusgithub/AndroidDialer

/**
 * Returns the text view for the status, creating it if necessary.
 */
public TextView getStatusView() {
  if (mStatusView == null) {
    mStatusView = new TextView(getContext());
    mStatusView.setSingleLine(true);
    mStatusView.setEllipsize(getTextEllipsis());
    mStatusView.setTextAppearance(getContext(), android.R.style.TextAppearance_Small);
    mStatusView.setTextColor(mSecondaryTextColor);
    mStatusView.setActivated(isActivated());
    mStatusView.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START);
    addView(mStatusView);
  }
  return mStatusView;
}

代码示例来源:origin: geniusgithub/AndroidDialer

/**
 * Returns the text view for the contact name, creating it if necessary.
 */
public TextView getNameTextView() {
  if (mNameTextView == null) {
    mNameTextView = new TextView(getContext());
    mNameTextView.setSingleLine(true);
    mNameTextView.setEllipsize(getTextEllipsis());
    mNameTextView.setTextColor(mNameTextViewTextColor);
    mNameTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX,
        mNameTextViewTextSize);
    // Manually call setActivated() since this view may be added after the first
    // setActivated() call toward this whole item view.
    mNameTextView.setActivated(isActivated());
    mNameTextView.setGravity(Gravity.CENTER_VERTICAL);
    mNameTextView.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START);
    mNameTextView.setId(R.id.cliv_name_textview);
    if (CompatUtils.isLollipopCompatible()) {
      mNameTextView.setElegantTextHeight(false);
    }
    addView(mNameTextView);
  }
  return mNameTextView;
}

代码示例来源:origin: geniusgithub/AndroidDialer

/**
 * Returns the text view for the data label, creating it if necessary.
 */
public TextView getLabelView() {
  if (mLabelView == null) {
    mLabelView = new TextView(getContext());
    mLabelView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
        LayoutParams.WRAP_CONTENT));
    mLabelView.setSingleLine(true);
    mLabelView.setEllipsize(getTextEllipsis());
    mLabelView.setTextAppearance(getContext(), R.style.TextAppearanceSmall);
    if (mPhotoPosition == PhotoPosition.LEFT) {
      mLabelView.setAllCaps(true);
    } else {
      mLabelView.setTypeface(mLabelView.getTypeface(), Typeface.BOLD);
    }
    mLabelView.setActivated(isActivated());
    mLabelView.setId(R.id.cliv_label_textview);
    addView(mLabelView);
  }
  return mLabelView;
}

代码示例来源:origin: geniusgithub/AndroidDialer

/**
 * Returns the text view for the phonetic name, creating it if necessary.
 */
public TextView getPhoneticNameTextView() {
  if (mPhoneticNameTextView == null) {
    mPhoneticNameTextView = new TextView(getContext());
    mPhoneticNameTextView.setSingleLine(true);
    mPhoneticNameTextView.setEllipsize(getTextEllipsis());
    mPhoneticNameTextView.setTextAppearance(getContext(), android.R.style.TextAppearance_Small);
    mPhoneticNameTextView.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START);
    mPhoneticNameTextView.setTypeface(mPhoneticNameTextView.getTypeface(), Typeface.BOLD);
    mPhoneticNameTextView.setActivated(isActivated());
    mPhoneticNameTextView.setId(R.id.cliv_phoneticname_textview);
    addView(mPhoneticNameTextView);
  }
  return mPhoneticNameTextView;
}

代码示例来源:origin: geniusgithub/AndroidDialer

/**
 * Returns the text view for the search snippet, creating it if necessary.
 */
public TextView getSnippetView() {
  if (mSnippetView == null) {
    mSnippetView = new TextView(getContext());
    mSnippetView.setSingleLine(true);
    mSnippetView.setEllipsize(getTextEllipsis());
    mSnippetView.setTextAppearance(getContext(), android.R.style.TextAppearance_Small);
    mSnippetView.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START);
    mSnippetView.setActivated(isActivated());
    addView(mSnippetView);
  }
  return mSnippetView;
}

代码示例来源:origin: geniusgithub/AndroidDialer

/**
 * Returns the text view for the data text, creating it if necessary.
 */
public TextView getDataView() {
  if (mDataView == null) {
    mDataView = new TextView(getContext());
    mDataView.setSingleLine(true);
    mDataView.setEllipsize(getTextEllipsis());
    mDataView.setTextAppearance(getContext(), R.style.TextAppearanceSmall);
    mDataView.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START);
    mDataView.setActivated(isActivated());
    mDataView.setId(R.id.cliv_data_view);
    if (CompatUtils.isLollipopCompatible()) {
      mDataView.setElegantTextHeight(false);
    }
    addView(mDataView);
  }
  return mDataView;
}

相关文章

TextView类方法