diff --git a/library/pom.xml b/library/pom.xml index df3dae9..f023b38 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -17,7 +17,7 @@ - com.google.android + android android provided diff --git a/library/project.properties b/library/project.properties index 96db742..5ca7d62 100644 --- a/library/project.properties +++ b/library/project.properties @@ -9,4 +9,4 @@ android.library=true # Project target. -target=android-4 +target=android-14 diff --git a/library/src/com/jakewharton/nineoldandroids/AnimatorInflater.java b/library/src/com/jakewharton/nineoldandroids/AnimatorInflater.java index 5f2122f..5525ff0 100644 --- a/library/src/com/jakewharton/nineoldandroids/AnimatorInflater.java +++ b/library/src/com/jakewharton/nineoldandroids/AnimatorInflater.java @@ -40,6 +40,35 @@ * something file.) */ public class AnimatorInflater { + private static final int[] AnimatorSet = new int[] { + /* 0 */ android.R.attr.ordering, + }; + private static final int AnimatorSet_ordering = 0; + + private static final int[] PropertyAnimator = new int[] { + /* 0 */ android.R.attr.propertyName, + }; + private static final int PropertyAnimator_propertyName = 0; + + private static final int[] Animator = new int[] { + /* 0 */ android.R.attr.duration, + /* 1 */ android.R.attr.startOffset, + /* 2 */ android.R.attr.valueType, + /* 3 */ android.R.attr.valueFrom, + /* 4 */ android.R.attr.valueTo, + /* 5 */ android.R.attr.repeatCount, + /* 6 */ android.R.attr.repeatMode, + /* 7 */ android.R.attr.interpolator, + }; + private static final int Animator_duration = 0; + private static final int Animator_startOffset = 1; + private static final int Animator_valueType = 2; + private static final int Animator_valueFrom = 3; + private static final int Animator_valueTo = 4; + private static final int Animator_repeatCount = 5; + private static final int Animator_repeatMode = 6; + private static final int Animator_interpolator = 7; + /** * These flags are used when parsing AnimatorSet objects */ @@ -119,8 +148,8 @@ private static Animator createAnimatorFromXml(Context c, XmlPullParser parser, } else if (name.equals("set")) { anim = new AnimatorSet(); TypedArray a = c.obtainStyledAttributes(attrs, - com.jakewharton.nineoldandroids.internal.FakeR.styleable.AnimatorSet); - int ordering = a.getInt(com.jakewharton.nineoldandroids.internal.FakeR.styleable.AnimatorSet_ordering, + /*com.android.internal.R.styleable.*/AnimatorSet); + int ordering = a.getInt(/*com.android.internal.R.styleable.*/AnimatorSet_ordering, TOGETHER); createAnimatorFromXml(c, parser, attrs, (AnimatorSet) anim, ordering); a.recycle(); @@ -160,9 +189,9 @@ private static ObjectAnimator loadObjectAnimator(Context context, AttributeSet a loadAnimator(context, attrs, anim); TypedArray a = - context.obtainStyledAttributes(attrs, com.jakewharton.nineoldandroids.internal.FakeR.styleable.PropertyAnimator); + context.obtainStyledAttributes(attrs, /*com.android.internal.R.styleable.*/PropertyAnimator); - String propertyName = a.getString(com.jakewharton.nineoldandroids.internal.FakeR.styleable.PropertyAnimator_propertyName); + String propertyName = a.getString(/*com.android.internal.R.styleable.*/PropertyAnimator_propertyName); anim.setPropertyName(propertyName); @@ -182,13 +211,13 @@ private static ValueAnimator loadAnimator(Context context, AttributeSet attrs, V throws NotFoundException { TypedArray a = - context.obtainStyledAttributes(attrs, com.jakewharton.nineoldandroids.internal.FakeR.styleable.Animator); + context.obtainStyledAttributes(attrs, /*com.android.internal.R.styleable.*/Animator); - long duration = a.getInt(com.jakewharton.nineoldandroids.internal.FakeR.styleable.Animator_duration, 0); + long duration = a.getInt(/*com.android.internal.R.styleable.*/Animator_duration, 0); - long startDelay = a.getInt(com.jakewharton.nineoldandroids.internal.FakeR.styleable.Animator_startOffset, 0); + long startDelay = a.getInt(/*com.android.internal.R.styleable.*/Animator_startOffset, 0); - int valueType = a.getInt(com.jakewharton.nineoldandroids.internal.FakeR.styleable.Animator_valueType, + int valueType = a.getInt(/*com.android.internal.R.styleable.*/Animator_valueType, VALUE_TYPE_FLOAT); if (anim == null) { @@ -196,8 +225,8 @@ private static ValueAnimator loadAnimator(Context context, AttributeSet attrs, V } //TypeEvaluator evaluator = null; - int valueFromIndex = com.jakewharton.nineoldandroids.internal.FakeR.styleable.Animator_valueFrom; - int valueToIndex = com.jakewharton.nineoldandroids.internal.FakeR.styleable.Animator_valueTo; + int valueFromIndex = /*com.android.internal.R.styleable.*/Animator_valueFrom; + int valueToIndex = /*com.android.internal.R.styleable.*/Animator_valueTo; boolean getFloats = (valueType == VALUE_TYPE_FLOAT); @@ -287,13 +316,13 @@ private static ValueAnimator loadAnimator(Context context, AttributeSet attrs, V anim.setDuration(duration); anim.setStartDelay(startDelay); - if (a.hasValue(com.jakewharton.nineoldandroids.internal.FakeR.styleable.Animator_repeatCount)) { + if (a.hasValue(/*com.android.internal.R.styleable.*/Animator_repeatCount)) { anim.setRepeatCount( - a.getInt(com.jakewharton.nineoldandroids.internal.FakeR.styleable.Animator_repeatCount, 0)); + a.getInt(/*com.android.internal.R.styleable.*/Animator_repeatCount, 0)); } - if (a.hasValue(com.jakewharton.nineoldandroids.internal.FakeR.styleable.Animator_repeatMode)) { + if (a.hasValue(/*com.android.internal.R.styleable.*/Animator_repeatMode)) { anim.setRepeatMode( - a.getInt(com.jakewharton.nineoldandroids.internal.FakeR.styleable.Animator_repeatMode, + a.getInt(/*com.android.internal.R.styleable.*/Animator_repeatMode, ValueAnimator.RESTART)); } //if (evaluator != null) { @@ -301,7 +330,7 @@ private static ValueAnimator loadAnimator(Context context, AttributeSet attrs, V //} final int resID = - a.getResourceId(com.jakewharton.nineoldandroids.internal.FakeR.styleable.Animator_interpolator, 0); + a.getResourceId(/*com.android.internal.R.styleable.*/Animator_interpolator, 0); if (resID > 0) { anim.setInterpolator(AnimationUtils.loadInterpolator(context, resID)); } diff --git a/library/src/com/jakewharton/nineoldandroids/internal/FakeR.java b/library/src/com/jakewharton/nineoldandroids/internal/FakeR.java deleted file mode 100644 index 15944ce..0000000 --- a/library/src/com/jakewharton/nineoldandroids/internal/FakeR.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.jakewharton.nineoldandroids.internal; - -/** - * Mirrors frameworks/base/core/res/res/values/public.xml values which should - * be stable across platforms since any changes would break functionality. - */ -public final class FakeR { - public static final class attr { - public static final int duration = 0x01010198; - public static final int interpolator = 0x01010141; - public static final int ordering = 0x010102e2; - public static final int propertyName = 0x010102e1; - public static final int repeatCount = 0x010101bf; - public static final int repeatMode = 0x010101c0; - public static final int startOffset = 0x010101be; - public static final int valueFrom = 0x010102de; - public static final int valueTo = 0x010102df; - public static final int valueType = 0x010102e0; - } - - public static final class styleable { - public static final int[] AnimatorSet = new int[] { - FakeR.attr.ordering, - }; - public static final int AnimatorSet_ordering = 0; - - public static final int[] PropertyAnimator = new int[] { - FakeR.attr.propertyName, - }; - public static final int PropertyAnimator_propertyName = 0; - - public static final int[] Animator = new int[] { - FakeR.attr.duration, - FakeR.attr.startOffset, - FakeR.attr.valueType, - FakeR.attr.valueFrom, - FakeR.attr.valueTo, - FakeR.attr.repeatCount, - FakeR.attr.repeatMode, - FakeR.attr.interpolator, - }; - public static final int Animator_duration = 0; - public static final int Animator_startOffset = 1; - public static final int Animator_valueType = 2; - public static final int Animator_valueFrom = 3; - public static final int Animator_valueTo = 4; - public static final int Animator_repeatCount = 5; - public static final int Animator_repeatMode = 6; - public static final int Animator_interpolator = 7; - } -} diff --git a/pom.xml b/pom.xml index af3b5fb..cf2bab6 100644 --- a/pom.xml +++ b/pom.xml @@ -73,14 +73,14 @@ UTF-8 1.6 - 1.6_r2 - 4 + 4.0_r1 + 14 - com.google.android + android android ${android.version} diff --git a/sample/pom.xml b/sample/pom.xml index d710f24..506e2c2 100644 --- a/sample/pom.xml +++ b/sample/pom.xml @@ -17,7 +17,7 @@ - com.google.android + android android provided