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
ImageButton: set the defStyleAttr
This commit is contained in:
@@ -904,7 +904,6 @@ public class View implements Drawable.Callback {
|
|||||||
|
|
||||||
widget = native_constructor(context, attrs);
|
widget = native_constructor(context, attrs);
|
||||||
|
|
||||||
if (attrs != null) {
|
|
||||||
TypedArray a = context.obtainStyledAttributes(attrs, com.android.internal.R.styleable.View, defStyle, defStyleRes);
|
TypedArray a = context.obtainStyledAttributes(attrs, com.android.internal.R.styleable.View, defStyle, defStyleRes);
|
||||||
this.id = a.getResourceId(com.android.internal.R.styleable.View_id, View.NO_ID);
|
this.id = a.getResourceId(com.android.internal.R.styleable.View_id, View.NO_ID);
|
||||||
if (a.hasValue(com.android.internal.R.styleable.View_background)) {
|
if (a.hasValue(com.android.internal.R.styleable.View_background)) {
|
||||||
@@ -980,7 +979,6 @@ public class View implements Drawable.Callback {
|
|||||||
}
|
}
|
||||||
|
|
||||||
a.recycle();
|
a.recycle();
|
||||||
}
|
|
||||||
onCreateDrawableState(0);
|
onCreateDrawableState(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ import android.util.AttributeSet;
|
|||||||
public class ImageButton extends ImageView {
|
public class ImageButton extends ImageView {
|
||||||
|
|
||||||
public ImageButton(Context context) {
|
public ImageButton(Context context) {
|
||||||
super(context);
|
this(context, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImageButton(Context context, AttributeSet attributeSet) {
|
public ImageButton(Context context, AttributeSet attributeSet) {
|
||||||
super(context, attributeSet);
|
super(context, attributeSet, com.android.internal.R.attr.imageButtonStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImageButton(Context context, AttributeSet attributeSet, int defStyleAttr) {
|
public ImageButton(Context context, AttributeSet attributeSet, int defStyleAttr) {
|
||||||
|
|||||||
Reference in New Issue
Block a user