I think I found a solution. I will accept this as an answer if others give thumbs up.
I found the configuration options described in Support for multiple screens works not only for res/drawable and res/layout , but also for res/values . So, on my layout/some_layout.xml , I say this:
<ImageButton android:id="@+id/imagePlay" android:layout_width="@dimen/button_size" android:layout_height="@dimen/button_size" android:scaleType="fitCenter" android:src="@drawable/play" />
Then, in the values/layout.xml you define the default value of button_size :
<resources> <dimen name="button_size">44dp</dimen> </resources>
And in the values-xlarge/layout.xml you define the button_size mode:
<resources> <dimen name="button_size">66dp</dimen> </resources>
I have not tried other values resources, but I believe that it also works for Styles and Themes , so in case your layout setting is slightly larger than size or weight, you can define the style in the values ββand use it.
source share