add lots of java APIs needed for Whatsapp

This commit is contained in:
Julian Winkler
2024-06-15 22:32:01 +02:00
parent b81f53e4b2
commit bb50bbfa91
61 changed files with 383 additions and 71 deletions

View File

@@ -88,6 +88,8 @@ public class Paint {
public float measureText(char[] text, int index, int count) { return 10; }
public float measureText(String text, int start, int end) { return 10; }
public float measureText(String text) {
if (skia_font == 0)
skia_font = native_create_font();
return native_measure_text(skia_font, text, 0, text.length(), skia_paint);
}
public float measureText(CharSequence text, int start, int end) { return 10; }

View File

@@ -211,7 +211,9 @@ public class Drawable {
drawable.inflate(resources, parser, attrs, null);
return drawable;
} else if ("layer-list".equals(parser.getName())) {
return new LayerDrawable();
LayerDrawable drawable = new LayerDrawable();
drawable.inflate(resources, parser, attrs);
return drawable;
}
return null;
}

View File

@@ -8,6 +8,10 @@ public class InsetDrawable extends Drawable {
super();
}
public InsetDrawable(Drawable drawable, int inset) {
super();
}
public boolean getPadding(Rect padding) { return false; }
}

View File

@@ -162,7 +162,8 @@ public class LayerDrawable extends Drawable implements Drawable.Callback {
dr = Drawable.createFromXmlInner(r, parser, attrs);
}
addLayer(dr, id, left, top, right, bottom);
if (dr != null)
addLayer(dr, id, left, top, right, bottom);
}
ensurePadding();

View File

@@ -0,0 +1,8 @@
package android.graphics.drawable.shapes;
import android.graphics.RectF;
public class RoundRectShape extends Shape {
public RoundRectShape(float[] outerR, RectF innerR, float[] cornR) {}
}