Code example for ClipDrawable

0
        double div = (double)value/(double)max;
        if(div > 0.9) myColor = Color.BLUE;
        else if(div > 0.5) myColor = Color.GREEN;
        else if(div > 0.25) myColor = Color.YELLOW;
        pgDrawable.getPaint().setColor(myColor);
        ClipDrawable pg = new ClipDrawable(pgDrawable, Gravity.LEFT, ClipDrawable.HORIZONTAL);
        bar.setProgressDrawable(pg);   
        bar.setBackgroundDrawable(getResources().getDrawable(android.R.drawable.progress_horizontal));
        bar.setProgress(value);
	} 
	 
	public int getEarthSize(){ 
		return earthStats[earthPosition][2];
	} 
	 
	public int getEarthGravity(){ 
		return earthStats[earthPosition][1];
	} 
	 
	public int getPlayerSpeed(){ 
Stop searching for code, let great code find you!  Add Codota to your java IDE