I need to make a 4x1 cell widget. For this, I use simple code:
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minWidth="250dp" android:minHeight="40dip" android:updatePeriodMillis="0" android:initialLayout="@layout/widget" android:configure="ru.bartwell.myapp.WidgetActivity" /> I am testing it on two Genymotion virtual devices:
- Google Nexus 7, 800x1280, Android
- 4.4.4 Samsung Galaxy S5, 1080x1920, Android 4.4.4
And I get two different results:
With android: minWidth = "250dp" and android: minHeight = "40dip" (new formula):
- Google Nexus 7 - 3x1
- Samsung Galaxy S5 - 4x1
With android: minWidth = "292dp" and android: minHeight = "70dip" (old formula):
- Google Nexus 7 - 4x1
- Samsung Galaxy S5 - 4x2
As you can see, the size of the widget depends on the screen resolution and in any case is calculated incorrectly (either 3x1 or 4x2). So how to set the size of the widget?
40dipordpis this an accident typo? Widget job description - androschuk