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 bunch of new java APIs: mostly stubs or copied from AOSP
Many of these classes are only needed to be subclassed by androidx support library, which is used in many android apps
This commit is contained in:
5
src/api-impl/android/graphics/drawable/Animatable.java
Normal file
5
src/api-impl/android/graphics/drawable/Animatable.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package android.graphics.drawable;
|
||||
|
||||
public interface Animatable {
|
||||
|
||||
}
|
||||
13
src/api-impl/android/graphics/drawable/ColorDrawable.java
Normal file
13
src/api-impl/android/graphics/drawable/ColorDrawable.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package android.graphics.drawable;
|
||||
|
||||
import android.graphics.Canvas;
|
||||
|
||||
public class ColorDrawable extends Drawable {
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'draw'");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,11 +1,15 @@
|
||||
package android.graphics.drawable;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.Rect;
|
||||
|
||||
public abstract class Drawable {
|
||||
public static interface Callback {}
|
||||
|
||||
private Rect mBounds = new Rect();
|
||||
private int[] mStateSet = new int[0];
|
||||
|
||||
public int getChangingConfigurations() {
|
||||
return 0;
|
||||
@@ -14,11 +18,12 @@ public abstract class Drawable {
|
||||
public void setChangingConfigurations(int bitmap) {}
|
||||
|
||||
public ConstantState getConstantState() {
|
||||
return new ConstantState();
|
||||
return null;
|
||||
}
|
||||
|
||||
public class ConstantState {
|
||||
|
||||
public abstract class ConstantState {
|
||||
|
||||
public abstract Drawable newDrawable(Resources res);
|
||||
}
|
||||
|
||||
public void setBounds(int left, int top, int right, int bottom) {
|
||||
@@ -30,4 +35,38 @@ public abstract class Drawable {
|
||||
}
|
||||
|
||||
public abstract void draw(Canvas canvas);
|
||||
|
||||
public boolean setState(int[] stateSet) {
|
||||
this.mStateSet = stateSet;
|
||||
return false;
|
||||
}
|
||||
|
||||
public int[] getState() {
|
||||
return mStateSet;
|
||||
}
|
||||
|
||||
public void invalidateSelf() {}
|
||||
|
||||
public void setCallback(Callback callback) {}
|
||||
|
||||
public boolean isVisible() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean setVisible (boolean visible, boolean restart) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void clearColorFilter() {}
|
||||
|
||||
public final int getLevel() {return 0;}
|
||||
public final boolean setLevel(int level) {return false;}
|
||||
|
||||
public void setBounds(Rect bounds) {}
|
||||
|
||||
public void setColorFilter(int color, PorterDuff.Mode mode) {}
|
||||
|
||||
public Drawable mutate() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
17
src/api-impl/android/graphics/drawable/GradientDrawable.java
Normal file
17
src/api-impl/android/graphics/drawable/GradientDrawable.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package android.graphics.drawable;
|
||||
|
||||
import android.graphics.Canvas;
|
||||
|
||||
public class GradientDrawable extends Drawable {
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'draw'");
|
||||
}
|
||||
|
||||
public void setColor(int color) {}
|
||||
|
||||
public void setCornerRadius(float cornerRadius) {}
|
||||
|
||||
}
|
||||
14
src/api-impl/android/graphics/drawable/LayerDrawable.java
Normal file
14
src/api-impl/android/graphics/drawable/LayerDrawable.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package android.graphics.drawable;
|
||||
|
||||
import android.graphics.Canvas;
|
||||
|
||||
public class LayerDrawable extends Drawable {
|
||||
|
||||
public LayerDrawable(Drawable[] drawables) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user