Hi,
Can anyone point me to the right way of drawing a circle as part of a
ListView row ? The code below used to work ok in some android beta SDK
but now under 1.6 it only draws me a black cirle. How can I change
it's colour from getView(..) ?
My code:
public View getView(int position, View convertView,
android.view.ViewGroup parent)
{
View singleView;
LinearLayout lL = new LinearLayout (getContext());
OvalShape circle = new OvalShape();
circle.resize(8, 8);
ShapeDrawable dwb = new ShapeDrawable (circle);
PointColour clr = ((ListRow) content[position]).pointColour;
dwb.setColorFilter(Color.argb (clr.getAlpha(), clr.getRed(),
clr.getGreen(), clr.getBlue() ), PorterDuff.Mode.SRC);
dwb.setIntrinsicWidth(10);
dwb.setIntrinsicHeight(10);
singleView = new ImageView (getContext());
((ImageView)singleView).setImageDrawable(dwb);
LayoutParams params = new LayoutParams (10, 10);
lL.addView(singleView, params);
singleView = new TextView (getContext());
((TextView)singleView).setText((CharSequence) (" " +
((ListRow)content[position]).participant));
params = new LayoutParams (189, 20);
lL.addView(singleView, params);
return lL;
}
--
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