Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Appwidget Maximum Width that fits all screen sizes

I am currently developing an appwidget and unfortunately it does not fits in phone with bigger screen sizes. How can I ensure that the appwidget has full width for all types of phones?

At first I thought this could be done by using width="fill_parent" but it does not work.. The widget does not fill the width of the phone ( I am not sure whether it is based on the minWidth under xml folder )

I've also tried adding layout-sw480dp,layout-sw600dp,layout-sw720dp and it still doesn't work... The appwidget just won't fill the full width of the phone..

Any help is much appreciated!

like image 472
Annonymous Avatar asked Jan 22 '13 03:01

Annonymous


1 Answers

Size of App Widget is rounded to neerest grid size, so it might be good idea to set minWidth to large value. Unfortunatelly it will not work. If you try it, your widget will not show in list of widgets to add to homescreen.

You would just calculate width for 4 cells by formula from docs: 70 * cells - 30, so it would be 250dp. The problem is, on bigger screens, with large density, home screens are wider than 4 cells. I think you could just create multiple widgets with different width, or just make your widget resizable.

like image 130
Eloar Avatar answered Sep 25 '22 21:09

Eloar