Now that I've come back to it after some time has passed, I've found a 
partial solution to this issue, one that I'm surprised none of us thought of 
before.

If your give the root of your appwidget's layout a width & height of 
match_parent, then it will expand to fill all available space that the OS 
gives it as the user resizes. Seems obvious in retrospect, but none of us 
mentioned it the first time around. All you then need to do is ensure that 
the rest of your content resizes gracefully, but that's essentially the same 
as for any layout of variable dimensions (portrait vs. landscape, or 
whatever).

For my specific use case of a single large image, my layout ended up just 
looking like this:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android";
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:gravity="center"
             >
    <ImageView android:scaleType="fitCenter"
               android:id="@+id/my_image"
               android:layout_width="match_parent"
               android:layout_height="match_parent"
               />
</RelativeLayout>

The only drawback that I've found is that, since there's no onResize event, 
the source image needs to be as big as possible to avoid pixellation. For 
me, that meant a size of 360px (my image is intrinsically square) was as 
large as I could go before running into the dreaded "!!!

-- 
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

Reply via email to