multiple additions and fixes for the Java APIs

Stuff needed for WhatsApp support
This commit is contained in:
Julian Winkler
2024-06-24 18:44:31 +02:00
committed by Mis012
parent ef77bb287a
commit 3c5a21357d
53 changed files with 357 additions and 43 deletions

View File

@@ -76,8 +76,13 @@ public class Drawable {
}
public void draw(Canvas canvas) {
if (canvas instanceof GskCanvas)
if (canvas instanceof GskCanvas) {
if (mBounds.left != 0 || mBounds.top != 0)
canvas.translate(mBounds.left, mBounds.top);
native_draw(paintable, ((GskCanvas)canvas).snapshot, mBounds.width(), mBounds.height());
if (mBounds.left != 0 || mBounds.top != 0)
canvas.translate(-mBounds.left, -mBounds.top);
}
}
public boolean setState(int[] stateSet) {
@@ -145,8 +150,8 @@ public class Drawable {
return this;
}
public int getIntrinsicWidth() {return 0;}
public int getIntrinsicHeight() {return 0;}
public int getIntrinsicWidth() {return 24;}
public int getIntrinsicHeight() {return 24;}
public void setTintList(ColorStateList tint) {}
@@ -263,6 +268,10 @@ public class Drawable {
public void jumpToCurrentState() {}
public boolean setLayoutDirection(int layoutDirection) {
return false;
}
protected static native long native_paintable_from_path(String path);
protected native long native_constructor();
protected native void native_invalidate(long paintable);