summaryrefslogtreecommitdiff
path: root/core/java/android/widget/AnalogClock.java
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2013-09-09 18:09:13 -0700
committerAlan Viverette <alanv@google.com>2013-09-09 18:09:13 -0700
commit617feb99a06e7ffb3894e86a286bf30e085f321a (patch)
tree81366597a0234fc7634effbf7cf9d13e2c5c69e2 /core/java/android/widget/AnalogClock.java
parente668c0a1759d35ce3156bcd830ed07d3fddd2ce4 (diff)
Add View constructor that supplies a default style resource
Also updates the constructor of every class that extends View. BUG: 10676369 Change-Id: Ifaf27bf82028d180afa4931c0e906df88d858ac3
Diffstat (limited to 'core/java/android/widget/AnalogClock.java')
-rw-r--r--core/java/android/widget/AnalogClock.java17
1 files changed, 10 insertions, 7 deletions
diff --git a/core/java/android/widget/AnalogClock.java b/core/java/android/widget/AnalogClock.java
index c7da818907d4..3c88e946a4bc 100644
--- a/core/java/android/widget/AnalogClock.java
+++ b/core/java/android/widget/AnalogClock.java
@@ -67,13 +67,16 @@ public class AnalogClock extends View {
this(context, attrs, 0);
}
- public AnalogClock(Context context, AttributeSet attrs,
- int defStyle) {
- super(context, attrs, defStyle);
- Resources r = mContext.getResources();
- TypedArray a =
- context.obtainStyledAttributes(
- attrs, com.android.internal.R.styleable.AnalogClock, defStyle, 0);
+ public AnalogClock(Context context, AttributeSet attrs, int defStyleAttr) {
+ this(context, attrs, defStyleAttr, 0);
+ }
+
+ public AnalogClock(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
+ super(context, attrs, defStyleAttr, defStyleRes);
+
+ final Resources r = context.getResources();
+ final TypedArray a = context.obtainStyledAttributes(
+ attrs, com.android.internal.R.styleable.AnalogClock, defStyleAttr, defStyleRes);
mDial = a.getDrawable(com.android.internal.R.styleable.AnalogClock_dial);
if (mDial == null) {