public static Drawable[] getCompoundDrawablesRelative(TextView view) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) return null; return view.getCompoundDrawablesRelative(); } }
Drawable[] drawables = v.getCompoundDrawablesRelative(); if (drawableStart != null) drawables[0] = drawableStart;
@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; }
/** * <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(); }
/** * <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(); }
/** * <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(); }
@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; } }
@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; } }
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]));
final Drawable[] relativeDrawables = mWidget.getCompoundDrawablesRelative(); if (tintCompoundDrawables(tintInfo, relativeDrawables, drawableState)) { superSetCompoundDrawablesRelative(
final Drawable[] relativeDrawables = mWidget.getCompoundDrawablesRelative(); if (tintCompoundDrawables(tintInfo, relativeDrawables, drawableState)) { superSetCompoundDrawablesRelative(