The docs refer to the following:

onAppWidgetOptionsChanged() 

This is called when the widget is first placed and any time the widget is 
resized. You can use this callback to show or hide content based on the 
widget's size ranges. You get the size ranges by calling 
getAppWidgetOptions(), which returns a Bundle that includes the following:
•OPTION_APPWIDGET_MIN_WIDTH—Contains the lower bound on the current width, 
in dp units, of a widget instance.
•OPTION_APPWIDGET_MIN_HEIGHT—Contains the lower bound on the current 
height, in dp units, of a widget instance.
•OPTION_APPWIDGET_MAX_WIDTH—Contains the upper bound on the current width, 
in dp units, of a widget instance.
•OPTION_APPWIDGET_MAX_HEIGHT—Contains the upper bound on the current width, 
in dp units, of a widget instance.

Can anyone explain what these ranges actually mean, and why there is a 
range at all, as opposed to the actual resized values. 

Because if I look at the values after a resize and compare it to the screen 
area covered by the widget, the results seem very strange.

The actual widget width in pixels corresponds to OPTION_APPWIDGET_MIN_WIDTH 
* screen density.
The actual widget width in pixels corresponds to 
OPTION_APPWIDGET_MAX_HEIGHT * screen density.

Yep, you read that right, the MIN width, but the MAX height!?

I want to work out the general size and aspect ratio of the resized widget 
so I can adjust the layout, as recommended by the docs, but just getting 
the widget size seems unnecessarily opaque. 

Does anyone know?

Thanks
James

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to