tilex
tilex

Reputation: 1774

How to change android app widget size at runtime?

I know that one cannot change the size of an app widget. But what to do if I need to? I know that there can be several receivers in AndroidManifest.xml, each with its own provider_info.xml, but users can switch between them only while adding widget on the homescreen. Is there any way to switch between different app widget providers at runtime?

Upvotes: 2

Views: 4540

Answers (2)

Michell Bak
Michell Bak

Reputation: 13252

Is there any way to switch between different app widget providers at runtime?

No, not as far as I'm aware. I believe this is the reason why some applications include widgets in various different sizes.

It's also not possible for the user to change the size of widgets, if you need to support Android 2.0+.

Edit: As of Android 4.1, it is actually possible to have different layouts for resizable widgets. The layouts change according to the size of the widget.

Upvotes: 4

Yury
Yury

Reputation: 20936

I've read that beginning from the Honeycomb 3.1 you can resize your App Widgets. You should specify minResizeWidth and minResizeHeight in your appwidget_info.xml file and use layouts for widget that can be resized. More about this you can find here.

Upvotes: 1

Related Questions