api-impl: stubs and fixes for Compose Stopwatch and LibreSudoku

This commit is contained in:
Julian Winkler
2024-12-10 23:23:14 +01:00
parent b9272aa150
commit 1398125eb5
28 changed files with 238 additions and 36 deletions

View File

@@ -489,7 +489,11 @@ public final class Bitmap {
* This configuration is very flexible and offers the best
* quality. It should be used whenever possible.
*/
ARGB_8888(5);
ARGB_8888(5),
RGBA_F16(6),
HARDWARE(7);
final int nativeInt;
@@ -602,9 +606,9 @@ public final class Bitmap {
*/
public Bitmap copy(Config config, boolean isMutable) {
checkRecycled("Can't copy a recycled bitmap");
Bitmap b = nativeCopy(mNativeBitmap, config.nativeInt, isMutable);
Bitmap b = new Bitmap(native_copy(pixbuf));
if (b != null) {
b.setAlphaAndPremultiplied(hasAlpha(), mIsPremultiplied);
// b.setAlphaAndPremultiplied(hasAlpha(), mIsPremultiplied);
b.mDensity = mDensity;
}
return b;
@@ -979,6 +983,10 @@ public final class Bitmap {
return createBitmap(display, colors, 0, width, width, height, config);
}
public static Bitmap createBitmap(DisplayMetrics display, int width, int height, Config config, boolean hasAlpha, ColorSpace colorSpace) {
return createBitmap(display, width, height, config, hasAlpha);
}
/**
* Returns an optional array of private data, used by the UI system for
* some bitmaps. Not intended to be called by applications.

View File

@@ -0,0 +1,13 @@
package android.graphics;
public class ColorSpace {
public static enum Named {
SRGB,
}
public static ColorSpace get(Named named) {
return new ColorSpace();
}
}

View File

@@ -7,4 +7,6 @@ public class Outline {
public void setEmpty() {}
public void setRoundRect(int left, int top, int right, int bottom, float r) {}
public void setRect(int left, int top, int right, int bottom) {}
}

View File

@@ -670,6 +670,10 @@ public class Path {
final long ni() {
return mNativePath;
}
public boolean isConvex() {
return false;
}
private static native long init1();
private static native long init2(long nPath);
private static native void native_reset(long nPath);

View File

@@ -3,4 +3,14 @@ package android.graphics;
public class PathMeasure {
public PathMeasure(Path path, boolean dummy) {
}
public void setPath(Path path, boolean forceClosed) {}
public float getLength() {
return 100;
}
public boolean getSegment(float start, float end, Path dst, boolean forceClosed) {
return false;
}
}

View File

@@ -0,0 +1,8 @@
package android.graphics.drawable;
public class Icon {
public static Icon createWithResource(String packageName, int resourceId) {
return null;
}
}

View File

@@ -10,4 +10,6 @@ public class RippleDrawable extends LayerDrawable {
public void setColor(ColorStateList colorStateList) {}
public void setRadius(int radius) {}
}