Users of my Android app report that the included app widget is too big.
I've used this formula:
width/height = (number-of-cells * 74) - 2
So I got 294dp width and 72dp height for a 4x1 widget. But, as I've said, users report that the widget takes more place than 4x1.
How can this happen? Does it differ with different Android versions?
Edit: I've set this as the minimum width/height and the resize width/height. My layout file for this appwidget uses fill_parent
so it should not extend that size.
This documentation page (relevant for Android 4.x, I suppose) shows that the formula is:
width/height = `70 * n - 30`
... where n
is the number of cells taken. It also mentions that...
When your widget is added, it will be stretched to occupy the minimum number of cells, horizontally and vertically, required to satisfy its minWidth and minHeight constraints
Based on the dimensions given in the question, your application would stretch to 5 cells (320dp; 250dp is not enough) width-wise and 2 cells (110dp; 40dp is not enough) height-wise.