mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-04-30 05:07:58 +03:00
api-impl: import ToggleButton from AOSP, clean up constructors
taken from AOSP master (commit ed8c91e410671fa153f1587f61d05b303bf94f95)
This commit is contained in:
parent
da406ec4c2
commit
bf79a77993
6 changed files with 227 additions and 11 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue