You get and set the size in pixels. When the minWidth attribute minWidth inflated from XML, it is converted to a pixel dimension from its size:
from View.java:
case R.styleable.View_minWidth: mMinWidth = a.getDimensionPixelSize(attr, 0);
source share