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
Add some stubs needed by android material library
This commit is contained in:
@@ -45,6 +45,30 @@ public class Color {
|
||||
return color >>> 24;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the red component of a color int. This is the same as saying
|
||||
* (color >> 16) & 0xFF
|
||||
*/
|
||||
public static int red(int color) {
|
||||
return (color >> 16) & 0xFF;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the green component of a color int. This is the same as saying
|
||||
* (color >> 8) & 0xFF
|
||||
*/
|
||||
public static int green(int color) {
|
||||
return (color >> 8) & 0xFF;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the blue component of a color int. This is the same as saying
|
||||
* color & 0xFF
|
||||
*/
|
||||
public static int blue(int color) {
|
||||
return color & 0xFF;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the color string, and return the corresponding color-int.
|
||||
* If the string cannot be parsed, throws an IllegalArgumentException
|
||||
|
||||
5
src/api-impl/android/graphics/ColorFilter.java
Normal file
5
src/api-impl/android/graphics/ColorFilter.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package android.graphics;
|
||||
|
||||
public class ColorFilter {
|
||||
|
||||
}
|
||||
@@ -245,7 +245,7 @@ public class Matrix {
|
||||
* Set the matrix to identity
|
||||
*/
|
||||
public void reset() {
|
||||
native_reset(native_instance);
|
||||
// native_reset(native_instance);
|
||||
}
|
||||
/**
|
||||
* Set the matrix to translate by (dx, dy).
|
||||
@@ -386,7 +386,8 @@ public class Matrix {
|
||||
* M' = S(sx, sy, px, py) * M
|
||||
*/
|
||||
public boolean postScale(float sx, float sy, float px, float py) {
|
||||
return native_postScale(native_instance, sx, sy, px, py);
|
||||
// return native_postScale(native_instance, sx, sy, px, py);
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Postconcats the matrix with the specified scale.
|
||||
@@ -480,7 +481,8 @@ public class Matrix {
|
||||
if (dst == null || src == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
return native_setRectToRect(native_instance, src, dst, stf.nativeInt);
|
||||
// return native_setRectToRect(native_instance, src, dst, stf.nativeInt);
|
||||
return true;
|
||||
}
|
||||
// private helper to perform range checks on arrays of "points"
|
||||
private static void checkPointArrays(float[] src, int srcIndex,
|
||||
|
||||
@@ -20,7 +20,7 @@ package android.graphics;
|
||||
* A color filter that can be used to tint the source pixels using a single
|
||||
* color and a specific {@link PorterDuff Porter-Duff composite mode}.
|
||||
*/
|
||||
public class PorterDuffColorFilter {
|
||||
public class PorterDuffColorFilter extends ColorFilter {
|
||||
private int mColor;
|
||||
private PorterDuff.Mode mMode;
|
||||
|
||||
|
||||
@@ -36,4 +36,12 @@ public class Typeface {
|
||||
public static Typeface createFromAsset(AssetManager mgr, String path) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Typeface create(String familyName, int style) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Typeface create(Typeface typeface, int style) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package android.graphics.drawable;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.ColorFilter;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.Rect;
|
||||
|
||||
@@ -65,8 +66,12 @@ public abstract class Drawable {
|
||||
public void setBounds(Rect bounds) {}
|
||||
|
||||
public void setColorFilter(int color, PorterDuff.Mode mode) {}
|
||||
public void setColorFilter(ColorFilter filter) {}
|
||||
|
||||
public Drawable mutate() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getIntrinsicWidth() {return 0;}
|
||||
public int getIntrinsicHeight() {return 0;}
|
||||
}
|
||||
|
||||
17
src/api-impl/android/graphics/drawable/InsetDrawable.java
Normal file
17
src/api-impl/android/graphics/drawable/InsetDrawable.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package android.graphics.drawable;
|
||||
|
||||
import android.graphics.Canvas;
|
||||
|
||||
public class InsetDrawable extends Drawable {
|
||||
|
||||
public InsetDrawable(Drawable drawable, int insetLeft, int insetTop, int insetRight, int insetBottom) {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'draw'");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user