vikifor
vikifor

Reputation: 3466

set minHeight and minWidth android AppWidget programatically

Is it possible to find on AppWidget creation what is max number of cells that can occupy AppWidget. I read from documentation that usually AppWidgets in handsets can occupy 4x4 cells, so I set minHeight and minWidth:

android:minHeight="320dip" android:minWidth="320dip"

However I test it my application on LG G4 H815 and I found out that the device has 5x5 cell grid. So my question is is it possible to found out what is max number of cells that the widget can occupy programatically on widget creation time.

Upvotes: 0

Views: 691

Answers (1)

Kelevandos
Kelevandos

Reputation: 7082

No, this is impossible :( You can specify the minWidth and minHeight, which are the default size of your widget. On bigger grids, like the mentioned 5x5, the user will have a choice to have your widget at specified size or to enlarge it to occupy more space.

You can also specify minResizeWidth and minResizeHeight, which will make the widget impossible to shrink below these values.

Upvotes: 1

Related Questions