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 missing Context attribute to all View constructors
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
package android.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
public class EditText extends TextView {
|
||||
public EditText(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public EditText(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ import android.view.ViewGroup.LayoutParams;
|
||||
|
||||
public class FrameLayout extends ViewGroup {
|
||||
|
||||
public FrameLayout(AttributeSet attrs) {
|
||||
super(attrs);
|
||||
public FrameLayout(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
native_constructor(attrs);
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ public class ImageView extends View {
|
||||
|
||||
private Bitmap bitmap;
|
||||
|
||||
public ImageView(AttributeSet attrs) {
|
||||
super(attrs);
|
||||
public ImageView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
native_constructor(attrs);
|
||||
int resource = attrs.getAttributeResourceValue("http://schemas.android.com/apk/res/android", "src", 0);
|
||||
|
||||
@@ -10,8 +10,8 @@ public class LinearLayout extends ViewGroup {
|
||||
|
||||
boolean orientation;
|
||||
|
||||
public LinearLayout(AttributeSet attrs) {
|
||||
super(attrs);
|
||||
public LinearLayout(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
native_constructor(attrs);
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@ import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
public class ProgressBar extends View {
|
||||
public ProgressBar(AttributeSet attrs) {
|
||||
super(attrs);
|
||||
public ProgressBar(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
native_constructor(attrs);
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@ public class RelativeLayout extends ViewGroup {
|
||||
|
||||
boolean orientation;
|
||||
|
||||
public RelativeLayout(AttributeSet attrs) {
|
||||
super(attrs);
|
||||
public RelativeLayout(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
native_constructor(attrs);
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ import android.view.ViewGroup;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
|
||||
public class ScrollView extends ViewGroup {
|
||||
public ScrollView(AttributeSet attrs) {
|
||||
super(attrs);
|
||||
public ScrollView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
native_constructor(attrs);
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ public class TextView extends View {
|
||||
id = _id;
|
||||
}
|
||||
|
||||
public TextView(AttributeSet attrs) {
|
||||
super(attrs);
|
||||
public TextView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
native_constructor(attrs);
|
||||
}
|
||||
@@ -44,6 +44,10 @@ public class TextView extends View {
|
||||
native_set_markup(1);
|
||||
}
|
||||
|
||||
public void setText(int resId) {
|
||||
setText(getContext().getResources().getText(resId));
|
||||
}
|
||||
|
||||
private native final void native_set_markup(int bool);
|
||||
|
||||
public native final void native_setText(String text);
|
||||
|
||||
Reference in New Issue
Block a user