1package com.android.server.status; 2 3import android.graphics.drawable.Drawable; 4import android.graphics.Canvas; 5import android.graphics.ColorFilter; 6import android.graphics.Rect; 7import android.util.Log; 8 9class FixedSizeDrawable extends Drawable { 10 Drawable mDrawable; 11 int mLeft; 12 int mTop; 13 int mRight; 14 int mBottom; 15 16 FixedSizeDrawable(Drawable that) { 17 mDrawable = that; 18 } 19 20 public void setFixedBounds(int l, int t, int r, int b) { 21 mLeft = l; 22 mTop = t; 23 mRight = r; 24 mBottom = b; 25 } 26 27 public void setBounds(Rect bounds) { 28 mDrawable.setBounds(mLeft, mTop, mRight, mBottom); 29 } 30 31 public void setBounds(int l, int t, int r, int b) { 32 mDrawable.setBounds(mLeft, mTop, mRight, mBottom); 33 } 34 35 public void draw(Canvas canvas) { 36 mDrawable.draw(canvas); 37 } 38 39 public int getOpacity() { 40 return mDrawable.getOpacity(); 41 } 42 43 public void setAlpha(int alpha) { 44 mDrawable.setAlpha(alpha); 45 } 46 47 public void setColorFilter(ColorFilter cf) { 48 mDrawable.setColorFilter(cf); 49 } 50} 51