src/com/poomoo/edao/widget/FlexibleRatingBar.java
private BitmapShader updateShader(int colorOn, int colorOff) {

		// Bitmap of width 0 will cause a crash. Make sure it's a positive
		// number.
		int ratingWidth = (int) (getRating() * getWidth() / getNumStars());

		if (ratingWidth <= 0 || getWidth() - ratingWidth <= 0) {
			colorsJoined = Bitmap.createBitmap(getWidth(), getHeight(),
					Bitmap.Config.ARGB_8888);
			colorsJoined.eraseColor(ratingWidth <= 0 ? colorOff : colorOn);
		} else {
			Bitmap colorLeft = Bitmap.createBitmap(ratingWidth, getHeight(),
					Bitmap.Config.ARGB_8888);
			colorLeft.eraseColor(colorOn);
			Bitmap colorRight = Bitmap.createBitmap(getWidth() - ratingWidth,
					getHeight(), Bitmap.Config.ARGB_8888);
			colorRight.eraseColor(colorOff);
			colorsJoined = combineBitmaps(colorLeft, colorRight);
		}
		return new BitmapShader(colorsJoined, Shader.TileMode.CLAMP,
				Shader.TileMode.CLAMP);
	}
// Create a BitmapShader, which is used to show fractions of stars

Create a BitmapShader, which is used to show fractions of stars
Create a BitmapShader which is used to show fractions of stars
private BitmapShader updateShader(int colorOn, int colorOff) {
		int ratingWidth = (int) (getRating() * getWidth() / getNumStars());
		if (ratingWidth <= 0 || getWidth() - ratingWidth <= 0) {
			colorsJoined = Bitmap.createBitmap(getWidth(), getHeight(),
					Bitmap.Config.ARGB_8888);
			colorsJoined.eraseColor(ratingWidth <= 0 ? colorOff : colorOn);
		} else {
			Bitmap colorLeft = Bitmap.createBitmap(ratingWidth, getHeight(),
					Bitmap.Config.ARGB_8888);
			colorLeft.eraseColor(colorOn);
			Bitmap colorRight = Bitmap.createBitmap(getWidth() - ratingWidth,
					getHeight(), Bitmap.Config.ARGB_8888);
			colorRight.eraseColor(colorOff);
			colorsJoined = combineBitmaps(colorLeft, colorRight);
		}
		return new BitmapShader(colorsJoined, Shader.TileMode.CLAMP,
				Shader.TileMode.CLAMP);
	}
private BitmapShader updateShader ( int colorOn , int colorOff ) { int ratingWidth = ( int ) ( getRating ( ) * getWidth ( ) / getNumStars ( ) ) ; if ( ratingWidth <= 0 || getWidth ( ) - ratingWidth <= 0 ) { colorsJoined = Bitmap . createBitmap ( getWidth ( ) , getHeight ( ) , Bitmap . Config . ARGB_8888 ) ; colorsJoined . eraseColor ( ratingWidth <= 0 ? colorOff : colorOn ) ; } else { Bitmap colorLeft = Bitmap . createBitmap ( ratingWidth , getHeight ( ) , Bitmap . Config . ARGB_8888 ) ; colorLeft . eraseColor ( colorOn ) ; Bitmap colorRight = Bitmap . createBitmap ( getWidth ( ) - ratingWidth , getHeight ( ) , Bitmap . Config . ARGB_8888 ) ; colorRight . eraseColor ( colorOff ) ; colorsJoined = combineBitmaps ( colorLeft , colorRight ) ; } return new BitmapShader ( colorsJoined , Shader . TileMode . CLAMP , Shader . TileMode . CLAMP ) ; }
Create a BitmapShader, which is used to show fractions of stars
Create a BitmapShader which is used to show fractions of stars
// Bitmap of width 0 will cause a crash. Make sure it's a positive
 // number.
