I'm much further now, thanks. I have 5 button in a horizontal linear layout. Each button is currently 167x280. I read that a one row widget is normally 320x100. However, if I scale each button to 64x100, it looks bad, probably because I need the density?! On a high density screen like a Nexus one,the 167x280 look perfect. The other problem I have is, that it scales badly. I would like to at least make it look 'ok' when used on a tablet. However, it looks like that it scales only the width, and doesn't preserve the ratio. I've tried a lot with different scale types, I've also tried 9-patch png images. If I do the latter, the button is scaled wrong in either case. Any idea? Thanks!!

----- Original Message ----- From: "Mark Murphy" <mmur...@commonsware.com>
To: <android-developers@googlegroups.com>
Sent: Saturday, November 20, 2010 4:16 AM
Subject: Re: [android-developers] Re: custom view in widget


On Fri, Nov 19, 2010 at 6:19 PM, Hendrik Greving <fourhend...@gmail.com> wrote:
So basically the widget can only use stuff from the OS?

Please read the documentation:

http://developer.android.com/guide/topics/appwidgets/index.html

particularly:

http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout

where it lists the eligible classes for use through a RemoteViews.

Let's say you want
to draw something nice into a widget, I saw several widgets doing that, like HTML content or so, or a picture from your mum (j/k), how would you do that?

Since you neglected to point out any examples, and since it is
impossible to tell by looking at a set of pixels whether or not they
came from "HTML content or so", it is difficult to answer your
question.

TextView supports SpannedString, such as that returned by
Html.fromHtml(). RemoteViews supports sending a SpannedString to an
app widget. Hence, you can use that subset of HTML supported by
fromHtml() in a TextView hosted by an app widget.

Also, please bear in mind that home screens are not subject to app
widget limitations. So, just because you might see an HTC Sense or
MOTOBLUR home screen doing something fancy does not mean that an app
widget is capable of the same feats of derring-do.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.2 Available!

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

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