2022-10-02 23:06:56 +02:00
|
|
|
package android.widget;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.res.ColorStateList;
|
|
|
|
import android.content.res.TypedArray;
|
2023-06-22 11:45:46 +02:00
|
|
|
import android.graphics.Typeface;
|
2022-10-02 23:06:56 +02:00
|
|
|
import android.text.InputFilter;
|
2023-06-22 11:45:46 +02:00
|
|
|
import android.text.TextPaint;
|
2023-08-17 10:46:24 +02:00
|
|
|
import android.text.TextUtils;
|
2022-10-02 23:06:56 +02:00
|
|
|
import android.text.TextWatcher;
|
2023-08-17 10:46:24 +02:00
|
|
|
import android.text.method.TransformationMethod;
|
2023-06-22 11:45:46 +02:00
|
|
|
import android.util.AttributeSet;
|
2022-10-02 23:06:56 +02:00
|
|
|
import android.view.View;
|
|
|
|
|
|
|
|
public class TextView extends View {
|
|
|
|
public String text;
|
|
|
|
|
|
|
|
public TextView(int _id) { // FIXME
|
|
|
|
id = _id;
|
|
|
|
}
|
|
|
|
|
2023-07-14 18:02:04 +02:00
|
|
|
public TextView(Context context, AttributeSet attrs) {
|
|
|
|
super(context, attrs);
|
2022-10-02 23:06:56 +02:00
|
|
|
|
|
|
|
native_constructor(attrs);
|
|
|
|
}
|
|
|
|
|
|
|
|
public TextView(Context context) {
|
|
|
|
super(context);
|
|
|
|
|
|
|
|
native_constructor(context);
|
|
|
|
}
|
|
|
|
|
2023-08-17 10:46:24 +02:00
|
|
|
public TextView(Context context, AttributeSet attrs, int defStyleAttr) {
|
|
|
|
this(context, attrs);
|
|
|
|
}
|
|
|
|
|
2022-10-02 23:06:56 +02:00
|
|
|
native void native_constructor(AttributeSet attrs);
|
|
|
|
native void native_constructor(Context context);
|
|
|
|
|
|
|
|
public final void setText(CharSequence text) {
|
2023-06-22 11:45:46 +02:00
|
|
|
if (text == null) {
|
2022-10-02 23:06:56 +02:00
|
|
|
native_setText("NULL");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
native_setText(text.toString());
|
|
|
|
|
2023-06-22 11:45:46 +02:00
|
|
|
if (text instanceof android.text.Spanned)
|
2022-10-02 23:06:56 +02:00
|
|
|
native_set_markup(1);
|
|
|
|
}
|
|
|
|
|
2023-07-14 18:02:04 +02:00
|
|
|
public void setText(int resId) {
|
|
|
|
setText(getContext().getResources().getText(resId));
|
|
|
|
}
|
|
|
|
|
2022-10-02 23:06:56 +02:00
|
|
|
private native final void native_set_markup(int bool);
|
|
|
|
|
|
|
|
public native final void native_setText(String text);
|
2023-06-22 11:45:46 +02:00
|
|
|
public native void setTextSize(float size);
|
2022-10-02 23:06:56 +02:00
|
|
|
|
2023-06-22 11:45:46 +02:00
|
|
|
public void setTextColor(int color) {}
|
2022-10-02 23:06:56 +02:00
|
|
|
public void setTextColor(ColorStateList colors) {}
|
2023-06-22 11:45:46 +02:00
|
|
|
public void setTextSize(int unit, float size) {}
|
|
|
|
public void setTypeface(Typeface tf, int style) {}
|
|
|
|
public void setTypeface(Typeface tf) {}
|
|
|
|
public void setLineSpacing(float add, float mult) {}
|
2022-10-02 23:06:56 +02:00
|
|
|
public final void setLinksClickable(boolean whether) {}
|
|
|
|
|
|
|
|
public void setInputType(int type) {}
|
|
|
|
public void setFilters(InputFilter[] filters) {}
|
|
|
|
public void setCursorVisible(boolean visible) {}
|
|
|
|
public void setImeOptions(int imeOptions) {}
|
|
|
|
|
2023-06-22 11:45:46 +02:00
|
|
|
public final ColorStateList getTextColors() { return new ColorStateList(new int[][] {new int[0]}, new int[1]); }
|
|
|
|
public static ColorStateList getTextColors(Context context, TypedArray attrs) { return new ColorStateList(new int[][] {new int[0]}, new int[1]); }
|
2022-10-02 23:06:56 +02:00
|
|
|
|
|
|
|
public TextPaint getPaint() {
|
|
|
|
return new TextPaint();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void addTextChangedListener(TextWatcher watcher) {}
|
2023-06-22 11:45:46 +02:00
|
|
|
public void setOnEditorActionListener(TextView.OnEditorActionListener l) {}
|
2022-10-02 23:06:56 +02:00
|
|
|
|
2023-08-17 10:46:24 +02:00
|
|
|
public TransformationMethod getTransformationMethod() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setHintTextColor(ColorStateList colorStateList) {}
|
|
|
|
public void setLinkTextColor(ColorStateList colorStateList) {}
|
|
|
|
|
|
|
|
public void setSingleLine() {}
|
|
|
|
|
|
|
|
public void setEllipsize(TextUtils.TruncateAt truncateAt) {}
|
|
|
|
|
|
|
|
public void setTextAppearance(Context context, int appearance) {}
|
|
|
|
|
|
|
|
public void setMaxLines(int maxLines) {}
|
|
|
|
|
|
|
|
public void setMinWidth(int minWidth) {}
|
|
|
|
public void setMaxWidth(int maxWidth) {}
|
|
|
|
|
2022-10-02 23:06:56 +02:00
|
|
|
public static interface OnEditorActionListener {
|
|
|
|
}
|
|
|
|
}
|