I'm creating a 1x1 Android widget. I have designed images for each screen density as follows:
ldpi (120 DPI) = 72 * (120 / 160) == 54 x 54 pixels
mdpi (160 DPI) = 72 * (160 / 160) == 72 x 72 pixels
hdpi (240 DPI) = 72 * (240 / 160) == 108 x 108 pixels
xhdpi (320 DPI) = 72 * (320 / 160) == 144 x 144 pixels
My widget specification:
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="72dip"
android:minHeight="72dip"
android:updatePeriodMillis="1000"
android:initialLayout="@layout/widget">
</appwidget-provider>
On WVGA800 screens (hdpi), the widget is 1x1. On WXGA800 screens (mdpi), the widget is 1x1. On WXGA720 screens (xhdpi), the widget is 2x2.
Can someone point me in the direction of what is wrong here?
Before Android 4.0: (n * 74dip) - 2dip http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html
Android 4.0: 70 × n − 30 http://developer.android.com/guide/practices/ui_guidelines/widget_design.html#anatomy
There's also padding that is automatically added when android:targetSdkVersion="14 or higher" is set.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With