@android.databinding.BindingAdapter(android:src)

Here are the examples of the java api @android.databinding.BindingAdapter(android:src) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

7 Examples 7

19 Source : DataBindingAdapters.java
with Apache License 2.0
from openid

/**
 * Facilitates loading images into an ImageView using Glide, by binding a string URI.
 */
@BindingAdapter("android:src")
public static void setImageUri(ImageView view, String imageUri) {
    GlideApp.with(view).load(imageUri).fitCenter().into(view);
}

19 Source : LayerBindingAdapters.java
with Apache License 2.0
from google

/**
 * Binding adapter for converting a drawable resource ID to a drawable that can be set as the
 * image drawable of the preplaceded ImageView
 * @param view
 * @param resId
 */
@BindingAdapter("android:src")
public static void setImage(ImageView view, int resId) {
    Drawable d = view.getContext().getDrawable(resId);
    view.setImageDrawable(d);
}

19 Source : ImageViewAdapters.java
with Apache License 2.0
from ArturVasilov

@BindingAdapter("android:src")
public static void setImageUrl(@NonNull ImageView imageView, @NonNull String url) {
    if (TextUtils.isEmpty(url)) {
        return;
    }
    Picreplacedo.with(DayPictureApp.getAppContext()).load(url).noFade().into(imageView);
}

18 Source : BindingAdapters.java
with Apache License 2.0
from y1xian

@BindingAdapter("android:src")
public static void setSrc(ImageView view, Bitmap bitmap) {
    view.setImageBitmap(bitmap);
}

18 Source : BindingAdapters.java
with Apache License 2.0
from y1xian

@BindingAdapter("android:src")
public static void setSrc(ImageView view, int resId) {
    view.setImageResource(resId);
}

18 Source : DataBindingUtils.java
with GNU General Public License v3.0
from TeamWalrus

@BindingAdapter("android:src")
public static void setImageViewResource(ImageView imageView, @DrawableRes int drawableId) {
    imageView.setImageResource(drawableId);
}

18 Source : ImageViewAdapters.java
with Apache License 2.0
from ArturVasilov

@BindingAdapter("android:src")
public static void setImageResource(@NonNull ImageView imageView, @DrawableRes int resource) {
    imageView.setImageResource(resource);
}