Maximum appwidget size that fits all screen sizes

I am currently developing an application and, unfortunately, it is not suitable for phones with large screen sizes. How can I guarantee that appwidget is full width for all types of phones?

At first I thought this could be done using width="fill_parent" , but that would not work. Widget doesn't fill phone width (I'm not sure if it is based on minWidth in xml folder)

I also tried adding layout-sw480dp,layout-sw600dp,layout-sw720dp , and it still does not work ... The application just won’t fill the entire width of the phone.

Any help is much appreciated!

+6
source share
1 answer

The application widget size is rounded to the smallest grid size, so it would be nice to set the minWidth value to a large value. Unfortunately this will not work. If you try, your widget will not appear in the list of widgets to add to your desktop.

You just calculated the width for 4 cells using the formula from docs: 70 * cells - 30 , so that would be 250 dp. The problem is that on large screens with high density, home screens are wider than 4 cells. I think you could just create some widgets of different widths or just resize the widget.

+3
source

All Articles