public IconView(Context context, AttributeSet attrs) { super(context, attrs); init(); }
private void init() { setLayerType(LAYER_TYPE_SOFTWARE, null); mDrawable = new IconDrawable(); }
private void handleIconDrawable() { IconView imageView8 = (IconView) this.findViewById(R.id.imageview8); IconDrawable drawable = imageView8.getIconDrawable(); drawable.setBackgroundColor(Color.GREEN); drawable.setTextLabel("M"); IconView imageView9 = (IconView) this.findViewById(R.id.imageview9); IconDrawable drawable1 = imageView9.getIconDrawable(); drawable1.setBackgroundColor(Color.YELLOW); drawable1.setTextColor(Color.DKGRAY); drawable1.setTextLabel("王"); IconView imageView10 = (IconView) this.findViewById(R.id.imageview10); IconDrawable drawable2 = imageView10.getIconDrawable(); drawable2.setIconLabel(BitmapFactory.decodeResource(getResources(), R.drawable.timg)); IconView imageView11 = (IconView) this.findViewById(R.id.imageview11); IconDrawable drawable3 = imageView11.getIconDrawable(); drawable3.setIconLabel(BitmapFactory.decodeResource(getResources(), R.drawable.timg1)); } }