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
api-impl: import ToggleButton from AOSP, clean up constructors
taken from AOSP master (commit ed8c91e410671fa153f1587f61d05b303bf94f95)
This commit is contained in:
@@ -8,13 +8,21 @@ import android.util.AttributeSet;
|
||||
public class Button extends TextView {
|
||||
|
||||
public Button(Context context) {
|
||||
super(context);
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public Button(Context context, AttributeSet attributeSet) {
|
||||
super(context, attributeSet);
|
||||
this(context, attributeSet, 0);
|
||||
}
|
||||
|
||||
TypedArray a = context.obtainStyledAttributes(attributeSet, com.android.internal.R.styleable.TextView, 0, 0);
|
||||
public Button(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
this(context, attrs, defStyleAttr, 0);
|
||||
}
|
||||
|
||||
public Button(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, 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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user