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:
19
src/api-impl/android/widget/AutoCompleteTextView.java
Normal file
19
src/api-impl/android/widget/AutoCompleteTextView.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package android.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
public class AutoCompleteTextView extends TextView {
|
||||
|
||||
public interface OnDismissListener {
|
||||
}
|
||||
|
||||
public AutoCompleteTextView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public AutoCompleteTextView(Context context, AttributeSet attributeSet) {
|
||||
super(context, attributeSet);
|
||||
}
|
||||
|
||||
}
|
||||
4
src/api-impl/android/widget/Checkable.java
Normal file
4
src/api-impl/android/widget/Checkable.java
Normal file
@@ -0,0 +1,4 @@
|
||||
package android.widget;
|
||||
|
||||
public interface Checkable {
|
||||
}
|
||||
@@ -54,5 +54,10 @@ public class FrameLayout extends ViewGroup {
|
||||
this.height = height;
|
||||
this.gravity = gravity;
|
||||
}
|
||||
|
||||
public LayoutParams (ViewGroup.LayoutParams params) {
|
||||
this.width = params.width;
|
||||
this.height = params.height;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package android.widget;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
@@ -50,6 +51,8 @@ public class ImageView extends View {
|
||||
|
||||
public void setImageDrawable(Drawable drawable) {}
|
||||
|
||||
public void setImageMatrix(Matrix matrix) {}
|
||||
|
||||
/**
|
||||
* Options for scaling the bounds of an image to the bounds of this view.
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,16 @@ public class LinearLayout extends ViewGroup {
|
||||
public native void setOrientation(int orientation);
|
||||
public void setWeightSum(float weightSum) {}
|
||||
|
||||
public static class LayoutParams extends ViewGroup.LayoutParams {
|
||||
@Override
|
||||
public LayoutParams generateLayoutParams(AttributeSet attrs) {
|
||||
return new LayoutParams(getContext(), attrs);
|
||||
}
|
||||
|
||||
public static class LayoutParams extends ViewGroup.MarginLayoutParams {
|
||||
public LayoutParams (Context c, AttributeSet attrs) {
|
||||
super(c, attrs);
|
||||
}
|
||||
|
||||
public LayoutParams(int width, int height) {
|
||||
super(width, height);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,5 @@ public class ScrollView extends ViewGroup {
|
||||
@Override
|
||||
protected native void native_removeView(long widget, long child);
|
||||
|
||||
protected void onScrollChanged(int x, int y, int oldx, int oldy) {}
|
||||
public void setFillViewport(boolean fillViewport) {}
|
||||
}
|
||||
|
||||
17
src/api-impl/android/widget/Spinner.java
Normal file
17
src/api-impl/android/widget/Spinner.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package android.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
public class Spinner extends View {
|
||||
|
||||
public Spinner(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public Spinner(Context context, AttributeSet attributeSet) {
|
||||
super(context, attributeSet);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.text.method.TransformationMethod;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
|
||||
public class TextView extends View {
|
||||
@@ -20,15 +21,21 @@ public class TextView extends View {
|
||||
}
|
||||
|
||||
public TextView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public TextView(Context context) {
|
||||
super(context);
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public TextView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
this(context, attrs);
|
||||
super(context, attrs, defStyleAttr);
|
||||
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, com.android.internal.R.styleable.TextView, defStyleAttr, 0);
|
||||
if (a.hasValue(com.android.internal.R.styleable.TextView_text)) {
|
||||
setText(a.getText(com.android.internal.R.styleable.TextView_text));
|
||||
}
|
||||
a.recycle();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -96,6 +103,17 @@ public class TextView extends View {
|
||||
public void setMinWidth(int minWidth) {}
|
||||
public void setMaxWidth(int maxWidth) {}
|
||||
|
||||
public Typeface getTypeface() {return null;}
|
||||
|
||||
public float getTextSize() {return 10;}
|
||||
|
||||
public int getGravity() {
|
||||
return Gravity.CENTER;
|
||||
}
|
||||
|
||||
public int getCompoundPaddingTop() {return 0;}
|
||||
public int getCompoundPaddingBottom() {return 0;}
|
||||
|
||||
public static interface OnEditorActionListener {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user