Instead of calling setCompoundDrawablesWithIntrinsicBounds(), just use
setCompoundDrawables() and set your own bounds.

On Wed, Oct 6, 2010 at 10:28 AM, jotobjects <jotobje...@gmail.com> wrote:
> Is there a way to scale the Drawable passed to
> TextView.setCompoundDrawables ?  The following code works very well
> but of course is set to the full intrinsic size of the drawable.  This
> code is used with the Holder pattern in a ListView where the purpose
> is to update the drawable without two more Views (LinearLayout and
> ImageView) to accomplish the same thing.
>
>  Drawable noteImage = context.getResources().getDrawable(note.picId);
>  noteView.setCompoundDrawablePadding((int)(5*densityScale));
>  noteView.setCompoundDrawablesWithIntrinsicBounds(noteImage, null,
> null, null);
>
> I suppose I can use Drawable.setBounds() and preserve the original
> aspect ratio with a small function but just wondering if there this a
> more direct way to do this with the api?
>
> --
> 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
>



-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

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