Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Sunday, December 5, 2010

Setting Solid Color to DrawableShape loaded from XML

So yea, tried to set a solid color to a ShapeDrawable resource loaded from XML
initially tried:

ShapeDrawable drawable = (ShapeDrawable)getResources().getDrawable(R.drawable.shape)
drawable.getPaint().setColor(color);

Didn't work,

So cast to GradientDrawable instead:
GradientDrawable drawable = (GradientDrawable)getResources().getDrawable(R.drawable.shape)
drawable.setColor(color);

Thursday, July 22, 2010

Android Development

I know i've been neglecting this blog for a while, but i've recently picked up a Samsung Galaxy S and will be refocusing on developing apps on Android and posting what i learn here.