This part of code is the same as the function TiUIHelper.buildBackgroundDrawable(). I think it's better to change that function to public and then use it here.