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 lots of java APIs needed for Whatsapp
This commit is contained in:
@@ -282,7 +282,7 @@ public class ArrayAdapter<T> extends BaseAdapter /*implements Filterable*/ {
|
||||
}
|
||||
private void init(Context context, int resource, int textViewResourceId, List<T> objects) {
|
||||
mContext = context;
|
||||
mInflater = new LayoutInflater();
|
||||
mInflater = new LayoutInflater(context);
|
||||
mResource = mDropDownResource = resource;
|
||||
mObjects = objects;
|
||||
mFieldId = textViewResourceId;
|
||||
|
||||
@@ -5,7 +5,6 @@ import android.content.res.ColorStateList;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
@@ -17,6 +16,7 @@ public class ImageView extends View {
|
||||
|
||||
private Bitmap bitmap = null;
|
||||
private ScaleType scaleType = ScaleType.FIT_CENTER;
|
||||
private Drawable drawable = null;
|
||||
|
||||
public ImageView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
@@ -56,20 +56,11 @@ public class ImageView extends View {
|
||||
}
|
||||
|
||||
public Drawable getDrawable() {
|
||||
if(bitmap == null) {
|
||||
return new Drawable() {
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'draw'");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return new BitmapDrawable(getContext().getResources(), bitmap);
|
||||
return drawable;
|
||||
}
|
||||
|
||||
public void setImageDrawable(Drawable drawable) {
|
||||
this.drawable = drawable;
|
||||
if (drawable instanceof BitmapDrawable) {
|
||||
setImageBitmap(((BitmapDrawable) drawable).getBitmap());
|
||||
} else if (drawable != null && drawable.paintable != 0) {
|
||||
|
||||
@@ -8,9 +8,11 @@ import android.graphics.drawable.Drawable;
|
||||
import android.text.Editable;
|
||||
import android.text.InputFilter;
|
||||
import android.text.Layout;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.TextPaint;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.text.method.BaseMovementMethod;
|
||||
import android.text.method.KeyListener;
|
||||
import android.text.method.MovementMethod;
|
||||
import android.text.method.TransformationMethod;
|
||||
@@ -210,7 +212,7 @@ public class TextView extends View {
|
||||
}
|
||||
|
||||
public MovementMethod getMovementMethod() {
|
||||
return new MovementMethod();
|
||||
return new BaseMovementMethod();
|
||||
}
|
||||
|
||||
public CharSequence getHint() {return "HINT";}
|
||||
@@ -268,4 +270,12 @@ public class TextView extends View {
|
||||
public int length() {
|
||||
return getText().length();
|
||||
}
|
||||
|
||||
public void setHighlightColor(int color) {}
|
||||
|
||||
public Editable getEditableText() {
|
||||
return new SpannableStringBuilder(getText());
|
||||
}
|
||||
|
||||
public int getMaxWidth() {return 1000;}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user