Configuration activity to return different sized widgets?

Put your problem here if it does not fit any of the other categories.

Configuration activity to return different sized widgets?

Postby grundy923 » Fri Feb 24, 2012 11:11 pm

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 know the simple answer is "you can't do it" but I'm not OK with that.

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.
grundy923
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Feb 24, 2012 11:00 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 24 guests