2023-08-17 10:46:24 +02:00
|
|
|
package android.widget;
|
|
|
|
|
|
|
|
import android.content.Context;
|
2023-08-22 13:51:37 +02:00
|
|
|
import android.content.res.TypedArray;
|
2024-03-30 11:04:21 +01:00
|
|
|
import android.graphics.drawable.Drawable;
|
2023-08-17 10:46:24 +02:00
|
|
|
import android.util.AttributeSet;
|
|
|
|
|
2023-09-01 12:55:04 +02:00
|
|
|
public class Button extends TextView {
|
2023-08-17 10:46:24 +02:00
|
|
|
|
|
|
|
public Button(Context context) {
|
|
|
|
super(context);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Button(Context context, AttributeSet attributeSet) {
|
|
|
|
super(context, attributeSet);
|
2023-08-22 13:51:37 +02:00
|
|
|
|
|
|
|
TypedArray a = context.obtainStyledAttributes(attributeSet, com.android.internal.R.styleable.TextView, 0, 0);
|
|
|
|
if (a.hasValue(com.android.internal.R.styleable.TextView_text)) {
|
|
|
|
setText(a.getText(com.android.internal.R.styleable.TextView_text));
|
|
|
|
}
|
2024-11-18 14:08:07 +01:00
|
|
|
|
|
|
|
if(getBackground() != null){
|
|
|
|
native_addClass(widget, "ATL-no-border");
|
|
|
|
}
|
2023-08-22 13:51:37 +02:00
|
|
|
a.recycle();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected native long native_constructor(Context context, AttributeSet attrs);
|
|
|
|
public native final void native_setText(long widget, String text);
|
2024-07-26 21:47:08 +02:00
|
|
|
@Override
|
|
|
|
protected native void nativeSetOnClickListener(long widget);
|
2023-08-22 13:51:37 +02:00
|
|
|
|
2023-09-01 12:55:04 +02:00
|
|
|
@Override
|
2024-02-15 21:08:13 +01:00
|
|
|
public void setText(CharSequence text) {
|
2023-08-22 13:51:37 +02:00
|
|
|
native_setText(widget, String.valueOf(text));
|
|
|
|
}
|
|
|
|
|
2024-03-16 12:49:28 +01:00
|
|
|
@Override
|
2024-08-25 11:20:01 +02:00
|
|
|
public native CharSequence getText();
|
2024-03-16 12:49:28 +01:00
|
|
|
|
2023-09-01 12:55:04 +02:00
|
|
|
@Override
|
|
|
|
public void setTextSize(float size) {}
|
|
|
|
|
2024-03-30 11:04:21 +01:00
|
|
|
@Override
|
|
|
|
public void setCompoundDrawables(Drawable left, Drawable top, Drawable right, Drawable bottom) {}
|
|
|
|
|
2023-08-17 10:46:24 +02:00
|
|
|
}
|