private Drawable ResolveResource() { var rsrc = Resources; if (rsrc != null) { if (_resource != 0) { try { var d = ContextCompat.GetDrawable(Context, _resource); return(RoundedDrawable.FromDrawable(d)); } catch (Exception e) { Log.Warn(Tag, "Unable to find resource: " + _resource, e); // Don't try again. _resource = 0; } } } return(null); }
public override void SetImageBitmap(Bitmap bm) { _resource = 0; _drawable = RoundedDrawable.FromBitmap(bm); UpdateDrawableAttrs(); base.SetImageDrawable(_drawable); }
public override void SetImageDrawable(Drawable drawable) { _resource = 0; _drawable = RoundedDrawable.FromDrawable(drawable); UpdateDrawableAttrs(); base.SetImageDrawable(drawable); }
private void UpdateBackgroundDrawableAttrs(bool convert) { if (_mutateBackground) { if (convert) { _backgroundDrawable = RoundedDrawable.FromDrawable(_backgroundDrawable); } UpdateAttrs(_backgroundDrawable); } }