You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
23 lines
521 B
Java
23 lines
521 B
Java
package android.graphics.drawable;
|
|
|
|
import android.content.res.Resources;
|
|
import android.graphics.Bitmap;
|
|
import android.graphics.Canvas;
|
|
import android.graphics.Rect;
|
|
import android.graphics.RectF;
|
|
|
|
public class BitmapDrawable extends Drawable {
|
|
|
|
private Bitmap bitmap;
|
|
|
|
public BitmapDrawable(Resources res, Bitmap bitmap) {
|
|
this.bitmap = bitmap;
|
|
}
|
|
|
|
@Override
|
|
public void draw(Canvas canvas) {
|
|
canvas.drawBitmap(bitmap, new Rect(0, 0, bitmap.getWidth(), bitmap.getWidth()), new RectF(getBounds()), null);
|
|
}
|
|
|
|
}
|