>
> You can emulate stroked text by setting the Shadow Color (stroke color)
> and Shadow Radius (stroke width) but leaving the Shadow Dx and Dy as zero.
>

Oh, good idea!  If that gives the results he wants then he wouldn't need to
subclass Button at all...

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Tue, Jul 24, 2012 at 2:37 PM, Nick Fedesna <[email protected]> wrote:

> You can emulate stroked text by setting the Shadow Color (stroke color)
> and Shadow Radius (stroke width) but leaving the Shadow Dx and Dy as zero.
>
> -Nick
>
>
> On Tuesday, July 24, 2012 1:31:41 PM UTC-5, MagouyaWare wrote:
>>
>> There really is no way for adding a stroke to text... I believe you asked
>> about that in another post.  To do that you would need to subclass
>> Button... And then you would need to do a whole lot of work in the onDraw()
>> method.  I don't know if that would be worth the effort.
>>
>> Even if you decide it is worth the effort, don't do anything in the
>> subclass relating to the background of the button... just the text.
>>
>> Thanks,
>> Justin Anderson
>> MagouyaWare Developer
>> http://sites.google.com/site/**magouyaware<http://sites.google.com/site/magouyaware>
>>
>>
>> On Tue, Jul 24, 2012 at 11:57 AM, bob <[email protected]> wrote:
>>
>>> The text.
>>>
>>> On Tuesday, July 24, 2012 9:14:28 AM UTC-5, MagouyaWare wrote:
>>>>
>>>> Stroking for what? The button or the text?
>>>> On Jul 24, 2012 7:58 AM, "bob" <[email protected]> wrote:
>>>>
>>>>> And to achieve stroking?
>>>>>
>>>>> On Monday, July 23, 2012 3:59:05 PM UTC-5, Nobu Games wrote:
>>>>>>
>>>>>> Why don't you just create a state list drawable based on 9-patch
>>>>>> images instead of hacking redundant drawing operations into the Button
>>>>>> widget?
>>>>>>
>>>>>> For each button state (normal, selected, pressed...) you can create a
>>>>>> custom PNG graphics file. Use the 
>>>>>> draw9patch<http://developer.android.com/tools/help/draw9patch.html>app 
>>>>>> for converting them into 9 patch files. Create a state
>>>>>> list XML resource 
>>>>>> file<http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList>in
>>>>>>  your res/drawables folder.
>>>>>>
>>>>>> Set that state list resource as background drawable resource on your
>>>>>> button to customize its looks.
>>>>>>
>>>>>> If you want to make the label text look fancy, then you can play
>>>>>> around with text 
>>>>>> shadow<http://developer.android.com/reference/android/widget/TextView.html#attr_android:shadowColor>style
>>>>>>  properties.
>>>>>>
>>>>>> On Monday, July 23, 2012 3:32:45 PM UTC-5, bob wrote:
>>>>>>>
>>>>>>> I had to do this:
>>>>>>>
>>>>>>>         android:background="@null"
>>>>>>>
>>>>>>> On Monday, July 23, 2012 1:02:40 PM UTC-5, bob wrote:
>>>>>>>>
>>>>>>>> So, I'm making my own button class to have better-looking buttons.
>>>>>>>>
>>>>>>>> I subclassed Button, and put this in:
>>>>>>>>
>>>>>>>> @Override
>>>>>>>> protected void onDraw(Canvas canvas) {
>>>>>>>>  String s = (String) this.getText();
>>>>>>>> int w = this.getWidth();
>>>>>>>> int h = this.getHeight();
>>>>>>>>  Button_Painter.paint_button(s, canvas, w, h);
>>>>>>>> }
>>>>>>>>
>>>>>>>>
>>>>>>>> The issue is that this grey rectangle still gets drawn like so:
>>>>>>>>
>>>>>>>> http://postimage.org/image/**rhs****1omfql/<http://postimage.org/image/rhs1omfql/>
>>>>>>>>
>>>>>>>> In other words, part of the old drawing is still going on.  I'm not
>>>>>>>> calling the superclass's onDraw…
>>>>>>>>
>>>>>>>>
>>>>>>>> Any ideas?
>>>>>>>>
>>>>>>>>  --
>>>>> 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@**googlegroup*
>>>>> *s.com <[email protected]>
>>>>> To unsubscribe from this group, send email to
>>>>> android-developers+**unsubscribe**@googlegroups.com<android-developers%[email protected]>
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/**group**/android-developers?hl=en<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 <[email protected]>
>>> To unsubscribe from this group, send email to
>>> android-developers+**[email protected]<android-developers%[email protected]>
>>> For more options, visit this group at
>>> http://groups.google.com/**group/android-developers?hl=en<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 [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 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