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

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

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

TextView.getCompoundDrawablesRelative介绍

暂无

代码示例

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

public static Drawable[] getCompoundDrawablesRelative(TextView view) {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) return null;
    return view.getCompoundDrawablesRelative();
  }
}

代码示例来源:origin: rey5137/material

Drawable[] drawables = v.getCompoundDrawablesRelative();
if (drawableStart != null)
  drawables[0] = drawableStart;

代码示例来源:origin: ribot/ribot-app-android

@Override
protected boolean matchesSafely(View view) {
  if (view instanceof TextView) {
    TextView textView = (TextView) view;
    Drawable[] drawables = textView.getCompoundDrawablesRelative();
    boolean hasStart = drawables[0] != null;
    boolean hastTop = drawables[1] != null;
    boolean hasEnd = drawables[2] != null;
    boolean hasBottom = drawables[3] != null;
    return start == hasStart &&
        top == hastTop &&
        end == hasEnd &&
        bottom == hasBottom;
  }
  return false;
}

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

/**
 * <b>Note, that on pre {@link android.os.Build.VERSION_CODES#LOLLIPOP LOLLIPOP} Android versions
 * this method will return array containing instances of {@link TintDrawable TintDrawable} (if any)
 * if compound drawable tint has been applied via {@link #setCompoundDrawableTintList(ColorStateList)}.</b>
 * <p>
 * The original wrapped drawables can be obtained via {@link TintDrawable#getDrawable()}.
 */
@NonNull
@Override
public Drawable[] getCompoundDrawablesRelative() {
  return super.getCompoundDrawablesRelative();
}

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

/**
 * <b>Note, that on pre {@link android.os.Build.VERSION_CODES#LOLLIPOP LOLLIPOP} Android versions
 * this method will return array containing instances of {@link TintDrawable TintDrawable} (if any)
 * if compound drawable tint has been applied via {@link #setCompoundDrawableTintList(ColorStateList)}.</b>
 * <p>
 * The original wrapped drawables can be obtained via {@link TintDrawable#getDrawable()}.
 */
@NonNull
@Override
public Drawable[] getCompoundDrawablesRelative() {
  return super.getCompoundDrawablesRelative();
}

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

/**
 * <b>Note, that on pre {@link android.os.Build.VERSION_CODES#LOLLIPOP LOLLIPOP} Android versions
 * this method will return array containing instances of {@link TintDrawable TintDrawable} (if any)
 * if compound drawable tint has been applied via {@link #setCompoundDrawableTintList(ColorStateList)}.</b>
 * <p>
 * The original wrapped drawables can be obtained via {@link TintDrawable#getDrawable()}.
 */
@NonNull
@Override
public Drawable[] getCompoundDrawablesRelative() {
  return super.getCompoundDrawablesRelative();
}

代码示例来源:origin: NordicSemiconductor/Android-nRF-Beacon

@Override
  public View getView(int position, View convertView, ViewGroup parent) {
    View view = convertView;
    if (view == null) {
      view = mInflater.inflate(R.layout.app_file_browser_item, parent, false);
    }

    final TextView item = (TextView) view;
    item.setText(mResources.getStringArray(R.array.dfu_app_file_browser)[position]);
    item.getCompoundDrawablesRelative()[0].setLevel(position);
    return view;
  }
}

代码示例来源:origin: NordicSemiconductor/Android-nRF-Toolbox

@Override
  public View getView(int position, View convertView, ViewGroup parent) {
    View view = convertView;
    if (view == null) {
      view = mInflater.inflate(R.layout.app_file_browser_item, parent, false);
    }

    final TextView item = (TextView) view;
    item.setText(mResources.getStringArray(R.array.dfu_app_file_browser)[position]);
    item.getCompoundDrawablesRelative()[0].setLevel(position);
    return view;
  }
}

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

Drawable[] compoundDrawablesRelative = tv.getCompoundDrawablesRelative();
if (compoundDrawablesRelative != null && compoundDrawablesRelative.length >= 4) {
  values.put("CompoundDrawableRelativeStart:", String.valueOf(tv.getCompoundDrawablesRelative()[0]));
  values.put("CompoundDrawableRelativeTop:", String.valueOf(tv.getCompoundDrawablesRelative()[1]));
  values.put("CompoundDrawableRelativeEnd:", String.valueOf(tv.getCompoundDrawablesRelative()[2]));
  values.put("CompoundDrawableRelativeBottom:", String.valueOf(tv.getCompoundDrawablesRelative()[3]));

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

final Drawable[] relativeDrawables = mWidget.getCompoundDrawablesRelative();
if (tintCompoundDrawables(tintInfo, relativeDrawables, drawableState)) {
  superSetCompoundDrawablesRelative(

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

final Drawable[] relativeDrawables = mWidget.getCompoundDrawablesRelative();
if (tintCompoundDrawables(tintInfo, relativeDrawables, drawableState)) {
  superSetCompoundDrawablesRelative(

相关文章

微信公众号

最新文章

更多

TextView类方法