Add some missing APIs.

android.widget.Filter and android.webkit.MimeTypeMap are copied from
AOSP. Other new classes are only stub implementations.
This commit is contained in:
Julian Winkler
2023-09-01 12:55:04 +02:00
parent 6c2a3adae6
commit 97f8c2ed0f
30 changed files with 1165 additions and 38 deletions

View File

@@ -19,4 +19,8 @@ public class BitmapDrawable extends Drawable {
canvas.drawBitmap(bitmap, new Rect(0, 0, bitmap.getWidth(), bitmap.getWidth()), new RectF(getBounds()), null);
}
public Bitmap getBitmap() {
return bitmap;
}
}

View File

@@ -4,6 +4,9 @@ import android.graphics.Canvas;
public class ColorDrawable extends Drawable {
public ColorDrawable(int color) {
}
@Override
public void draw(Canvas canvas) {
// TODO Auto-generated method stub

View File

@@ -24,7 +24,9 @@ public abstract class Drawable {
public abstract class ConstantState {
public abstract Drawable newDrawable(Resources res);
public abstract Drawable newDrawable(Resources res);
public abstract Drawable newDrawable();
}
public void setBounds(int left, int top, int right, int bottom) {

View File

@@ -0,0 +1,13 @@
package android.graphics.drawable;
import android.graphics.Canvas;
public class DrawableContainer extends Drawable {
@Override
public void draw(Canvas canvas) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'draw'");
}
}

View File

@@ -13,5 +13,7 @@ public class GradientDrawable extends Drawable {
public void setColor(int color) {}
public void setCornerRadius(float cornerRadius) {}
public void setShape(int shape) {}
}

View File

@@ -0,0 +1,13 @@
package android.graphics.drawable;
import android.graphics.Canvas;
public class ScaleDrawable extends Drawable {
@Override
public void draw(Canvas canvas) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'draw'");
}
}

View File

@@ -0,0 +1,15 @@
package android.graphics.drawable;
import android.graphics.Canvas;
public class StateListDrawable extends Drawable {
@Override
public void draw(Canvas canvas) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'draw'");
}
public void addState(int[] stateSet, Drawable drawable) {}
}