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:
@@ -15,6 +15,7 @@ JNIEXPORT jlong JNICALL Java_android_widget_TextView_native_1constructor(JNIEnv
|
||||
|
||||
GtkWidget *wrapper = g_object_ref(wrapper_widget_new());
|
||||
GtkWidget *label = gtk_label_new(text);
|
||||
gtk_label_set_wrap(GTK_LABEL(label), TRUE);
|
||||
wrapper_widget_set_child(WRAPPER_WIDGET(wrapper), label);
|
||||
return _INTPTR(label);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,9 @@ package android.animation;
|
||||
|
||||
public class Animator {
|
||||
|
||||
public interface AnimatorListener {
|
||||
}
|
||||
|
||||
public void setTarget(Object target) {}
|
||||
|
||||
public void start() {}
|
||||
|
||||
@@ -5,7 +5,7 @@ import android.content.Context;
|
||||
public class AnimatorInflater {
|
||||
|
||||
public static Animator loadAnimator(Context context, int resId) {
|
||||
return new Animator();
|
||||
return new ObjectAnimator();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
5
src/api-impl/android/animation/AnimatorSet.java
Normal file
5
src/api-impl/android/animation/AnimatorSet.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package android.animation;
|
||||
|
||||
public class AnimatorSet extends Animator {
|
||||
|
||||
}
|
||||
9
src/api-impl/android/animation/ObjectAnimator.java
Normal file
9
src/api-impl/android/animation/ObjectAnimator.java
Normal file
@@ -0,0 +1,9 @@
|
||||
package android.animation;
|
||||
|
||||
public class ObjectAnimator extends ValueAnimator {
|
||||
|
||||
public String getPropertyName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
37
src/api-impl/android/animation/TimeInterpolator.java
Normal file
37
src/api-impl/android/animation/TimeInterpolator.java
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (C) 2010 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.animation;
|
||||
|
||||
/**
|
||||
* A time interpolator defines the rate of change of an animation. This allows animations
|
||||
* to have non-linear motion, such as acceleration and deceleration.
|
||||
*/
|
||||
public interface TimeInterpolator {
|
||||
/**
|
||||
* Maps a value representing the elapsed fraction of an animation to a value that represents
|
||||
* the interpolated fraction. This interpolated value is then multiplied by the change in
|
||||
* value of an animation to derive the animated value at the current elapsed animation time.
|
||||
*
|
||||
* @param input A value between 0 and 1.0 indicating our current point
|
||||
* in the animation where 0 represents the start and 1.0 represents
|
||||
* the end
|
||||
* @return The interpolation value. This value can be more than 1.0 for
|
||||
* interpolators which overshoot their targets, or less than 0 for
|
||||
* interpolators that undershoot their targets.
|
||||
*/
|
||||
float getInterpolation(float input);
|
||||
}
|
||||
5
src/api-impl/android/animation/TypeEvaluator.java
Normal file
5
src/api-impl/android/animation/TypeEvaluator.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package android.animation;
|
||||
|
||||
public interface TypeEvaluator {
|
||||
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package android.animation;
|
||||
|
||||
public class ValueAnimator {
|
||||
final class PropertyValuesHolder{}
|
||||
|
||||
public class ValueAnimator extends Animator {
|
||||
|
||||
public static ValueAnimator ofFloat(float... values) {
|
||||
return new ValueAnimator();
|
||||
@@ -16,6 +18,19 @@ public class ValueAnimator {
|
||||
return 20; // 20ms frame interval
|
||||
}
|
||||
|
||||
public PropertyValuesHolder[] getValues() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public long getStartDelay() {return 0;}
|
||||
public long getDuration() {return 0;}
|
||||
public TimeInterpolator getInterpolator() {return null;}
|
||||
public int getRepeatCount() {return 0;}
|
||||
public int getRepeatMode() {return 0;}
|
||||
public void setInterpolator(TimeInterpolator interpolator) {}
|
||||
public void addListener(Animator.AnimatorListener listener) {}
|
||||
public void setFloatValues(float[] values) {}
|
||||
|
||||
/**
|
||||
* Implementors of this interface can add themselves as update listeners
|
||||
* to an <code>ValueAnimator</code> instance to receive callbacks on every animation
|
||||
|
||||
@@ -329,6 +329,8 @@ public class Activity extends Context {
|
||||
return "Title";
|
||||
}
|
||||
|
||||
public boolean isChangingConfigurations() {return false;}
|
||||
|
||||
private native void nativeFinish(long native_window);
|
||||
private static native void nativeStartActivity(Activity activity);
|
||||
}
|
||||
|
||||
5
src/api-impl/android/app/SharedElementCallback.java
Normal file
5
src/api-impl/android/app/SharedElementCallback.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package android.app;
|
||||
|
||||
public class SharedElementCallback {
|
||||
|
||||
}
|
||||
@@ -358,4 +358,6 @@ public class Context extends Object {
|
||||
public final CharSequence getText(int resId) {
|
||||
return getResources().getText(resId);
|
||||
}
|
||||
|
||||
public boolean isRestricted() {return false;}
|
||||
}
|
||||
|
||||
@@ -329,6 +329,8 @@ public class TypedArray {
|
||||
public ColorStateList getColorStateList(int index) {
|
||||
final TypedValue value = mValue;
|
||||
if (getValueAt(index * AssetManager.STYLE_NUM_ENTRIES, value)) {
|
||||
if (value.type == -1)
|
||||
return null;
|
||||
return mResources.loadColorStateList(value, value.resourceId);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -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'");
|
||||
}
|
||||
|
||||
}
|
||||
12
src/api-impl/android/text/Layout.java
Normal file
12
src/api-impl/android/text/Layout.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package android.text;
|
||||
|
||||
public class Layout {
|
||||
|
||||
public enum Alignment {
|
||||
ALIGN_NORMAL,
|
||||
ALIGN_OPPOSITE,
|
||||
ALIGN_CENTER,
|
||||
ALIGN_LEFT,
|
||||
ALIGN_RIGHT,
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user