• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Select different size widgets in configuration activity

grundy923

Lurker
I want to different size widgets with my application. It involves a calendar so I want to make one widget 4x3 that shows the whole month, one widget that's 4x1 that shows the whole week, and one widget that's 2x1 that shows just the current day.

I do not want to clutter the add widget menu and have all 3 of them appear in the list. I want 1 to show and when you select it, it opens a configuration activity that allows the user to choose which one they want.

I have figured out how to create the activity and to use the correct layout of the widget based on the user's choice, but the problem is the size is always determined by the <appwidget-provider android:minWidth="X" android:minHeight="Y"> that launched the configuration activity.

I understand that in Android 3.1 and later widgets are resizable, and I understand that you can't change the minWidth and minHeight values in your configuration activity.

I'm trying to do a different work around where choosing the widget size in the configuration activity will cancel adding the widget and then start up a new appwidget-provider that contains the correct height and width values for each layout.

Does anyone know if this is possible? And if it is, could the other appwidget-providers be hidden from the add widget to home screen menu? because after all, the whole idea is to not clutter it.
 
Back
Top Bottom