Code example for ClipDrawable

Methods: getLevelsetLevel

0
        imageView = (ImageView) this.findViewById(R.id.imageView);
    } 
     
    public void changeImage(View v){
    	ClipDrawable clipDrawable = (ClipDrawable) imageView.getDrawable();
    	clipDrawable.setLevel(clipDrawable.getLevel()+1000);
    	 
    	/* 
    	TransitionDrawable transitionDrawable = (TransitionDrawable) ((Button)v).getBackground(); 
    	transitionDrawable.startTransition(500); 
    	*/ 
    	 
    	/* 
    	LevelListDrawable levelListDrawable = (LevelListDrawable) imageView.getDrawable(); 
    	levelListDrawable.setLevel(12); 
    	*/ 
    	/* 
    	//LayerDrawable layerDrawable = (LayerDrawable) imageView.getDrawable(); 
    	LayerDrawable layerDrawable = (LayerDrawable)getResources().getDrawable(R.drawable.layerlist); 
    	Drawable drawable = getResources().getDrawable(R.drawable.icon); 
    	layerDrawable.setDrawableByLayerId(R.id.userimage, drawable);