I am new to Android development and I am currently working on supporting different screen sizes and pixel densities for my app. Now, I have a button with the height @dimen/button_height
.
In dimens.xml
I have the following resource:
<resources>
<dimen name="button_height">55dp</dimen>
</resources>
Now, I tried the app on different screen sizes and noticed, that, for example, on 3.3" WQVGA, the button is too big. This device is 240x400 px ldpi
, which is, 320x533 dp
.
I read App resources overview and Support different Screen Sizes (I have to say that to me it is still not 100% clear how to support every devices configurations). According to that, the screen-size
of this device is small
, so I made another resource file dimens.xml (small)
with
<resources>
<dimen name="button_height">30dp</dimen>
</resources>
Now, when I try this on the emulator, the button is still 55dp
high. So, what did I understand wrong? What would be a better approach to support smaller devices?