blob: 8f2f5f9e7e7abad90b288385157fd25364dd8122 [file] [log] [blame]
Joe Onorato503007d2010-04-16 09:20:55 -07001/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Joe Onoratofd52b182010-11-10 18:00:52 -080017package com.android.systemui.statusbar.policy;
Joe Onorato503007d2010-04-16 09:20:55 -070018
19import android.graphics.drawable.Drawable;
20import android.graphics.Canvas;
21import android.graphics.ColorFilter;
22import android.graphics.Rect;
23import android.util.Slog;
24
Joe Onoratofd52b182010-11-10 18:00:52 -080025public class FixedSizeDrawable extends Drawable {
Joe Onorato503007d2010-04-16 09:20:55 -070026 Drawable mDrawable;
27 int mLeft;
28 int mTop;
29 int mRight;
30 int mBottom;
31
Joe Onoratofd52b182010-11-10 18:00:52 -080032 public FixedSizeDrawable(Drawable that) {
Joe Onorato503007d2010-04-16 09:20:55 -070033 mDrawable = that;
34 }
35
36 public void setFixedBounds(int l, int t, int r, int b) {
37 mLeft = l;
38 mTop = t;
39 mRight = r;
40 mBottom = b;
41 }
42
43 public void setBounds(Rect bounds) {
44 mDrawable.setBounds(mLeft, mTop, mRight, mBottom);
45 }
46
47 public void setBounds(int l, int t, int r, int b) {
48 mDrawable.setBounds(mLeft, mTop, mRight, mBottom);
49 }
50
51 public void draw(Canvas canvas) {
52 mDrawable.draw(canvas);
53 }
54
55 public int getOpacity() {
56 return mDrawable.getOpacity();
57 }
58
59 public void setAlpha(int alpha) {
60 mDrawable.setAlpha(alpha);
61 }
62
63 public void setColorFilter(ColorFilter cf) {
64 mDrawable.setColorFilter(cf);
65 }
66}