butterknife.BindDrawable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of butterknife-annotations Show documentation
Show all versions of butterknife-annotations Show documentation
Field and method binding for Android views.
The newest version!
package butterknife;
import androidx.annotation.AttrRes;
import androidx.annotation.DrawableRes;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static butterknife.internal.Constants.NO_RES_ID;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Bind a field to the specified drawable resource ID.
*
* {@literal @}BindDrawable(R.drawable.placeholder)
* Drawable placeholder;
* {@literal @}BindDrawable(value = R.drawable.placeholder, tint = R.attr.colorAccent)
* Drawable tintedPlaceholder;
*
*/
@Target(FIELD)
@Retention(RUNTIME)
public @interface BindDrawable {
/** Drawable resource ID to which the field will be bound. */
@DrawableRes int value();
/** Color attribute resource ID that is used to tint the drawable. */
@AttrRes int tint() default NO_RES_ID;
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy