Code example for ShapeDrawable

Methods: setAlpha

0
        a.addUpdateListener(new AnimatorUpdateListener() {
        	/* Listen to the update event */ 
            @Override 
            public void onAnimationUpdate(ValueAnimator va) {
                int value = (Integer) va.getAnimatedValue(); // Use animated value anyhow you want!
				myShapeDrawable.setAlpha(value); // For example, change transparency of our drawable!
                myView.invalidate(); // Redraw!
            } 
        }); 
 
        a.start();
    } 
 
    /* Our custom view which will draw the drawable */ 
    private class MyView extends View {
 
        public MyView(Context context) {
            super(context);
        } 
 
        @Override