ImageButton: set the defStyleAttr

This commit is contained in:
Julian Winkler
2024-12-20 17:08:10 +01:00
parent 2e11934bcf
commit f9db8faebd
2 changed files with 73 additions and 75 deletions

View File

@@ -904,7 +904,6 @@ public class View implements Drawable.Callback {
widget = native_constructor(context, attrs);
if (attrs != null) {
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);
if (a.hasValue(com.android.internal.R.styleable.View_background)) {
@@ -980,7 +979,6 @@ public class View implements Drawable.Callback {
}
a.recycle();
}
onCreateDrawableState(0);
}

View File

@@ -6,11 +6,11 @@ import android.util.AttributeSet;
public class ImageButton extends ImageView {
public ImageButton(Context context) {
super(context);
this(context, null);
}
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) {