android - ImageView: Drawable and padding? -


i wrote custom drawable , display in imageview.

if add padding imageview, drawable overdraw padding , fills complete image view.

what in drawable is:

@override public void setbounds(int left, int top, int right, int bottom) {     super.setbounds(left, top, right, bottom);      rect r = new rect();      getpadding(r);      log.d("test", "padding " + r.toshortstring());      mwidth = right - left;     mheight = bottom - top;  } 

and in drawables draw method draw bitmap fill mwidth , mheight.

so how take padding count? getpadding(r); returns 0,0,0,0 values if imageview has padding.

any idea how fix that?

getpadding() can called after imageview has been loaded. add viewtreeobserver padding after imageview has been loaded.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

IIS->Tomcat Redirect: multiple worker with default -