From 617feb99a06e7ffb3894e86a286bf30e085f321a Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Mon, 9 Sep 2013 18:09:13 -0700 Subject: Add View constructor that supplies a default style resource Also updates the constructor of every class that extends View. BUG: 10676369 Change-Id: Ifaf27bf82028d180afa4931c0e906df88d858ac3 --- core/java/android/widget/CompoundButton.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'core/java/android/widget/CompoundButton.java') diff --git a/core/java/android/widget/CompoundButton.java b/core/java/android/widget/CompoundButton.java index 05a8dc825e12..da94082afa3f 100644 --- a/core/java/android/widget/CompoundButton.java +++ b/core/java/android/widget/CompoundButton.java @@ -64,12 +64,15 @@ public abstract class CompoundButton extends Button implements Checkable { this(context, attrs, 0); } - public CompoundButton(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); + public CompoundButton(Context context, AttributeSet attrs, int defStyleAttr) { + this(context, attrs, defStyleAttr, 0); + } + + public CompoundButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); - TypedArray a = - context.obtainStyledAttributes( - attrs, com.android.internal.R.styleable.CompoundButton, defStyle, 0); + final TypedArray a = context.obtainStyledAttributes( + attrs, com.android.internal.R.styleable.CompoundButton, defStyleAttr, defStyleRes); Drawable d = a.getDrawable(com.android.internal.R.styleable.CompoundButton_button); if (d != null) { -- cgit v1.2.3