[android-developers] Re: How to Create a 1x1 Widget Frame?

2011-03-30 Thread Jake Colman

Actually, I am pretty sure that it is a 9-patch drawable, since the name
widget_frame.9.png.

Here is a(nother) dumb question: what app can I use to do this editing.
I didn't see anything in Gimp (using Ubuntu) that would allow me to set
or modify any margins.  Nor did I see anything about transparency.

Looking again at Widget Design Guidelines page I see that they posted
size-specific .psd files.  If that's the case, it means that it is NOT
where I got my widget_frame 9-patch.

 KV == Kostya Vasilyev kmans...@gmail.com writes:

   KV Jake,

   KV If you need to remove the margins - well, remove the
   KV margins. They are in the image, should be easy with any graphics
   KV program, preferably you would make the image itself take a larger
   KV portion of the canvas.

   KV Using negative values for padding or margins are, AFAIK, not
   KV supported (which would be another way, if it was possible).

   KV As for transparency, those template backgrounds definitely have
   KV transparency in them. If it's not showing up, perhaps you have
   KV other images or view attributes that get in the way, or it could
   KV be that you saved them with transparency disabled.

   KV Finally, you might want to make a 1x1 background yourself, so it
   KV doesn't have to be scaled at runtime, and that your widget looks
   KV more crisp. A nine-patch drawable would let you share the
   KV background between 1x1 and other sizes.

   KV -- Kostya

   KV 30.03.2011 17:28, Jake Colman пишет:
I suppose that this is more of a graphics question than an Android SDK
question but maybe I can get some help anyway.

I downloaded the 2x1 widget frame from the Developers Guidelines page.
This frame scales to 1x1 without an issue if I set the
minHeight/minWidget parameters accordingly in the providers file.

My problem is that the widget appears to have margins that are getting
in my way and the background is opaque.

How can I remove the margins from that widget (I want to display my text
centered horizontally and vertically but need more display area) and how
do I change the background to make it translucent?

I am working on a Ubuntu VirtualBox and tried working with Gimp but
could not figure anything out.

Can anyone point me in the right direction or, better yet, just point me
to a proper .png that I can use?

Thanks.


   KV -- 
   KV Kostya Vasilyev -- http://kmansoft.wordpress.com

   KV -- 
   KV You received this message because you are subscribed to the Google
   KV Groups Android Developers group.
   KV To post to this group, send email to android-developers@googlegroups.com
   KV To unsubscribe from this group, send email to
   KV android-developers+unsubscr...@googlegroups.com
   KV For more options, visit this group at
   KV http://groups.google.com/group/android-developers?hl=en

-- 
Jake Colman -- Android Tinkerer

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


Re: [android-developers] Re: How to Create a 1x1 Widget Frame?

2011-03-30 Thread Kostya Vasilyev

30.03.2011 20:40, Jake Colman пишет:

Actually, I am pretty sure that it is a 9-patch drawable, since the name
widget_frame.9.png.


Good.


Here is a(nother) dumb question: what app can I use to do this editing.
I didn't see anything in Gimp (using Ubuntu) that would allow me to set
or modify any margins.  Nor did I see anything about transparency.


Anything really - Photoshop, Gimp...

There is no such thing as margins in a PNG file, understood as some 
numeric value you can enter somewhere (at least not for Android).


A raster image has certain size, so many pixels across and so many 
pixels down. If it has transparent areas on the sides/top/bottom, then 
those would show up as margins when this image is used in an application.


What you need to do, is edit the file and make the transparent areas 
smaller, and/or the non-transparent area larger.


For a nine-patch drawable, you also need to leave one extra row / column 
on pixels on each of four sides, and draw black pixels that tell Android 
how to resize it. Without this, it's not really a nine-patch. You can do 
this in the same image editing program, or use Draw9Patch from the SDK:


http://developer.android.com/guide/developing/tools/draw9patch.html


Looking again at Widget Design Guidelines page I see that they posted
size-specific .psd files.  If that's the case, it means that it is NOT
where I got my widget_frame 9-patch.


The standard widget frames are in Photoshop format, not nine-patches. 
They are not very useful anyway, as they only fit well on an HVGA screen 
(320 by 480).


--
Kostya Vasilyev -- http://kmansoft.wordpress.com

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