Yes, this is my Approach 1.
For that you also need to know the size, at least roughly.
But it does not look nice because I can only assume the correct size
so it will get stretched unevenly.
Just using the emulators for 2.1 and 2.3 using the WVGA resolution I
have a change from 480x678 to 480x633. Using other home apps can
provide even extremer differences.
Round corners are not round anymore, etc.

On Jan 9, 12:44 pm, Kumar Bibek <coomar....@gmail.com> wrote:
> Oh, sorry about that. I missed those few lines. In that case, you might try
> setting the scale type of the image view to perhaps fitXY. But I guess, you
> would have tried that too. Any problems with that?
>
> Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com
>
> On Sun, Jan 9, 2011 at 5:11 PM, Mark <android.eggenst...@googlemail.com>wrote:
>
>
>
>
>
>
>
> > They would, if there were a way to use them.
> > As written in my Approach 2, I don't see a way to use any of the
> > RemoteViews.set...() methods with a NinePatch.
> > Do you?
>
> > On Jan 9, 12:05 pm, Kumar Bibek <coomar....@gmail.com> wrote:
> > > 9 patch pngs should solve you problem, if I understand your problem
> > > correctly.
>
> > > Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com
>
> > > On Sun, Jan 9, 2011 at 3:51 PM, Pent <tas...@dinglisch.net> wrote:
> > > > I have a similar problem, would be nice if there was a standard way to
> > > > query the launcher for the widget dimensions for a particular cell
> > > > width/height wouldn't it ?
>
> > > > Pent
>
> > > > On Jan 9, 12:38 am, Mark <android.eggenst...@googlemail.com> wrote:
> > > > > I want to set the background of an appwidget at runtime with a
> > > > > dynamically generated image (skin) (which must fill the entire space
> > > > > of the widget).
>
> > > > > Approach 1:
> > > > > Use an ImageView and remoteViews.setImageViewUri()
> > > > > Problem:
> > > > > For the image to fit and look properly I need to know the exact pixel
> > > > > size of the widget and I have not found a way to do that.
> > > > > The minWidth/Height of the widget does not help. The space taken by
> > > > > the cells also varies from Android version to version e.g. comparing
> > > > > 2.1 (480x678) with 2.3 (480x633) for 4x4 cells on WVGA. And this is
> > > > > only the default Home app. LauncherPro, ADW etc. have different
> > status
> > > > > bar heights etc. Also the image get's really big which slows down the
> > > > > system, lags, is prone to crashes in low mem situation.
>
> > > > > Approach 2:
> > > > > Use a NinePatch image which adjusts to whatever size the widget has.
> > > > > Problem:
> > > > > I couldn't find a way to set a NinePatch image. This only works with
> > > > > resources which are inside the apk. Not with dynamically created
> > > > > files.
>
> > > > > Any suggestions would be welcome.
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > > > Groups "Android Developers" group.
> > > > To post to this group, send email to
> > android-developers@googlegroups.com
> > > > To unsubscribe from this group, send email to
> > > > android-developers+unsubscr...@googlegroups.com<android-developers%2Bunsubs
> > > >  cr...@googlegroups.com><android-developers%2Bunsubs
> > cr...@googlegroups.com>
> > > > 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 post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com<android-developers%2Bunsubs 
> > cr...@googlegroups.com>
> > 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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to