@Override protected void setResource(@Nullable T resource) { ViewGroup.LayoutParams layoutParams = view.getLayoutParams(); Drawable result = getDrawable(resource); if (layoutParams != null && layoutParams.width > 0 && layoutParams.height > 0) { result = new FixedSizeDrawable(result, layoutParams.width, layoutParams.height); } view.setImageDrawable(result); }
@Override public void setBounds(int left, int top, int right, int bottom) { super.setBounds(left, top, right, bottom); bounds.set(left, top, right, bottom); updateMatrix(); }
@NonNull @Override public Drawable newDrawable() { return new FixedSizeDrawable(this, wrapped.newDrawable()); }
@Override public void setBounds(@NonNull Rect bounds) { super.setBounds(bounds); this.bounds.set(bounds); updateMatrix(); }
@NonNull @Override public Drawable newDrawable(Resources res) { return new FixedSizeDrawable(this, wrapped.newDrawable(res)); }
@Override public void setBounds(int left, int top, int right, int bottom) { super.setBounds(left, top, right, bottom); bounds.set(left, top, right, bottom); updateMatrix(); }
@Override public Drawable newDrawable() { return new FixedSizeDrawable(this, wrapped.newDrawable()); }
@Override public void setBounds(Rect bounds) { super.setBounds(bounds); this.bounds.set(bounds); updateMatrix(); }
@Override protected void setResource(@Nullable T resource) { ViewGroup.LayoutParams layoutParams = view.getLayoutParams(); Drawable result = getDrawable(resource); if (layoutParams != null && layoutParams.width > 0 && layoutParams.height > 0) { result = new FixedSizeDrawable(result, layoutParams.width, layoutParams.height); } view.setImageDrawable(result); }
@Override public Drawable newDrawable(Resources res) { return new FixedSizeDrawable(this, wrapped.newDrawable(res)); }