Merge "Remove synchronous bluetooth callbacks"
diff --git a/api/current.xml b/api/current.xml
index 1d84c39..6677a90 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -20416,7 +20416,7 @@
</parameter>
</method>
<method name="setDuration"
- return="void"
+ return="android.animation.Animator"
abstract="true"
native="false"
synchronized="false"
@@ -20766,7 +20766,7 @@
</parameter>
</method>
<method name="setDuration"
- return="void"
+ return="android.animation.AnimatorSet"
abstract="false"
native="false"
synchronized="false"
@@ -21536,36 +21536,6 @@
visibility="public"
>
</constructor>
-<constructor name="ObjectAnimator"
- type="android.animation.ObjectAnimator"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="duration" type="long">
-</parameter>
-<parameter name="target" type="java.lang.Object">
-</parameter>
-<parameter name="propertyName" type="java.lang.String">
-</parameter>
-<parameter name="values" type="T...">
-</parameter>
-</constructor>
-<constructor name="ObjectAnimator"
- type="android.animation.ObjectAnimator"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="duration" type="long">
-</parameter>
-<parameter name="target" type="java.lang.Object">
-</parameter>
-<parameter name="values" type="android.animation.PropertyValuesHolder...">
-</parameter>
-</constructor>
<method name="getPropertyName"
return="java.lang.String"
abstract="false"
@@ -21588,6 +21558,108 @@
visibility="public"
>
</method>
+<method name="ofDouble"
+ return="android.animation.ObjectAnimator"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="target" type="java.lang.Object">
+</parameter>
+<parameter name="propertyName" type="java.lang.String">
+</parameter>
+<parameter name="values" type="double...">
+</parameter>
+</method>
+<method name="ofFloat"
+ return="android.animation.ObjectAnimator"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="target" type="java.lang.Object">
+</parameter>
+<parameter name="propertyName" type="java.lang.String">
+</parameter>
+<parameter name="values" type="float...">
+</parameter>
+</method>
+<method name="ofInt"
+ return="android.animation.ObjectAnimator"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="target" type="java.lang.Object">
+</parameter>
+<parameter name="propertyName" type="java.lang.String">
+</parameter>
+<parameter name="values" type="int...">
+</parameter>
+</method>
+<method name="ofLong"
+ return="android.animation.ObjectAnimator"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="target" type="java.lang.Object">
+</parameter>
+<parameter name="propertyName" type="java.lang.String">
+</parameter>
+<parameter name="values" type="long...">
+</parameter>
+</method>
+<method name="ofObject"
+ return="android.animation.ObjectAnimator"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="target" type="java.lang.Object">
+</parameter>
+<parameter name="propertyName" type="java.lang.String">
+</parameter>
+<parameter name="evaluator" type="android.animation.TypeEvaluator">
+</parameter>
+<parameter name="values" type="java.lang.Object...">
+</parameter>
+</method>
+<method name="ofPropertyValuesHolder"
+ return="android.animation.ObjectAnimator"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="target" type="java.lang.Object">
+</parameter>
+<parameter name="values" type="android.animation.PropertyValuesHolder...">
+</parameter>
+</method>
<method name="setPropertyName"
return="void"
abstract="false"
@@ -21612,28 +21684,6 @@
>
<implements name="java.lang.Cloneable">
</implements>
-<constructor name="PropertyValuesHolder"
- type="android.animation.PropertyValuesHolder"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="values" type="T...">
-</parameter>
-</constructor>
-<constructor name="PropertyValuesHolder"
- type="android.animation.PropertyValuesHolder"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="propertyName" type="java.lang.String">
-</parameter>
-<parameter name="values" type="T...">
-</parameter>
-</constructor>
<method name="clone"
return="android.animation.PropertyValuesHolder"
abstract="false"
@@ -21678,6 +21728,111 @@
visibility="public"
>
</method>
+<method name="ofDouble"
+ return="android.animation.PropertyValuesHolder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="propertyName" type="java.lang.String">
+</parameter>
+<parameter name="values" type="double...">
+</parameter>
+</method>
+<method name="ofFloat"
+ return="android.animation.PropertyValuesHolder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="propertyName" type="java.lang.String">
+</parameter>
+<parameter name="values" type="float...">
+</parameter>
+</method>
+<method name="ofInt"
+ return="android.animation.PropertyValuesHolder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="propertyName" type="java.lang.String">
+</parameter>
+<parameter name="values" type="int...">
+</parameter>
+</method>
+<method name="ofKeyframe"
+ return="android.animation.PropertyValuesHolder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="propertyName" type="java.lang.String">
+</parameter>
+<parameter name="values" type="android.animation.Keyframe...">
+</parameter>
+</method>
+<method name="ofLong"
+ return="android.animation.PropertyValuesHolder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="propertyName" type="java.lang.String">
+</parameter>
+<parameter name="values" type="long...">
+</parameter>
+</method>
+<method name="ofObject"
+ return="android.animation.PropertyValuesHolder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="propertyName" type="java.lang.String">
+</parameter>
+<parameter name="evaluator" type="android.animation.TypeEvaluator">
+</parameter>
+<parameter name="values" type="java.lang.Object...">
+</parameter>
+</method>
+<method name="setDoubleValues"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="values" type="double...">
+</parameter>
+</method>
<method name="setEvaluator"
return="void"
abstract="false"
@@ -21691,6 +21846,19 @@
<parameter name="evaluator" type="android.animation.TypeEvaluator">
</parameter>
</method>
+<method name="setFloatValues"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="values" type="float...">
+</parameter>
+</method>
<method name="setGetter"
return="void"
abstract="false"
@@ -21704,6 +21872,58 @@
<parameter name="getter" type="java.lang.reflect.Method">
</parameter>
</method>
+<method name="setIntValues"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="values" type="int...">
+</parameter>
+</method>
+<method name="setKeyframes"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="values" type="android.animation.Keyframe...">
+</parameter>
+</method>
+<method name="setLongValues"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="values" type="long...">
+</parameter>
+</method>
+<method name="setObjectValues"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="values" type="java.lang.Object...">
+</parameter>
+</method>
<method name="setPropertyName"
return="void"
abstract="false"
@@ -21730,19 +21950,6 @@
<parameter name="setter" type="java.lang.reflect.Method">
</parameter>
</method>
-<method name="setValues"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="values" type="T...">
-</parameter>
-</method>
</class>
<class name="RGBEvaluator"
extends="java.lang.Object"
@@ -21842,18 +22049,6 @@
visibility="public"
>
</constructor>
-<constructor name="ValueAnimator"
- type="android.animation.ValueAnimator"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="duration" type="long">
-</parameter>
-<parameter name="values" type="T...">
-</parameter>
-</constructor>
<method name="addUpdateListener"
return="void"
abstract="false"
@@ -21990,6 +22185,86 @@
visibility="public"
>
</method>
+<method name="ofDouble"
+ return="android.animation.ValueAnimator"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="values" type="double...">
+</parameter>
+</method>
+<method name="ofFloat"
+ return="android.animation.ValueAnimator"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="values" type="float...">
+</parameter>
+</method>
+<method name="ofInt"
+ return="android.animation.ValueAnimator"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="values" type="int...">
+</parameter>
+</method>
+<method name="ofLong"
+ return="android.animation.ValueAnimator"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="values" type="long...">
+</parameter>
+</method>
+<method name="ofObject"
+ return="android.animation.ValueAnimator"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="evaluator" type="android.animation.TypeEvaluator">
+</parameter>
+<parameter name="values" type="java.lang.Object...">
+</parameter>
+</method>
+<method name="ofPropertyValuesHolder"
+ return="android.animation.ValueAnimator"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="values" type="android.animation.PropertyValuesHolder...">
+</parameter>
+</method>
<method name="removeAllUpdateListeners"
return="void"
abstract="false"
@@ -22038,7 +22313,7 @@
<parameter name="playTime" type="long">
</parameter>
</method>
-<method name="setDuration"
+<method name="setDoubleValues"
return="void"
abstract="false"
native="false"
@@ -22048,6 +22323,19 @@
deprecated="not deprecated"
visibility="public"
>
+<parameter name="values" type="double...">
+</parameter>
+</method>
+<method name="setDuration"
+ return="android.animation.ValueAnimator"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
<parameter name="duration" type="long">
</parameter>
</method>
@@ -22064,6 +22352,19 @@
<parameter name="value" type="android.animation.TypeEvaluator">
</parameter>
</method>
+<method name="setFloatValues"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="values" type="float...">
+</parameter>
+</method>
<method name="setFrameDelay"
return="void"
abstract="false"
@@ -22077,6 +22378,19 @@
<parameter name="frameDelay" type="long">
</parameter>
</method>
+<method name="setIntValues"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="values" type="int...">
+</parameter>
+</method>
<method name="setInterpolator"
return="void"
abstract="false"
@@ -22090,6 +22404,32 @@
<parameter name="value" type="android.animation.TimeInterpolator">
</parameter>
</method>
+<method name="setLongValues"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="values" type="long...">
+</parameter>
+</method>
+<method name="setObjectValues"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="values" type="java.lang.Object...">
+</parameter>
+</method>
<method name="setRepeatCount"
return="void"
abstract="false"
@@ -22142,19 +22482,6 @@
<parameter name="values" type="android.animation.PropertyValuesHolder...">
</parameter>
</method>
-<method name="setValues"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="values" type="T...">
-</parameter>
-</method>
<field name="INFINITE"
type="int"
transient="false"
@@ -204116,19 +204443,6 @@
<parameter name="canvas" type="android.graphics.Canvas">
</parameter>
</method>
-<method name="onDrawDragThumbnail"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="protected"
->
-<parameter name="canvas" type="android.graphics.Canvas">
-</parameter>
-</method>
<method name="onDrawScrollBars"
return="void"
abstract="false"
@@ -204322,17 +204636,6 @@
<parameter name="heightMeasureSpec" type="int">
</parameter>
</method>
-<method name="onMeasureDragThumbnail"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="protected"
->
-</method>
<method name="onRestoreInstanceState"
return="void"
abstract="false"
@@ -204998,21 +205301,6 @@
<parameter name="contentDescription" type="java.lang.CharSequence">
</parameter>
</method>
-<method name="setDragThumbnailDimension"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="true"
- deprecated="not deprecated"
- visibility="protected"
->
-<parameter name="width" type="int">
-</parameter>
-<parameter name="height" type="int">
-</parameter>
-</method>
<method name="setDrawingCacheBackgroundColor"
return="void"
abstract="false"
@@ -226965,7 +227253,7 @@
>
</method>
<method name="getInAnimation"
- return="android.animation.ObjectAnimator<?>"
+ return="android.animation.ObjectAnimator"
abstract="false"
native="false"
synchronized="false"
@@ -226976,7 +227264,7 @@
>
</method>
<method name="getOutAnimation"
- return="android.animation.ObjectAnimator<?>"
+ return="android.animation.ObjectAnimator"
abstract="false"
native="false"
synchronized="false"
@@ -227092,7 +227380,7 @@
deprecated="not deprecated"
visibility="public"
>
-<parameter name="inAnimation" type="android.animation.ObjectAnimator<?>">
+<parameter name="inAnimation" type="android.animation.ObjectAnimator">
</parameter>
</method>
<method name="setInAnimation"
@@ -227120,7 +227408,7 @@
deprecated="not deprecated"
visibility="public"
>
-<parameter name="outAnimation" type="android.animation.ObjectAnimator<?>">
+<parameter name="outAnimation" type="android.animation.ObjectAnimator">
</parameter>
</method>
<method name="setOutAnimation"
diff --git a/core/java/android/animation/Animator.java b/core/java/android/animation/Animator.java
index d3e0797..22e04a7 100644
--- a/core/java/android/animation/Animator.java
+++ b/core/java/android/animation/Animator.java
@@ -78,7 +78,7 @@
*
* @param duration The length of the animation, in milliseconds.
*/
- public abstract void setDuration(long duration);
+ public abstract Animator setDuration(long duration);
/**
* Gets the length of the animation.
diff --git a/core/java/android/animation/AnimatorInflater.java b/core/java/android/animation/AnimatorInflater.java
index 0016459..4a6c460 100644
--- a/core/java/android/animation/AnimatorInflater.java
+++ b/core/java/android/animation/AnimatorInflater.java
@@ -52,8 +52,9 @@
private static final int VALUE_TYPE_FLOAT = 0;
private static final int VALUE_TYPE_INT = 1;
private static final int VALUE_TYPE_DOUBLE = 2;
- private static final int VALUE_TYPE_COLOR = 3;
- private static final int VALUE_TYPE_CUSTOM = 4;
+ private static final int VALUE_TYPE_LONG = 3;
+ private static final int VALUE_TYPE_COLOR = 4;
+ private static final int VALUE_TYPE_CUSTOM = 5;
/**
* Loads an {@link Animator} object from a resource
@@ -192,56 +193,113 @@
int valueType = a.getInt(com.android.internal.R.styleable.Animator_valueType,
VALUE_TYPE_FLOAT);
- Object valueFrom = null;
- Object valueTo = null;
+ if (anim == null) {
+ anim = new ValueAnimator();
+ }
TypeEvaluator evaluator = null;
+ boolean hasFrom = a.hasValue(com.android.internal.R.styleable.Animator_valueFrom);
+ boolean hasTo = a.hasValue(com.android.internal.R.styleable.Animator_valueTo);
switch (valueType) {
- case VALUE_TYPE_FLOAT:
- if (a.hasValue(com.android.internal.R.styleable.Animator_valueFrom)) {
+
+ case VALUE_TYPE_FLOAT: {
+ float valueFrom;
+ float valueTo;
+ if (hasFrom) {
valueFrom = a.getFloat(com.android.internal.R.styleable.Animator_valueFrom, 0f);
- }
- if (a.hasValue(com.android.internal.R.styleable.Animator_valueTo)) {
+ if (hasTo) {
+ valueTo = a.getFloat(com.android.internal.R.styleable.Animator_valueTo, 0f);
+ anim.setFloatValues(valueFrom, valueTo);
+ } else {
+ anim.setFloatValues(valueFrom);
+ }
+ } else {
valueTo = a.getFloat(com.android.internal.R.styleable.Animator_valueTo, 0f);
+ anim.setFloatValues(valueTo);
}
- break;
+ }
+ break;
+
case VALUE_TYPE_COLOR:
evaluator = new RGBEvaluator();
+ anim.setEvaluator(evaluator);
// fall through to pick up values
- case VALUE_TYPE_INT:
- if (a.hasValue(com.android.internal.R.styleable.Animator_valueFrom)) {
+ case VALUE_TYPE_INT: {
+ int valueFrom;
+ int valueTo;
+ if (hasFrom) {
valueFrom = a.getInteger(com.android.internal.R.styleable.Animator_valueFrom, 0);
- }
- if (a.hasValue(com.android.internal.R.styleable.Animator_valueTo)) {
+ if (hasTo) {
+ valueTo = a.getInteger(com.android.internal.R.styleable.Animator_valueTo, 0);
+ anim.setIntValues(valueFrom, valueTo);
+ } else {
+ anim.setIntValues(valueFrom);
+ }
+ } else {
valueTo = a.getInteger(com.android.internal.R.styleable.Animator_valueTo, 0);
+ anim.setIntValues(valueTo);
}
- break;
- case VALUE_TYPE_DOUBLE:
- if (a.hasValue(com.android.internal.R.styleable.Animator_valueFrom)) {
- valueFrom = (Double)((Float)(a.getFloat(com.android.internal.R.styleable.Animator_valueFrom, 0f))).doubleValue();
+ }
+ break;
+
+ case VALUE_TYPE_LONG: {
+ int valueFrom;
+ int valueTo;
+ if (hasFrom) {
+ valueFrom = a.getInteger(com.android.internal.R.styleable.Animator_valueFrom, 0);
+ if (hasTo) {
+ valueTo = a.getInteger(com.android.internal.R.styleable.Animator_valueTo, 0);
+ anim.setLongValues(valueFrom, valueTo);
+ } else {
+ anim.setLongValues(valueFrom);
+ }
+ } else {
+ valueTo = a.getInteger(com.android.internal.R.styleable.Animator_valueTo, 0);
+ anim.setLongValues(valueTo);
}
- if (a.hasValue(com.android.internal.R.styleable.Animator_valueTo)) {
- valueTo = (Double)((Float)a.getFloat(com.android.internal.R.styleable.Animator_valueTo, 0f)).doubleValue();
- }
- break;
- case VALUE_TYPE_CUSTOM:
- // TODO: How to get an 'Object' value?
- if (a.hasValue(com.android.internal.R.styleable.Animator_valueFrom)) {
+ }
+ break;
+
+ case VALUE_TYPE_DOUBLE: {
+ double valueFrom;
+ double valueTo;
+ if (hasFrom) {
valueFrom = a.getFloat(com.android.internal.R.styleable.Animator_valueFrom, 0f);
- }
- if (a.hasValue(com.android.internal.R.styleable.Animator_valueTo)) {
+ if (hasTo) {
+ valueTo = a.getFloat(com.android.internal.R.styleable.Animator_valueTo, 0f);
+ anim.setDoubleValues(valueFrom, valueTo);
+ } else {
+ anim.setDoubleValues(valueFrom);
+ }
+ } else {
valueTo = a.getFloat(com.android.internal.R.styleable.Animator_valueTo, 0f);
+ anim.setDoubleValues(valueTo);
}
- break;
+ }
+ break;
+
+ case VALUE_TYPE_CUSTOM: {
+ // TODO: How to get an 'Object' value?
+ float valueFrom;
+ float valueTo;
+ if (hasFrom) {
+ valueFrom = a.getFloat(com.android.internal.R.styleable.Animator_valueFrom, 0f);
+ if (hasTo) {
+ valueTo = a.getFloat(com.android.internal.R.styleable.Animator_valueTo, 0f);
+ anim.setFloatValues(valueFrom, valueTo);
+ } else {
+ anim.setFloatValues(valueFrom);
+ }
+ } else {
+ valueTo = a.getFloat(com.android.internal.R.styleable.Animator_valueTo, 0f);
+ anim.setFloatValues(valueTo);
+ }
+ }
+ break;
}
- if (anim == null) {
- anim = new ValueAnimator(duration, valueFrom, valueTo);
- } else {
- anim.setDuration(duration);
- anim.setValues(valueFrom, valueTo);
- }
+ anim.setDuration(duration);
anim.setStartDelay(startDelay);
if (a.hasValue(com.android.internal.R.styleable.Animator_repeatCount)) {
diff --git a/core/java/android/animation/AnimatorSet.java b/core/java/android/animation/AnimatorSet.java
index 5de0293..8fc45f4 100644
--- a/core/java/android/animation/AnimatorSet.java
+++ b/core/java/android/animation/AnimatorSet.java
@@ -328,7 +328,7 @@
* animations of this AnimatorSet.
*/
@Override
- public void setDuration(long duration) {
+ public AnimatorSet setDuration(long duration) {
if (duration < 0) {
throw new IllegalArgumentException("duration must be a value of zero or greater");
}
@@ -338,6 +338,7 @@
node.animation.setDuration(duration);
}
mDuration = duration;
+ return this;
}
/**
@@ -384,7 +385,8 @@
}
} else {
// TODO: Need to cancel out of the delay appropriately
- ValueAnimator delayAnim = new ValueAnimator(mStartDelay, 0f, 1f);
+ ValueAnimator delayAnim = ValueAnimator.ofFloat(0f, 1f);
+ delayAnim.setDuration(mStartDelay);
delayAnim.addListener(new AnimatorListenerAdapter() {
public void onAnimationEnd(Animator anim) {
for (Node node : nodesToStart) {
@@ -929,7 +931,9 @@
*/
public void after(long delay) {
// setup dummy ValueAnimator just to run the clock
- after(new ValueAnimator(delay, 0f, 1f));
+ ValueAnimator anim = ValueAnimator.ofFloat(0f, 1f);
+ anim.setDuration(delay);
+ after(anim);
}
}
diff --git a/core/java/android/animation/KeyframeSet.java b/core/java/android/animation/KeyframeSet.java
index a24b1fb..1741e60 100644
--- a/core/java/android/animation/KeyframeSet.java
+++ b/core/java/android/animation/KeyframeSet.java
@@ -17,6 +17,7 @@
package android.animation;
import java.util.ArrayList;
+import java.util.Arrays;
/**
* This class holds a collection of Keyframe objects and is called by ValueAnimator to calculate
@@ -31,12 +32,85 @@
public KeyframeSet(Keyframe... keyframes) {
mKeyframes = new ArrayList<Keyframe>();
- for (Keyframe keyframe : keyframes) {
- mKeyframes.add(keyframe);
- }
+ mKeyframes.addAll(Arrays.asList(keyframes));
mNumKeyframes = mKeyframes.size();
}
+ public static KeyframeSet ofInt(int... values) {
+ int numKeyframes = values.length;
+ Keyframe keyframes[] = new Keyframe[Math.max(numKeyframes,2)];
+ if (numKeyframes == 1) {
+ keyframes[0] = new Keyframe(0f, (Object) null);
+ keyframes[1] = new Keyframe(1f, values[0]);
+ } else {
+ keyframes[0] = new Keyframe(0f, values[0]);
+ for (int i = 1; i < numKeyframes; ++i) {
+ keyframes[i] = new Keyframe((float) i / (numKeyframes - 1), values[i]);
+ }
+ }
+ return new KeyframeSet(keyframes);
+ }
+
+ public static KeyframeSet ofFloat(float... values) {
+ int numKeyframes = values.length;
+ Keyframe keyframes[] = new Keyframe[Math.max(numKeyframes,2)];
+ if (numKeyframes == 1) {
+ keyframes[0] = new Keyframe(0f, (Object) null);
+ keyframes[1] = new Keyframe(1f, values[0]);
+ } else {
+ keyframes[0] = new Keyframe(0f, values[0]);
+ for (int i = 1; i < numKeyframes; ++i) {
+ keyframes[i] = new Keyframe((float) i / (numKeyframes - 1), values[i]);
+ }
+ }
+ return new KeyframeSet(keyframes);
+ }
+
+ public static KeyframeSet ofDouble(double... values) {
+ int numKeyframes = values.length;
+ Keyframe keyframes[] = new Keyframe[Math.max(numKeyframes,2)];
+ if (numKeyframes == 1) {
+ keyframes[0] = new Keyframe(0f, (Object) null);
+ keyframes[1] = new Keyframe(1f, values[0]);
+ } else {
+ keyframes[0] = new Keyframe(0f, values[0]);
+ for (int i = 1; i < numKeyframes; ++i) {
+ keyframes[i] = new Keyframe((float) i / (numKeyframes - 1), values[i]);
+ }
+ }
+ return new KeyframeSet(keyframes);
+ }
+
+ public static KeyframeSet ofLong(long... values) {
+ int numKeyframes = values.length;
+ Keyframe keyframes[] = new Keyframe[Math.max(numKeyframes,2)];
+ if (numKeyframes == 1) {
+ keyframes[0] = new Keyframe(0f, (Object) null);
+ keyframes[1] = new Keyframe(1f, values[0]);
+ } else {
+ keyframes[0] = new Keyframe(0f, values[0]);
+ for (int i = 1; i < numKeyframes; ++i) {
+ keyframes[i] = new Keyframe((float) i / (numKeyframes - 1), values[i]);
+ }
+ }
+ return new KeyframeSet(keyframes);
+ }
+
+ public static KeyframeSet ofObject(Object... values) {
+ int numKeyframes = values.length;
+ Keyframe keyframes[] = new Keyframe[Math.max(numKeyframes,2)];
+ if (numKeyframes == 1) {
+ keyframes[0] = new Keyframe(0f, (Object) null);
+ keyframes[1] = new Keyframe(1f, values[0]);
+ } else {
+ keyframes[0] = new Keyframe(0f, values[0]);
+ for (int i = 1; i < numKeyframes; ++i) {
+ keyframes[i] = new Keyframe((float) i / (numKeyframes - 1), values[i]);
+ }
+ }
+ return new KeyframeSet(keyframes);
+ }
+
/**
* Gets the animated value, given the elapsed fraction of the animation (interpolated by the
* animation's interpolator) and the evaluator used to calculate in-between values. This
diff --git a/core/java/android/animation/LayoutTransition.java b/core/java/android/animation/LayoutTransition.java
index 56ad857..d843737 100644
--- a/core/java/android/animation/LayoutTransition.java
+++ b/core/java/android/animation/LayoutTransition.java
@@ -189,23 +189,24 @@
public LayoutTransition() {
if (defaultChangeIn == null) {
// "left" is just a placeholder; we'll put real properties/values in when needed
- PropertyValuesHolder<Integer> pvhLeft = new PropertyValuesHolder<Integer>("left", 0, 1);
- PropertyValuesHolder<Integer> pvhTop = new PropertyValuesHolder<Integer>("top", 0, 1);
- PropertyValuesHolder<Integer> pvhRight = new PropertyValuesHolder<Integer>("right", 0, 1);
- PropertyValuesHolder<Integer> pvhBottom = new PropertyValuesHolder<Integer>("bottom", 0, 1);
- defaultChangeIn = new ObjectAnimator<PropertyValuesHolder>(DEFAULT_DURATION, this,
+ PropertyValuesHolder pvhLeft = PropertyValuesHolder.ofInt("left", 0, 1);
+ PropertyValuesHolder pvhTop = PropertyValuesHolder.ofInt("top", 0, 1);
+ PropertyValuesHolder pvhRight = PropertyValuesHolder.ofInt("right", 0, 1);
+ PropertyValuesHolder pvhBottom = PropertyValuesHolder.ofInt("bottom", 0, 1);
+ defaultChangeIn = ObjectAnimator.ofPropertyValuesHolder(this,
pvhLeft, pvhTop, pvhRight, pvhBottom);
+ defaultChangeIn.setDuration(DEFAULT_DURATION);
defaultChangeIn.setStartDelay(mChangingAppearingDelay);
defaultChangeIn.setInterpolator(mChangingAppearingInterpolator);
defaultChangeOut = defaultChangeIn.clone();
defaultChangeOut.setStartDelay(mChangingDisappearingDelay);
defaultChangeOut.setInterpolator(mChangingDisappearingInterpolator);
- defaultFadeIn =
- new ObjectAnimator<Float>(DEFAULT_DURATION, this, "alpha", 0f, 1f);
+ defaultFadeIn = ObjectAnimator.ofFloat(this, "alpha", 0f, 1f);
+ defaultFadeIn.setDuration(DEFAULT_DURATION);
defaultFadeIn.setStartDelay(mAppearingDelay);
defaultFadeIn.setInterpolator(mAppearingInterpolator);
- defaultFadeOut =
- new ObjectAnimator<Float>(DEFAULT_DURATION, this, "alpha", 1f, 0f);
+ defaultFadeOut = ObjectAnimator.ofFloat(this, "alpha", 1f, 0f);
+ defaultFadeOut.setDuration(DEFAULT_DURATION);
defaultFadeOut.setStartDelay(mDisappearingDelay);
defaultFadeOut.setInterpolator(mDisappearingInterpolator);
}
diff --git a/core/java/android/animation/ObjectAnimator.java b/core/java/android/animation/ObjectAnimator.java
index 31ddb0b..7427651 100644
--- a/core/java/android/animation/ObjectAnimator.java
+++ b/core/java/android/animation/ObjectAnimator.java
@@ -27,7 +27,7 @@
* are then determined internally and the animation will call these functions as necessary to
* animate the property.
*/
-public final class ObjectAnimator<T> extends ValueAnimator<T> {
+public final class ObjectAnimator extends ValueAnimator {
// The target object on which the property exists, set in the constructor
private Object mTarget;
@@ -122,50 +122,200 @@
* A constructor that takes a single property name and set of values. This constructor is
* used in the simple case of animating a single property.
*
- * @param duration The length of the animation, in milliseconds.
* @param target The object whose property is to be animated. This object should
* have a public method on it called <code>setName()</code>, where <code>name</code> is
* the value of the <code>propertyName</code> parameter.
* @param propertyName The name of the property being animated.
- * @param values The set of values to animate between. If there is only one value, it
- * is assumed to be the final value being animated to, and the initial value will be
- * derived on the fly.
*/
- public ObjectAnimator(long duration, Object target, String propertyName, T...values) {
- super(duration, (T[]) values);
+ private ObjectAnimator(Object target, String propertyName) {
mTarget = target;
setPropertyName(propertyName);
}
/**
+ * Constructs and returns an ObjectAnimator that animates between int values. A single
+ * value implies that that value is the one being animated to. However, this is not typically
+ * useful in a ValueAnimator object because there is no way for the object to determine the
+ * starting value for the animation (unlike ObjectAnimator, which can derive that value
+ * from the target object and property being animated). Therefore, there should typically
+ * be two or more values.
+ *
+ * @param target The object whose property is to be animated. This object should
+ * have a public method on it called <code>setName()</code>, where <code>name</code> is
+ * the value of the <code>propertyName</code> parameter.
+ * @param propertyName The name of the property being animated.
+ * @param values A set of values that the animation will animate between over time.
+ * @return A ValueAnimator object that is set up to animate between the given values.
+ */
+ public static ObjectAnimator ofInt(Object target, String propertyName, int... values) {
+ ObjectAnimator anim = new ObjectAnimator(target, propertyName);
+ anim.setIntValues(values);
+ return anim;
+ }
+
+ /**
+ * Constructs and returns an ObjectAnimator that animates between float values. A single
+ * value implies that that value is the one being animated to. However, this is not typically
+ * useful in a ValueAnimator object because there is no way for the object to determine the
+ * starting value for the animation (unlike ObjectAnimator, which can derive that value
+ * from the target object and property being animated). Therefore, there should typically
+ * be two or more values.
+ *
+ * @param target The object whose property is to be animated. This object should
+ * have a public method on it called <code>setName()</code>, where <code>name</code> is
+ * the value of the <code>propertyName</code> parameter.
+ * @param propertyName The name of the property being animated.
+ * @param values A set of values that the animation will animate between over time.
+ * @return A ValueAnimator object that is set up to animate between the given values.
+ */
+ public static ObjectAnimator ofFloat(Object target, String propertyName, float... values) {
+ ObjectAnimator anim = new ObjectAnimator(target, propertyName);
+ anim.setFloatValues(values);
+ return anim;
+ }
+
+ /**
+ * Constructs and returns an ObjectAnimator that animates between long values. A single
+ * value implies that that value is the one being animated to. However, this is not typically
+ * useful in a ValueAnimator object because there is no way for the object to determine the
+ * starting value for the animation (unlike ObjectAnimator, which can derive that value
+ * from the target object and property being animated). Therefore, there should typically
+ * be two or more values.
+ *
+ * @param target The object whose property is to be animated. This object should
+ * have a public method on it called <code>setName()</code>, where <code>name</code> is
+ * the value of the <code>propertyName</code> parameter.
+ * @param propertyName The name of the property being animated.
+ * @param values A set of values that the animation will animate between over time.
+ * @return A ValueAnimator object that is set up to animate between the given values.
+ */
+ public static ObjectAnimator ofLong(Object target, String propertyName, long... values) {
+ ObjectAnimator anim = new ObjectAnimator(target, propertyName);
+ anim.setLongValues(values);
+ return anim;
+ }
+
+ /**
+ * Constructs and returns an ObjectAnimator that animates between double values. A single
+ * value implies that that value is the one being animated to. However, this is not typically
+ * useful in a ValueAnimator object because there is no way for the object to determine the
+ * starting value for the animation (unlike ObjectAnimator, which can derive that value
+ * from the target object and property being animated). Therefore, there should typically
+ * be two or more values.
+ *
+ * @param target The object whose property is to be animated. This object should
+ * have a public method on it called <code>setName()</code>, where <code>name</code> is
+ * the value of the <code>propertyName</code> parameter.
+ * @param propertyName The name of the property being animated.
+ * @param values A set of values that the animation will animate between over time.
+ * @return A ValueAnimator object that is set up to animate between the given values.
+ */
+ public static ObjectAnimator ofDouble(Object target, String propertyName, double... values) {
+ ObjectAnimator anim = new ObjectAnimator(target, propertyName);
+ anim.setDoubleValues(values);
+ return anim;
+ }
+
+ /**
* A constructor that takes <code>PropertyValueHolder</code> values. This constructor should
* be used when animating several properties at once with the same ObjectAnimator, since
* PropertyValuesHolder allows you to associate a set of animation values with a property
* name.
*
- * @param duration The length of the animation, in milliseconds.
* @param target The object whose property is to be animated. This object should
* have public methods on it called <code>setName()</code>, where <code>name</code> is
* the name of the property passed in as the <code>propertyName</code> parameter for
* each of the PropertyValuesHolder objects.
+ * @param propertyName The name of the property being animated.
+ * @param evaluator A TypeEvaluator that will be called on each animation frame to
+ * provide the ncessry interpolation between the Object values to derive the animated
+ * value.
* @param values The PropertyValuesHolder objects which hold each the property name and values
* to animate that property between.
*/
- public ObjectAnimator(long duration, Object target, PropertyValuesHolder...values) {
- super(duration);
- setValues(values);
- mTarget = target;
+ public static ObjectAnimator ofObject(Object target, String propertyName,
+ TypeEvaluator evaluator, Object... values) {
+ ObjectAnimator anim = new ObjectAnimator(target, propertyName);
+ anim.setObjectValues(values);
+ anim.setEvaluator(evaluator);
+ return anim;
+ }
+
+ /**
+ * Constructs and returns an ObjectAnimator that animates between the sets of values
+ * specifed in <code>PropertyValueHolder</code> objects. This variant should
+ * be used when animating several properties at once with the same ObjectAnimator, since
+ * PropertyValuesHolder allows you to associate a set of animation values with a property
+ * name.
+ *
+ * @param target The object whose property is to be animated. This object should
+ * have public methods on it called <code>setName()</code>, where <code>name</code> is
+ * the name of the property passed in as the <code>propertyName</code> parameter for
+ * each of the PropertyValuesHolder objects.
+ * @param values A set of PropertyValuesHolder objects whose values will be animated
+ * between over time.
+ * @return A ValueAnimator object that is set up to animate between the given values.
+ */
+ public static ObjectAnimator ofPropertyValuesHolder(Object target,
+ PropertyValuesHolder... values) {
+ ObjectAnimator anim = new ObjectAnimator();
+ anim.mTarget = target;
+ anim.setValues(values);
+ return anim;
}
@Override
- public void setValues(T... values) {
+ public void setIntValues(int... values) {
if (mValues == null || mValues.length == 0) {
// No values yet - this animator is being constructed piecemeal. Init the values with
// whatever the current propertyName is
- setValues(new PropertyValuesHolder[]{
- new PropertyValuesHolder(mPropertyName, (Object[])values)});
+ setValues(PropertyValuesHolder.ofInt(mPropertyName, values));
} else {
- super.setValues((T[]) values);
+ super.setIntValues(values);
+ }
+ }
+
+ @Override
+ public void setFloatValues(float... values) {
+ if (mValues == null || mValues.length == 0) {
+ // No values yet - this animator is being constructed piecemeal. Init the values with
+ // whatever the current propertyName is
+ setValues(PropertyValuesHolder.ofFloat(mPropertyName, values));
+ } else {
+ super.setFloatValues(values);
+ }
+ }
+
+ @Override
+ public void setDoubleValues(double... values) {
+ if (mValues == null || mValues.length == 0) {
+ // No values yet - this animator is being constructed piecemeal. Init the values with
+ // whatever the current propertyName is
+ setValues(PropertyValuesHolder.ofDouble(mPropertyName, values));
+ } else {
+ super.setDoubleValues(values);
+ }
+ }
+
+ @Override
+ public void setLongValues(long... values) {
+ if (mValues == null || mValues.length == 0) {
+ // No values yet - this animator is being constructed piecemeal. Init the values with
+ // whatever the current propertyName is
+ setValues(PropertyValuesHolder.ofLong(mPropertyName, values));
+ } else {
+ super.setLongValues(values);
+ }
+ }
+
+ @Override
+ public void setObjectValues(Object... values) {
+ if (mValues == null || mValues.length == 0) {
+ // No values yet - this animator is being constructed piecemeal. Init the values with
+ // whatever the current propertyName is
+ setValues(PropertyValuesHolder.ofObject(mPropertyName, (TypeEvaluator)null, values));
+ } else {
+ super.setObjectValues(values);
}
}
@@ -194,6 +344,21 @@
}
}
+ /**
+ * Sets the length of the animation. The default duration is 300 milliseconds.
+ *
+ * @param duration The length of the animation, in milliseconds.
+ * @return ObjectAnimator The object called with setDuration(). This return
+ * value makes it easier to compose statements together that construct and then set the
+ * duration, as in
+ * <code>ObjectAnimator.ofInt(target, propertyName, 0, 10).setDuration(500).start()</code>.
+ */
+ @Override
+ public ObjectAnimator setDuration(long duration) {
+ super.setDuration(duration);
+ return this;
+ }
+
/**
* The target object whose property will be animated by this animation
diff --git a/core/java/android/animation/PropertyValuesHolder.java b/core/java/android/animation/PropertyValuesHolder.java
index 1d46123..0f759f1 100644
--- a/core/java/android/animation/PropertyValuesHolder.java
+++ b/core/java/android/animation/PropertyValuesHolder.java
@@ -30,7 +30,7 @@
* animations with ValueAnimator or ObjectAnimator that operate on several different properties
* in parallel.
*/
-public class PropertyValuesHolder<T> implements Cloneable {
+public class PropertyValuesHolder implements Cloneable {
/**
* The name of the property associated with the values. This need not be a real property,
@@ -118,22 +118,88 @@
private Object mAnimatedValue;
/**
- * Constructs a PropertyValuesHolder object with just a set of values. This constructor
- * is typically not used when animating objects with ObjectAnimator, because that
- * object needs distinct and meaningful property names. Simpler animations of one
- * set of values using ValueAnimator may use this constructor, however, because no
- * distinguishing name is needed.
- * @param values The set of values to animate between. If there is only one value, it
- * is assumed to be the final value being animated to, and the initial value will be
- * derived on the fly.
+ * Internal utility constructor, used by the factory methods to set the property name.
+ * @param propertyName The name of the property for this holder.
*/
- public PropertyValuesHolder(T...values) {
- this(null, values);
+ private PropertyValuesHolder(String propertyName) {
+ mPropertyName = propertyName;
}
/**
- * Constructs a PropertyValuesHolder object with the specified property name and set of
- * values. These values can be of any type, but the type should be consistent so that
+ * Constructs and returns a PropertyValuesHolder with a given property name and
+ * set of int values.
+ * @param propertyName The name of the property being animated.
+ * @param values The values that the named property will animate between.
+ * @return PropertyValuesHolder The constructed PropertyValuesHolder object.
+ */
+ public static PropertyValuesHolder ofInt(String propertyName, int... values) {
+ PropertyValuesHolder pvh = new PropertyValuesHolder(propertyName);
+ pvh.setIntValues(values);
+ return pvh;
+ }
+
+ /**
+ * Constructs and returns a PropertyValuesHolder with a given property name and
+ * set of float values.
+ * @param propertyName The name of the property being animated.
+ * @param values The values that the named property will animate between.
+ * @return PropertyValuesHolder The constructed PropertyValuesHolder object.
+ */
+ public static PropertyValuesHolder ofFloat(String propertyName, float... values) {
+ PropertyValuesHolder pvh = new PropertyValuesHolder(propertyName);
+ pvh.setFloatValues(values);
+ return pvh;
+ }
+
+ /**
+ * Constructs and returns a PropertyValuesHolder with a given property name and
+ * set of double values.
+ * @param propertyName The name of the property being animated.
+ * @param values The values that the named property will animate between.
+ * @return PropertyValuesHolder The constructed PropertyValuesHolder object.
+ */
+ public static PropertyValuesHolder ofDouble(String propertyName, double... values) {
+ PropertyValuesHolder pvh = new PropertyValuesHolder(propertyName);
+ pvh.setDoubleValues(values);
+ return pvh;
+ }
+
+ /**
+ * Constructs and returns a PropertyValuesHolder with a given property name and
+ * set of long values.
+ * @param propertyName The name of the property being animated.
+ * @param values The values that the named property will animate between.
+ * @return PropertyValuesHolder The constructed PropertyValuesHolder object.
+ */
+ public static PropertyValuesHolder ofLong(String propertyName, long... values) {
+ PropertyValuesHolder pvh = new PropertyValuesHolder(propertyName);
+ pvh.setLongValues(values);
+ return pvh;
+ }
+
+ /**
+ * Constructs and returns a PropertyValuesHolder with a given property name and
+ * set of Object values. This variant also takes a TypeEvaluator because the system
+ * cannot interpolate between objects of unknown type.
+ *
+ * @param propertyName The name of the property being animated.
+ * @param evaluator A TypeEvaluator that will be called on each animation frame to
+ * provide the ncessry interpolation between the Object values to derive the animated
+ * value.
+ * @param values The values that the named property will animate between.
+ * @return PropertyValuesHolder The constructed PropertyValuesHolder object.
+ */
+ public static PropertyValuesHolder ofObject(String propertyName, TypeEvaluator evaluator,
+ Object... values) {
+ PropertyValuesHolder pvh = new PropertyValuesHolder(propertyName);
+ pvh.setObjectValues(values);
+ pvh.setEvaluator(evaluator);
+ return pvh;
+ }
+
+ /**
+ * Constructs and returns a PropertyValuesHolder object with the specified property name and set
+ * of values. These values can be of any type, but the type should be consistent so that
* an appropriate {@link android.animation.TypeEvaluator} can be found that matches
* the common type.
* <p>If there is only one value, it is assumed to be the end value of an animation,
@@ -151,13 +217,14 @@
* ValueAnimator object.
* @param values The set of values to animate between.
*/
- public PropertyValuesHolder(String propertyName, T... values) {
- mPropertyName = propertyName;
- setValues(values);
+ public static PropertyValuesHolder ofKeyframe(String propertyName, Keyframe... values) {
+ PropertyValuesHolder pvh = new PropertyValuesHolder(propertyName);
+ pvh.setKeyframes(values);
+ return pvh;
}
/**
- * Sets the values being animated between.
+ * Set the animated values for this object to this set of ints.
* If there is only one value, it is assumed to be the end value of an animation,
* and an initial value will be derived, if possible, by calling a getter function
* on the object. Also, if any value is null, the value will be filled in when the animation
@@ -167,51 +234,104 @@
* derived automatically from <code>propertyName</code> or set explicitly via
* {@link #setGetter(java.lang.reflect.Method)}, since otherwise PropertyValuesHolder has
* no way of determining what the value should be.
- * @param values The set of values to animate between.
+ *
+ * @param values One or more values that the animation will animate between.
*/
- public void setValues(T... values) {
- int numKeyframes = values.length;
- for (int i = 0; i < numKeyframes; ++i) {
- if (values[i] != null) {
- Class thisValueType = values[i].getClass();
- if (mValueType == null) {
- mValueType = thisValueType;
- } else {
- if (thisValueType != mValueType) {
- if (mValueType == Integer.class &&
- (thisValueType == Float.class || thisValueType == Double.class)) {
- mValueType = thisValueType;
- } else if (mValueType == Float.class && thisValueType == Double.class) {
- mValueType = thisValueType;
- }
- }
- }
- }
- }
- Keyframe keyframes[] = new Keyframe[Math.max(numKeyframes,2)];
- if (mValueType.equals(Keyframe.class)) {
- mValueType = ((Keyframe)values[0]).getType();
- for (int i = 0; i < numKeyframes; ++i) {
- keyframes[i] = (Keyframe)values[i];
- }
- } else {
- if (numKeyframes == 1) {
- keyframes[0] = new Keyframe(0f, (Object) null);
- keyframes[1] = new Keyframe(1f, values[0]);
- } else {
- keyframes[0] = new Keyframe(0f, values[0]);
- for (int i = 1; i < numKeyframes; ++i) {
- if (values[i] != null && (values[i].getClass() != mValueType)) {
+ public void setIntValues(int... values) {
+ mValueType = int.class;
+ mKeyframeSet = KeyframeSet.ofInt(values);
+ }
- }
- keyframes[i] = new Keyframe((float) i / (numKeyframes - 1), values[i]);
- }
- }
+ /**
+ * Set the animated values for this object to this set of floats.
+ * If there is only one value, it is assumed to be the end value of an animation,
+ * and an initial value will be derived, if possible, by calling a getter function
+ * on the object. Also, if any value is null, the value will be filled in when the animation
+ * starts in the same way. This mechanism of automatically getting null values only works
+ * if the PropertyValuesHolder object is used in conjunction
+ * {@link ObjectAnimator}, and with a getter function either
+ * derived automatically from <code>propertyName</code> or set explicitly via
+ * {@link #setGetter(java.lang.reflect.Method)}, since otherwise PropertyValuesHolder has
+ * no way of determining what the value should be.
+ *
+ * @param values One or more values that the animation will animate between.
+ */
+ public void setFloatValues(float... values) {
+ mValueType = float.class;
+ mKeyframeSet = KeyframeSet.ofFloat(values);
+ }
+
+ /**
+ * Set the animated values for this object to this set of doubles.
+ * If there is only one value, it is assumed to be the end value of an animation,
+ * and an initial value will be derived, if possible, by calling a getter function
+ * on the object. Also, if any value is null, the value will be filled in when the animation
+ * starts in the same way. This mechanism of automatically getting null values only works
+ * if the PropertyValuesHolder object is used in conjunction
+ * {@link ObjectAnimator}, and with a getter function either
+ * derived automatically from <code>propertyName</code> or set explicitly via
+ * {@link #setGetter(java.lang.reflect.Method)}, since otherwise PropertyValuesHolder has
+ * no way of determining what the value should be.
+ *
+ * @param values One or more values that the animation will animate between.
+ */
+ public void setDoubleValues(double... values) {
+ mValueType = double.class;
+ mKeyframeSet = KeyframeSet.ofDouble(values);
+ }
+
+ /**
+ * Set the animated values for this object to this set of longs.
+ * If there is only one value, it is assumed to be the end value of an animation,
+ * and an initial value will be derived, if possible, by calling a getter function
+ * on the object. Also, if any value is null, the value will be filled in when the animation
+ * starts in the same way. This mechanism of automatically getting null values only works
+ * if the PropertyValuesHolder object is used in conjunction
+ * {@link ObjectAnimator}, and with a getter function either
+ * derived automatically from <code>propertyName</code> or set explicitly via
+ * {@link #setGetter(java.lang.reflect.Method)}, since otherwise PropertyValuesHolder has
+ * no way of determining what the value should be.
+ *
+ * @param values One or more values that the animation will animate between.
+ */
+ public void setLongValues(long... values) {
+ mValueType = long.class;
+ mKeyframeSet = KeyframeSet.ofLong(values);
+ }
+
+ /**
+ * Set the animated values for this object to this set of Keyframes.
+ *
+ * @param values One or more values that the animation will animate between.
+ */
+ public void setKeyframes(Keyframe... values) {
+ int numKeyframes = values.length;
+ Keyframe keyframes[] = new Keyframe[Math.max(numKeyframes,2)];
+ mValueType = ((Keyframe)values[0]).getType();
+ for (int i = 0; i < numKeyframes; ++i) {
+ keyframes[i] = (Keyframe)values[i];
}
mKeyframeSet = new KeyframeSet(keyframes);
}
-
+ /**
+ * Set the animated values for this object to this set of Objects.
+ * If there is only one value, it is assumed to be the end value of an animation,
+ * and an initial value will be derived, if possible, by calling a getter function
+ * on the object. Also, if any value is null, the value will be filled in when the animation
+ * starts in the same way. This mechanism of automatically getting null values only works
+ * if the PropertyValuesHolder object is used in conjunction
+ * {@link ObjectAnimator}, and with a getter function either
+ * derived automatically from <code>propertyName</code> or set explicitly via
+ * {@link #setGetter(java.lang.reflect.Method)}, since otherwise PropertyValuesHolder has
+ * no way of determining what the value should be.
+ *
+ * @param values One or more values that the animation will animate between.
+ */
+ public void setObjectValues(Object... values) {
+ mValueType = values[0].getClass();
+ mKeyframeSet = KeyframeSet.ofObject(values);
+ }
/**
* Determine the setter or getter function using the JavaBeans convention of setFoo or
@@ -351,7 +471,7 @@
setupGetter(targetClass);
}
try {
- kf.setValue((T) mGetter.invoke(target));
+ kf.setValue(mGetter.invoke(target));
} catch (InvocationTargetException e) {
Log.e("PropertyValuesHolder", e.toString());
} catch (IllegalAccessException e) {
@@ -374,7 +494,7 @@
Class targetClass = target.getClass();
setupGetter(targetClass);
}
- kf.setValue((T) mGetter.invoke(target));
+ kf.setValue(mGetter.invoke(target));
} catch (InvocationTargetException e) {
Log.e("PropertyValuesHolder", e.toString());
} catch (IllegalAccessException e) {
@@ -414,9 +534,7 @@
for (int i = 0; i < numKeyframes; ++i) {
newKeyframes[i] = keyframes.get(i).clone();
}
- PropertyValuesHolder pvhClone = new PropertyValuesHolder(mPropertyName,
- (Object[]) newKeyframes);
- return pvhClone;
+ return PropertyValuesHolder.ofKeyframe(mPropertyName, newKeyframes);
}
/**
* Internal function to set the value on the target object, using the setter set up
diff --git a/core/java/android/animation/ValueAnimator.java b/core/java/android/animation/ValueAnimator.java
index a6f061d..79754b8 100755
--- a/core/java/android/animation/ValueAnimator.java
+++ b/core/java/android/animation/ValueAnimator.java
@@ -37,7 +37,7 @@
* out of an animation. This behavior can be changed by calling
* {@link ValueAnimator#setInterpolator(TimeInterpolator)}.</p>
*/
-public class ValueAnimator<T> extends Animator {
+public class ValueAnimator extends Animator {
/**
* Internal constants
@@ -154,7 +154,7 @@
//
// How long the animation should last in ms
- private long mDuration;
+ private long mDuration = 300;
// The amount of time in ms to delay starting the animation after start() is called
private long mStartDelay = 0;
@@ -218,28 +218,261 @@
/**
* Creates a new ValueAnimator object. This default constructor is primarily for
- * use internally; the other constructors which take parameters are more generally
+ * use internally; the factory methods which take parameters are more generally
* useful.
*/
public ValueAnimator() {
}
/**
- * Constructs an ValueAnimator object with the specified duration and set of
- * values. If the values are a set of PropertyValuesHolder objects, then these objects
- * define the potentially multiple properties being animated and the values the properties are
- * animated between. Otherwise, the values define a single set of values animated between.
+ * Constructs and returns a ValueAnimator that animates between int values. A single
+ * value implies that that value is the one being animated to. However, this is not typically
+ * useful in a ValueAnimator object because there is no way for the object to determine the
+ * starting value for the animation (unlike ObjectAnimator, which can derive that value
+ * from the target object and property being animated). Therefore, there should typically
+ * be two or more values.
*
- * @param duration The length of the animation, in milliseconds.
- * @param values The set of values to animate between. If these values are not
- * PropertyValuesHolder objects, then there should be more than one value, since the values
- * determine the interval to animate between.
+ * @param values A set of values that the animation will animate between over time.
+ * @return A ValueAnimator object that is set up to animate between the given values.
*/
- public ValueAnimator(long duration, T...values) {
- mDuration = duration;
- if (values.length > 0) {
- setValues(values);
+ public static ValueAnimator ofInt(int... values) {
+ ValueAnimator anim = new ValueAnimator();
+ anim.setIntValues(values);
+ return anim;
+ }
+
+ /**
+ * Constructs and returns a ValueAnimator that animates between float values. A single
+ * value implies that that value is the one being animated to. However, this is not typically
+ * useful in a ValueAnimator object because there is no way for the object to determine the
+ * starting value for the animation (unlike ObjectAnimator, which can derive that value
+ * from the target object and property being animated). Therefore, there should typically
+ * be two or more values.
+ *
+ * @param values A set of values that the animation will animate between over time.
+ * @return A ValueAnimator object that is set up to animate between the given values.
+ */
+ public static ValueAnimator ofFloat(float... values) {
+ ValueAnimator anim = new ValueAnimator();
+ anim.setFloatValues(values);
+ return anim;
+ }
+
+ /**
+ * Constructs and returns a ValueAnimator that animates between double values. A single
+ * value implies that that value is the one being animated to. However, this is not typically
+ * useful in a ValueAnimator object because there is no way for the object to determine the
+ * starting value for the animation (unlike ObjectAnimator, which can derive that value
+ * from the target object and property being animated). Therefore, there should typically
+ * be two or more values.
+ *
+ * @param values A set of values that the animation will animate between over time.
+ * @return A ValueAnimator object that is set up to animate between the given values.
+ */
+ public static ValueAnimator ofDouble(double... values) {
+ ValueAnimator anim = new ValueAnimator();
+ anim.setDoubleValues(values);
+ return anim;
+ }
+
+ /**
+ * Constructs and returns a ValueAnimator that animates between long values. A single
+ * value implies that that value is the one being animated to. However, this is not typically
+ * useful in a ValueAnimator object because there is no way for the object to determine the
+ * starting value for the animation (unlike ObjectAnimator, which can derive that value
+ * from the target object and property being animated). Therefore, there should typically
+ * be two or more values.
+ *
+ * @param values A set of values that the animation will animate between over time.
+ * @return A ValueAnimator object that is set up to animate between the given values.
+ */
+ public static ValueAnimator ofLong(long... values) {
+ ValueAnimator anim = new ValueAnimator();
+ anim.setLongValues(values);
+ return anim;
+ }
+
+ /**
+ * Constructs and returns a ValueAnimator that animates between the values
+ * specified in the PropertyValuesHolder objects.
+ *
+ * @param values A set of PropertyValuesHolder objects whose values will be animated
+ * between over time.
+ * @return A ValueAnimator object that is set up to animate between the given values.
+ */
+ public static ValueAnimator ofPropertyValuesHolder(PropertyValuesHolder... values) {
+ ValueAnimator anim = new ValueAnimator();
+ anim.setValues(values);
+ return anim;
+ }
+ /**
+ * Constructs and returns a ValueAnimator that animates between Object values. A single
+ * value implies that that value is the one being animated to. However, this is not typically
+ * useful in a ValueAnimator object because there is no way for the object to determine the
+ * starting value for the animation (unlike ObjectAnimator, which can derive that value
+ * from the target object and property being animated). Therefore, there should typically
+ * be two or more values.
+ *
+ * <p>Since ValueAnimator does not know how to animate between arbitrary Objects, this
+ * factory method also takes a TypeEvaluator object that the ValueAnimator will use
+ * to perform that interpolation.
+ *
+ * @param evaluator A TypeEvaluator that will be called on each animation frame to
+ * provide the ncessry interpolation between the Object values to derive the animated
+ * value.
+ * @param values A set of values that the animation will animate between over time.
+ * @return A ValueAnimator object that is set up to animate between the given values.
+ */
+ public static ValueAnimator ofObject(TypeEvaluator evaluator, Object... values) {
+ ValueAnimator anim = new ValueAnimator();
+ anim.setObjectValues(values);
+ anim.setEvaluator(evaluator);
+ return anim;
+ }
+
+ /**
+ * Sets int values that will be animated between. A single
+ * value implies that that value is the one being animated to. However, this is not typically
+ * useful in a ValueAnimator object because there is no way for the object to determine the
+ * starting value for the animation (unlike ObjectAnimator, which can derive that value
+ * from the target object and property being animated). Therefore, there should typically
+ * be two or more values.
+ *
+ * <p>If there are already multiple sets of values defined for this ValueAnimator via more
+ * than one PropertyValuesHolder object, this method will set the values for the first
+ * of those objects.</p>
+ *
+ * @param values A set of values that the animation will animate between over time.
+ */
+ public void setIntValues(int... values) {
+ if (values == null || values.length == 0) {
+ return;
}
+ if (mValues == null || mValues.length == 0) {
+ setValues(new PropertyValuesHolder[]{PropertyValuesHolder.ofInt("", values)});
+ } else {
+ PropertyValuesHolder valuesHolder = mValues[0];
+ valuesHolder.setIntValues(values);
+ }
+ // New property/values/target should cause re-initialization prior to starting
+ mInitialized = false;
+ }
+
+ /**
+ * Sets float values that will be animated between. A single
+ * value implies that that value is the one being animated to. However, this is not typically
+ * useful in a ValueAnimator object because there is no way for the object to determine the
+ * starting value for the animation (unlike ObjectAnimator, which can derive that value
+ * from the target object and property being animated). Therefore, there should typically
+ * be two or more values.
+ *
+ * <p>If there are already multiple sets of values defined for this ValueAnimator via more
+ * than one PropertyValuesHolder object, this method will set the values for the first
+ * of those objects.</p>
+ *
+ * @param values A set of values that the animation will animate between over time.
+ */
+ public void setFloatValues(float... values) {
+ if (values == null || values.length == 0) {
+ return;
+ }
+ if (mValues == null || mValues.length == 0) {
+ setValues(new PropertyValuesHolder[]{PropertyValuesHolder.ofFloat("", values)});
+ } else {
+ PropertyValuesHolder valuesHolder = mValues[0];
+ valuesHolder.setFloatValues(values);
+ }
+ // New property/values/target should cause re-initialization prior to starting
+ mInitialized = false;
+ }
+
+ /**
+ * Sets long values that will be animated between. A single
+ * value implies that that value is the one being animated to. However, this is not typically
+ * useful in a ValueAnimator object because there is no way for the object to determine the
+ * starting value for the animation (unlike ObjectAnimator, which can derive that value
+ * from the target object and property being animated). Therefore, there should typically
+ * be two or more values.
+ *
+ * <p>If there are already multiple sets of values defined for this ValueAnimator via more
+ * than one PropertyValuesHolder object, this method will set the values for the first
+ * of those objects.</p>
+ *
+ * @param values A set of values that the animation will animate between over time.
+ */
+ public void setLongValues(long... values) {
+ if (values == null || values.length == 0) {
+ return;
+ }
+ if (mValues == null || mValues.length == 0) {
+ setValues(new PropertyValuesHolder[]{PropertyValuesHolder.ofLong("", values)});
+ } else {
+ PropertyValuesHolder valuesHolder = mValues[0];
+ valuesHolder.setLongValues(values);
+ }
+ // New property/values/target should cause re-initialization prior to starting
+ mInitialized = false;
+ }
+
+ /**
+ * Sets double values that will be animated between. A single
+ * value implies that that value is the one being animated to. However, this is not typically
+ * useful in a ValueAnimator object because there is no way for the object to determine the
+ * starting value for the animation (unlike ObjectAnimator, which can derive that value
+ * from the target object and property being animated). Therefore, there should typically
+ * be two or more values.
+ *
+ * <p>If there are already multiple sets of values defined for this ValueAnimator via more
+ * than one PropertyValuesHolder object, this method will set the values for the first
+ * of those objects.</p>
+ *
+ * @param values A set of values that the animation will animate between over time.
+ */
+ public void setDoubleValues(double... values) {
+ if (values == null || values.length == 0) {
+ return;
+ }
+ if (mValues == null || mValues.length == 0) {
+ setValues(new PropertyValuesHolder[]{PropertyValuesHolder.ofDouble("", values)});
+ } else {
+ PropertyValuesHolder valuesHolder = mValues[0];
+ valuesHolder.setDoubleValues(values);
+ }
+ // New property/values/target should cause re-initialization prior to starting
+ mInitialized = false;
+ }
+
+ /**
+ * Sets the values to animate between for this animation. A single
+ * value implies that that value is the one being animated to. However, this is not typically
+ * useful in a ValueAnimator object because there is no way for the object to determine the
+ * starting value for the animation (unlike ObjectAnimator, which can derive that value
+ * from the target object and property being animated). Therefore, there should typically
+ * be two or more values.
+ *
+ * <p>If there are already multiple sets of values defined for this ValueAnimator via more
+ * than one PropertyValuesHolder object, this method will set the values for the first
+ * of those objects.</p>
+ *
+ * <p>There should be a TypeEvaluator set on the ValueAnimator that knows how to interpolate
+ * between these value objects. ValueAnimator only knows how to interpolate between the
+ * primitive types specified in the other setValues() methods.</p>
+ *
+ * @param values The set of values to animate between.
+ */
+ public void setObjectValues(Object... values) {
+ if (values == null || values.length == 0) {
+ return;
+ }
+ if (mValues == null || mValues.length == 0) {
+ setValues(new PropertyValuesHolder[]{PropertyValuesHolder.ofObject("",
+ (TypeEvaluator)null, values)});
+ } else {
+ PropertyValuesHolder valuesHolder = mValues[0];
+ valuesHolder.setObjectValues(values);
+ }
+ // New property/values/target should cause re-initialization prior to starting
+ mInitialized = false;
}
/**
@@ -275,30 +508,6 @@
}
/**
- * Sets the values to animate between for this animation. If <code>values</code> is
- * a set of PropertyValuesHolder objects, these objects will become the set of properties
- * animated and the values that those properties are animated between. Otherwise, this method
- * will set only one set of values for the ValueAnimator. Also, if the values are not
- * PropertyValuesHolder objects and if there are already multiple sets of
- * values defined for this ValueAnimator via
- * more than one PropertyValuesHolder objects, this method will set the values for
- * the first of those objects.
- *
- * @param values The set of values to animate between.
- */
- public void setValues(T... values) {
- if (mValues == null || mValues.length == 0) {
- setValues(new PropertyValuesHolder[]{
- new PropertyValuesHolder("", (Object[])values)});
- } else {
- PropertyValuesHolder valuesHolder = mValues[0];
- valuesHolder.setValues(values);
- }
- // New property/values/target should cause re-initialization prior to starting
- mInitialized = false;
- }
-
- /**
* This function is called immediately before processing the first animation
* frame of an animation. If there is a nonzero <code>startDelay</code>, the
* function is called after that delay ends.
@@ -321,16 +530,20 @@
/**
- * Sets the length of the animation.
+ * Sets the length of the animation. The default duration is 300 milliseconds.
*
* @param duration The length of the animation, in milliseconds.
+ * @return ValueAnimator The object called with setDuration(). This return
+ * value makes it easier to compose statements together that construct and then set the
+ * duration, as in <code>ValueAnimator.ofInt(0, 10).setDuration(500).start()</code>.
*/
- public void setDuration(long duration) {
+ public ValueAnimator setDuration(long duration) {
mDuration = duration;
+ return this;
}
/**
- * Gets the length of the animation.
+ * Gets the length of the animation. The default duration is 300 milliseconds.
*
* @return The length of the animation, in milliseconds.
*/
@@ -469,8 +682,8 @@
// If there are still active or delayed animations, call the handler again
// after the frameDelay
if (callAgain && (!sAnimations.isEmpty() || !sDelayedAnims.isEmpty())) {
- sendEmptyMessageDelayed(ANIMATION_FRAME, Math.max(0, sFrameDelay -
-- (AnimationUtils.currentAnimationTimeMillis() - currentTime)));
+ sendEmptyMessageDelayed(ANIMATION_FRAME, Math.max(0, sFrameDelay -
+ (AnimationUtils.currentAnimationTimeMillis() - currentTime)));
}
break;
}
diff --git a/core/java/android/app/AlertDialog.java b/core/java/android/app/AlertDialog.java
index dc87aeb..4a629bb 100644
--- a/core/java/android/app/AlertDialog.java
+++ b/core/java/android/app/AlertDialog.java
@@ -78,7 +78,6 @@
TypedValue outValue = new TypedValue();
context.getTheme().resolveAttribute(com.android.internal.R.attr.alertDialogTheme,
outValue, true);
- Log.d("AlertDialog", "getDefaultDialogTheme data " + outValue.data + " id " + outValue.resourceId);
return outValue.resourceId;
}
diff --git a/core/java/android/bluetooth/BluetoothDeviceProfileState.java b/core/java/android/bluetooth/BluetoothDeviceProfileState.java
index e460839..1c53c45 100644
--- a/core/java/android/bluetooth/BluetoothDeviceProfileState.java
+++ b/core/java/android/bluetooth/BluetoothDeviceProfileState.java
@@ -75,6 +75,7 @@
public static final int DISCONNECT_A2DP_INCOMING = 53;
public static final int DISCONNECT_HID_OUTGOING = 54;
public static final int DISCONNECT_HID_INCOMING = 55;
+ public static final int DISCONNECT_PBAP_OUTGOING = 56;
public static final int UNPAIR = 100;
public static final int AUTO_CONNECT_PROFILES = 101;
@@ -94,6 +95,8 @@
private BluetoothService mService;
private BluetoothA2dpService mA2dpService;
private BluetoothHeadset mHeadsetService;
+ private BluetoothPbap mPbapService;
+ private boolean mPbapServiceConnected;
private BluetoothDevice mDevice;
private int mHeadsetState = BluetoothProfile.STATE_DISCONNECTED;
@@ -201,6 +204,8 @@
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
adapter.getProfileProxy(mContext, mBluetoothProfileServiceListener,
BluetoothProfile.HEADSET);
+ // TODO(): Convert PBAP to the new Profile APIs.
+ PbapServiceListener p = new PbapServiceListener();
}
private BluetoothProfile.ServiceListener mBluetoothProfileServiceListener =
@@ -217,6 +222,22 @@
}
};
+ private class PbapServiceListener implements BluetoothPbap.ServiceListener {
+ public PbapServiceListener() {
+ mPbapService = new BluetoothPbap(mContext, this);
+ }
+ public void onServiceConnected() {
+ synchronized(BluetoothDeviceProfileState.this) {
+ mPbapServiceConnected = true;
+ }
+ }
+ public void onServiceDisconnected() {
+ synchronized(BluetoothDeviceProfileState.this) {
+ mPbapServiceConnected = false;
+ }
+ }
+ }
+
private class BondedDevice extends HierarchicalState {
@Override
protected void enter() {
@@ -255,6 +276,9 @@
case DISCONNECT_HID_INCOMING:
transitionTo(mIncomingHid);
break;
+ case DISCONNECT_PBAP_OUTGOING:
+ processCommand(DISCONNECT_PBAP_OUTGOING);
+ break;
case UNPAIR:
if (mHeadsetState != BluetoothHeadset.STATE_DISCONNECTED) {
sendMessage(DISCONNECT_HFP_OUTGOING);
@@ -404,6 +428,7 @@
deferMessage(deferMsg);
}
break; // ignore
+ case DISCONNECT_PBAP_OUTGOING:
case UNPAIR:
case AUTO_CONNECT_PROFILES:
deferMessage(message);
@@ -478,6 +503,7 @@
case CONNECT_HID_INCOMING:
case DISCONNECT_HID_INCOMING:
break; // ignore
+ case DISCONNECT_PBAP_OUTGOING:
case UNPAIR:
case AUTO_CONNECT_PROFILES:
deferMessage(message);
@@ -582,6 +608,7 @@
deferMessage(deferMsg);
}
break; // ignore
+ case DISCONNECT_PBAP_OUTGOING:
case UNPAIR:
case AUTO_CONNECT_PROFILES:
deferMessage(message);
@@ -654,6 +681,7 @@
case CONNECT_HID_INCOMING:
case DISCONNECT_HID_INCOMING:
break; // ignore
+ case DISCONNECT_PBAP_OUTGOING:
case UNPAIR:
case AUTO_CONNECT_PROFILES:
deferMessage(message);
@@ -734,7 +762,7 @@
case DISCONNECT_HID_INCOMING:
// Ignore, will be handled by Bluez
break;
-
+ case DISCONNECT_PBAP_OUTGOING:
case UNPAIR:
case AUTO_CONNECT_PROFILES:
deferMessage(message);
@@ -792,6 +820,7 @@
case DISCONNECT_A2DP_INCOMING:
// Ignore, will be handled by Bluez
break;
+ case DISCONNECT_PBAP_OUTGOING:
case UNPAIR:
case AUTO_CONNECT_PROFILES:
deferMessage(message);
@@ -818,7 +847,7 @@
}
}
- synchronized void deferHeadsetMessage(int command) {
+ synchronized void deferProfileServiceMessage(int command) {
Message msg = new Message();
msg.what = command;
deferMessage(msg);
@@ -829,14 +858,14 @@
switch(command) {
case CONNECT_HFP_OUTGOING:
if (mHeadsetService == null) {
- deferHeadsetMessage(command);
+ deferProfileServiceMessage(command);
} else {
return mHeadsetService.connectHeadsetInternal(mDevice);
}
break;
case CONNECT_HFP_INCOMING:
if (mHeadsetService == null) {
- deferHeadsetMessage(command);
+ deferProfileServiceMessage(command);
} else if (mHeadsetState == BluetoothHeadset.STATE_CONNECTING) {
return mHeadsetService.acceptIncomingConnect(mDevice);
} else if (mHeadsetState == BluetoothHeadset.STATE_DISCONNECTED) {
@@ -857,8 +886,13 @@
return true;
case DISCONNECT_HFP_OUTGOING:
if (mHeadsetService == null) {
- deferHeadsetMessage(command);
+ deferProfileServiceMessage(command);
} else {
+ // Disconnect PBAP
+ // TODO(): Add PBAP to the state machine.
+ Message m = new Message();
+ m.what = DISCONNECT_PBAP_OUTGOING;
+ deferMessage(m);
if (mHeadsetService.getPriority(mDevice) ==
BluetoothHeadset.PRIORITY_AUTO_CONNECT) {
mHeadsetService.setPriority(mDevice, BluetoothHeadset.PRIORITY_ON);
@@ -890,6 +924,13 @@
mService.setInputDevicePriority(mDevice, BluetoothInputDevice.PRIORITY_ON);
}
return mService.disconnectInputDeviceInternal(mDevice);
+ case DISCONNECT_PBAP_OUTGOING:
+ if (!mPbapServiceConnected) {
+ deferProfileServiceMessage(command);
+ } else {
+ return mPbapService.disconnect();
+ }
+ break;
case UNPAIR:
return mService.removeBondInternal(mDevice.getAddress());
default:
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index cf95872..56babdd2 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -2553,6 +2553,19 @@
/**
+ * This preference contains the string that shows for owner info on LockScren.
+ * @hide
+ */
+ public static final String LOCK_SCREEN_OWNER_INFO = "lock_screen_owner_info";
+
+ /**
+ * This preference enables showing the owner info on LockScren.
+ * @hide
+ */
+ public static final String LOCK_SCREEN_OWNER_INFO_ENABLED =
+ "lock_screen_owner_info_enabled";
+
+ /**
* Whether assisted GPS should be enabled or not.
* @hide
*/
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 7ee360d..8e4591a 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -2037,8 +2037,6 @@
*
*/
boolean mCanAcceptDrop;
- private int mThumbnailWidth;
- private int mThumbnailHeight;
/**
* Simple constructor to use when creating a view from code.
@@ -9921,10 +9919,14 @@
throw new IllegalStateException("Drag thumb dimensions must not be negative");
}
+ if (ViewDebug.DEBUG_DRAG) {
+ Log.d(VIEW_LOG_TAG, "drag thumb: width=" + thumbSize.x + " height=" + thumbSize.y
+ + " thumbX=" + thumbTouchPoint.x + " thumbY=" + thumbTouchPoint.y);
+ }
Surface surface = new Surface();
try {
IBinder token = mAttachInfo.mSession.prepareDrag(mAttachInfo.mWindow,
- myWindowOnly, mThumbnailWidth, mThumbnailHeight, surface);
+ myWindowOnly, thumbSize.x, thumbSize.y, surface);
if (ViewDebug.DEBUG_DRAG) Log.d(VIEW_LOG_TAG, "prepareDrag returned token=" + token
+ " surface=" + surface);
if (token != null) {
@@ -9951,53 +9953,6 @@
return okay;
}
- private void measureThumbnail() {
- mPrivateFlags &= ~MEASURED_DIMENSION_SET;
-
- onMeasureDragThumbnail();
-
- // flag not set, setDragThumbnailDimension() was not invoked, we raise
- // an exception to warn the developer
- if ((mPrivateFlags & MEASURED_DIMENSION_SET) != MEASURED_DIMENSION_SET) {
- throw new IllegalStateException("onMeasureDragThumbnail() did not set the"
- + " measured dimension by calling setDragThumbnailDimension()");
- }
-
- if (ViewDebug.DEBUG_DRAG) {
- Log.d(VIEW_LOG_TAG, "Drag thumb measured: w=" + mThumbnailWidth
- + " h=" + mThumbnailHeight);
- }
- }
-
- /**
- * The View must call this method from onMeasureDragThumbnail() in order to
- * specify the dimensions of the drag thumbnail image.
- *
- * @param width The desired thumbnail width.
- * @param height The desired thumbnail height.
- */
- protected final void setDragThumbnailDimension(int width, int height) {
- mPrivateFlags |= MEASURED_DIMENSION_SET;
- mThumbnailWidth = width;
- mThumbnailHeight = height;
- }
-
- /**
- * The default implementation specifies a drag thumbnail that matches the
- * View's current size and appearance.
- */
- protected void onMeasureDragThumbnail() {
- setDragThumbnailDimension(getWidth(), getHeight());
- }
-
- /**
- * The default implementation just draws the current View appearance as the thumbnail
- * @param canvas
- */
- protected void onDrawDragThumbnail(Canvas canvas) {
- draw(canvas);
- }
-
/**
* Drag-and-drop event dispatch. The event.getAction() verb is one of the DragEvent
* constants DRAG_STARTED_EVENT, DRAG_EVENT, DROP_EVENT, and DRAG_ENDED_EVENT.
diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java
index 4689740..1dd2e8f 100644
--- a/core/java/android/webkit/WebSettings.java
+++ b/core/java/android/webkit/WebSettings.java
@@ -179,7 +179,6 @@
private boolean mUseDoubleTree = false;
private boolean mUseWideViewport = false;
private boolean mUseFixedViewport = false;
- private int mMaxFixedViewportWidth = WebView.DEFAULT_VIEWPORT_WIDTH;
private boolean mSupportMultipleWindows = false;
private boolean mShrinksStandaloneImagesToFit = false;
private long mMaximumDecodedImageSize = 0; // 0 means default
@@ -378,7 +377,6 @@
final int minTabletWidth = context.getResources().getDimensionPixelSize(
com.android.internal.R.dimen.min_xlarge_screen_width);
mUseFixedViewport = (metrics.density == 1.0f && landscapeWidth >= minTabletWidth);
- mMaxFixedViewportWidth = (int) (landscapeWidth * 1.25);
if (sLockForLocaleSettings == null) {
sLockForLocaleSettings = new Object();
@@ -1570,13 +1568,6 @@
}
/**
- * Returns maximum fixed viewport width.
- */
- /* package */ int getMaxFixedViewportWidth() {
- return mMaxFixedViewportWidth;
- }
-
- /**
* Returns whether private browsing is enabled.
*/
/* package */ boolean isPrivateBrowsingEnabled() {
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index a7e51a4..e66b988 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -319,6 +319,8 @@
private ZoomManager mZoomManager;
+ private Rect mGLRectViewport;
+
/**
* Transportation object for returning WebView across thread boundaries.
*/
@@ -3718,8 +3720,11 @@
if (canvas.isHardwareAccelerated()) {
try {
if (canvas.acquireContext()) {
- Rect rect = new Rect(getLeft(), getTop(), getRight(),
- getBottom() - getVisibleTitleHeight());
+ Rect rect = new Rect(mGLRectViewport.left,
+ mGLRectViewport.top,
+ mGLRectViewport.right,
+ mGLRectViewport.bottom
+ - getVisibleTitleHeight());
if (nativeDrawGL(rect, getScale(), extras)) {
invalidate();
}
@@ -4622,6 +4627,16 @@
super.onFocusChanged(focused, direction, previouslyFocusedRect);
}
+ void setGLRectViewport() {
+ View window = getRootView();
+ int[] location = new int[2];
+ getLocationInWindow(location);
+ mGLRectViewport = new Rect(location[0], window.getHeight()
+ - (location[1] + getHeight()),
+ location[0] + getWidth(),
+ window.getHeight() - location[1]);
+ }
+
/**
* @hide
*/
@@ -4637,6 +4652,7 @@
// notify the WebKit about the new dimensions.
sendViewSizeZoom(false);
}
+ setGLRectViewport();
return changed;
}
diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java
index 73ead27..d7f46af 100644
--- a/core/java/android/webkit/WebViewCore.java
+++ b/core/java/android/webkit/WebViewCore.java
@@ -1817,7 +1817,6 @@
int mScrollX;
int mScrollY;
boolean mMobileSite;
- int mViewportWidth;
}
static class DrawData {
@@ -1859,15 +1858,6 @@
}
if (mInitialViewState != null) {
draw.mViewState = mInitialViewState;
- if (mViewportWidth == -1 && mSettings.getUseFixedViewport() &&
- mSettings.getUseWideViewPort()) {
- final int fixedViewportMargin = mContext.getResources().getDimensionPixelSize(
- com.android.internal.R.dimen.fixed_viewport_margin);
- // Use website's initial preferred width as the fixed viewport width.
- mViewportWidth = Math.min(mSettings.getMaxFixedViewportWidth(),
- draw.mMinPrefWidth + 2 * fixedViewportMargin);
- draw.mViewState.mViewportWidth = mViewportWidth;
- }
mInitialViewState = null;
}
if (DebugFlags.WEB_VIEW_CORE) Log.v(LOGTAG, "webkitDraw NEW_PICTURE_MSG_ID");
@@ -2201,7 +2191,6 @@
mInitialViewState.mScrollX = mRestoredX;
mInitialViewState.mScrollY = mRestoredY;
mInitialViewState.mMobileSite = (0 == mViewportWidth);
- mInitialViewState.mViewportWidth = mViewportWidth;
if (mRestoredScale > 0) {
mInitialViewState.mViewScale = mRestoredScale / 100.0f;
if (mRestoredTextWrapScale > 0) {
diff --git a/core/java/android/webkit/ZoomManager.java b/core/java/android/webkit/ZoomManager.java
index 2096fc4..b0a96be 100644
--- a/core/java/android/webkit/ZoomManager.java
+++ b/core/java/android/webkit/ZoomManager.java
@@ -778,12 +778,6 @@
} else {
mMaxZoomScale = viewState.mMaxScale;
}
- if (viewState.mViewportWidth > 0 &&
- mWebView.getSettings().getUseFixedViewport() &&
- mWebView.getSettings().getUseWideViewPort()) {
- // Use website specified viewport width.
- setZoomOverviewWidth(viewState.mViewportWidth);
- }
}
/**
@@ -793,15 +787,19 @@
public void onNewPicture(WebViewCore.DrawData drawData) {
final int viewWidth = mWebView.getViewWidth();
- if (!mWebView.getSettings().getUseFixedViewport()
- && mWebView.getSettings().getUseWideViewPort()) {
- // limit mZoomOverviewWidth upper bound to
- // sMaxViewportWidth so that if the page doesn't behave
- // well, the WebView won't go insane. limit the lower
- // bound to match the default scale for mobile sites.
- setZoomOverviewWidth(Math.min(WebView.sMaxViewportWidth,
+ if (mWebView.getSettings().getUseWideViewPort()) {
+ if (!mWebView.getSettings().getUseFixedViewport()) {
+ // limit mZoomOverviewWidth upper bound to
+ // sMaxViewportWidth so that if the page doesn't behave
+ // well, the WebView won't go insane. limit the lower
+ // bound to match the default scale for mobile sites.
+ setZoomOverviewWidth(Math.min(WebView.sMaxViewportWidth,
Math.max((int) (viewWidth * mInvDefaultScale),
Math.max(drawData.mMinPrefWidth, drawData.mViewPoint.x))));
+ } else {
+ final int contentWidth = drawData.mWidthHeight.x;
+ setZoomOverviewWidth(Math.min(WebView.sMaxViewportWidth, contentWidth));
+ }
}
final float zoomOverviewScale = getZoomOverviewScale();
@@ -832,20 +830,26 @@
WebViewCore.ViewState viewState = drawData.mViewState;
final Point viewSize = drawData.mViewPoint;
updateZoomRange(viewState, viewSize.x, drawData.mMinPrefWidth);
+ if (mWebView.getSettings().getUseWideViewPort() &&
+ mWebView.getSettings().getUseFixedViewport()) {
+ final int contentWidth = drawData.mWidthHeight.x;
+ setZoomOverviewWidth(Math.min(WebView.sMaxViewportWidth, contentWidth));
+ }
if (!mWebView.drawHistory()) {
final float scale;
final boolean reflowText;
+ WebSettings settings = mWebView.getSettings();
if (mInitialScale > 0) {
scale = mInitialScale;
reflowText = exceedsMinScaleIncrement(mTextWrapScale, scale);
- } else if (viewState.mViewScale > 0) {
+ } else if (viewState.mViewScale > 0 &&
+ (viewState.mMobileSite || !settings.getUseFixedViewport())) {
mTextWrapScale = viewState.mTextWrapScale;
scale = viewState.mViewScale;
reflowText = false;
} else {
- WebSettings settings = mWebView.getSettings();
if (settings.getUseWideViewPort()
&& (settings.getLoadWithOverviewMode() || settings.getUseFixedViewport())) {
mInitialZoomOverview = true;
diff --git a/core/java/android/widget/AdapterViewAnimator.java b/core/java/android/widget/AdapterViewAnimator.java
index b7b1a23..87453ae 100644
--- a/core/java/android/widget/AdapterViewAnimator.java
+++ b/core/java/android/widget/AdapterViewAnimator.java
@@ -138,8 +138,8 @@
/**
* In and out animations.
*/
- ObjectAnimator<?> mInAnimation;
- ObjectAnimator<?> mOutAnimation;
+ ObjectAnimator mInAnimation;
+ ObjectAnimator mOutAnimation;
private ArrayList<View> mViewsToBringToFront;
@@ -246,12 +246,16 @@
}
}
- ObjectAnimator<?> getDefaultInAnimation() {
- return new ObjectAnimator<Float>(DEFAULT_ANIMATION_DURATION, null, "alpha", 0.0f, 1.0f);
+ ObjectAnimator getDefaultInAnimation() {
+ ObjectAnimator anim = ObjectAnimator.ofFloat(null, "alpha", 0.0f, 1.0f);
+ anim.setDuration(DEFAULT_ANIMATION_DURATION);
+ return anim;
}
- ObjectAnimator<?> getDefaultOutAnimation() {
- return new ObjectAnimator<Float>(DEFAULT_ANIMATION_DURATION, null, "alpha", 1.0f, 0.0f);
+ ObjectAnimator getDefaultOutAnimation() {
+ ObjectAnimator anim = ObjectAnimator.ofFloat(null, "alpha", 1.0f, 0.0f);
+ anim.setDuration(DEFAULT_ANIMATION_DURATION);
+ return anim;
}
/**
@@ -341,7 +345,9 @@
if (relativeIndex >= 0 && relativeIndex <= mNumActiveViews - 1 && mAdapter != null) {
int adapterCount = mAdapter.getCount();
int i = modulo(mCurrentWindowStartUnbounded + relativeIndex, adapterCount);
- return mViewsMap.get(i).view;
+ if (mViewsMap.get(i) != null) {
+ return mViewsMap.get(i).view;
+ }
}
return null;
}
@@ -692,10 +698,10 @@
*
* @return An Animation or null if none is set.
*
- * @see #setInAnimation(android.view.animation.Animation)
+ * @see #setInAnimation(android.animation.ObjectAnimator)
* @see #setInAnimation(android.content.Context, int)
*/
- public ObjectAnimator<?> getInAnimation() {
+ public ObjectAnimator getInAnimation() {
return mInAnimation;
}
@@ -707,7 +713,7 @@
* @see #getInAnimation()
* @see #setInAnimation(android.content.Context, int)
*/
- public void setInAnimation(ObjectAnimator<?> inAnimation) {
+ public void setInAnimation(ObjectAnimator inAnimation) {
mInAnimation = inAnimation;
}
@@ -716,10 +722,10 @@
*
* @return An Animation or null if none is set.
*
- * @see #setOutAnimation(android.view.animation.Animation)
+ * @see #setOutAnimation(android.animation.ObjectAnimator)
* @see #setOutAnimation(android.content.Context, int)
*/
- public ObjectAnimator<?> getOutAnimation() {
+ public ObjectAnimator getOutAnimation() {
return mOutAnimation;
}
@@ -731,7 +737,7 @@
* @see #getOutAnimation()
* @see #setOutAnimation(android.content.Context, int)
*/
- public void setOutAnimation(ObjectAnimator<?> outAnimation) {
+ public void setOutAnimation(ObjectAnimator outAnimation) {
mOutAnimation = outAnimation;
}
@@ -742,10 +748,10 @@
* @param resourceID The resource id of the animation.
*
* @see #getInAnimation()
- * @see #setInAnimation(android.view.animation.Animation)
+ * @see #setInAnimation(android.animation.ObjectAnimator)
*/
public void setInAnimation(Context context, int resourceID) {
- setInAnimation((ObjectAnimator<?>) AnimatorInflater.loadAnimator(context, resourceID));
+ setInAnimation((ObjectAnimator) AnimatorInflater.loadAnimator(context, resourceID));
}
/**
@@ -755,10 +761,10 @@
* @param resourceID The resource id of the animation.
*
* @see #getOutAnimation()
- * @see #setOutAnimation(android.view.animation.Animation)
+ * @see #setOutAnimation(android.animation.ObjectAnimator)
*/
public void setOutAnimation(Context context, int resourceID) {
- setOutAnimation((ObjectAnimator<?>) AnimatorInflater.loadAnimator(context, resourceID));
+ setOutAnimation((ObjectAnimator) AnimatorInflater.loadAnimator(context, resourceID));
}
/**
diff --git a/core/java/android/widget/StackView.java b/core/java/android/widget/StackView.java
index f0954e2..7e01506 100644
--- a/core/java/android/widget/StackView.java
+++ b/core/java/android/widget/StackView.java
@@ -175,8 +175,8 @@
}
view.setVisibility(VISIBLE);
- ObjectAnimator<Float> fadeIn = new ObjectAnimator<Float>(DEFAULT_ANIMATION_DURATION,
- view, "alpha", view.getAlpha(), 1.0f);
+ ObjectAnimator fadeIn = ObjectAnimator.ofFloat(view, "alpha", view.getAlpha(), 1.0f);
+ fadeIn.setDuration(DEFAULT_ANIMATION_DURATION);
fadeIn.start();
} else if (fromIndex == mNumActiveViews - 1 && toIndex == mNumActiveViews - 2) {
// Slide item in
@@ -186,12 +186,11 @@
int duration = Math.round(mStackSlider.getDurationForNeutralPosition(mYVelocity));
StackSlider animationSlider = new StackSlider(mStackSlider);
- PropertyValuesHolder<Float> slideInY =
- new PropertyValuesHolder<Float>("YProgress", 0.0f);
- PropertyValuesHolder<Float> slideInX =
- new PropertyValuesHolder<Float>("XProgress", 0.0f);
- ObjectAnimator pa = new ObjectAnimator(duration, animationSlider,
+ PropertyValuesHolder slideInY = PropertyValuesHolder.ofFloat("YProgress", 0.0f);
+ PropertyValuesHolder slideInX = PropertyValuesHolder.ofFloat("XProgress", 0.0f);
+ ObjectAnimator pa = ObjectAnimator.ofPropertyValuesHolder(animationSlider,
slideInX, slideInY);
+ pa.setDuration(duration);
pa.setInterpolator(new LinearInterpolator());
pa.start();
} else if (fromIndex == mNumActiveViews - 2 && toIndex == mNumActiveViews - 1) {
@@ -201,12 +200,11 @@
int duration = Math.round(mStackSlider.getDurationForOffscreenPosition(mYVelocity));
StackSlider animationSlider = new StackSlider(mStackSlider);
- PropertyValuesHolder<Float> slideOutY =
- new PropertyValuesHolder<Float>("YProgress", 1.0f);
- PropertyValuesHolder<Float> slideOutX =
- new PropertyValuesHolder<Float>("XProgress", 0.0f);
- ObjectAnimator pa = new ObjectAnimator(duration, animationSlider,
- slideOutX, slideOutY);
+ PropertyValuesHolder slideOutY = PropertyValuesHolder.ofFloat("YProgress", 1.0f);
+ PropertyValuesHolder slideOutX = PropertyValuesHolder.ofFloat("XProgress", 0.0f);
+ ObjectAnimator pa = ObjectAnimator.ofPropertyValuesHolder(animationSlider,
+ slideOutX, slideOutY);
+ pa.setDuration(duration);
pa.setInterpolator(new LinearInterpolator());
pa.start();
} else if (fromIndex == -1 && toIndex == mNumActiveViews - 1) {
@@ -217,8 +215,8 @@
lp.setVerticalOffset(-mSlideAmount);
} else if (toIndex == -1) {
// Fade item out
- ObjectAnimator<Float> fadeOut = new ObjectAnimator<Float>
- (DEFAULT_ANIMATION_DURATION, view, "alpha", view.getAlpha(), 0.0f);
+ ObjectAnimator fadeOut = ObjectAnimator.ofFloat(view, "alpha", view.getAlpha(), 0.0f);
+ fadeOut.setDuration(DEFAULT_ANIMATION_DURATION);
fadeOut.start();
}
@@ -236,8 +234,8 @@
float r = (index * 1.0f) / (mNumActiveViews - 2);
float scale = 1 - PERSPECTIVE_SCALE_FACTOR * (1 - r);
- PropertyValuesHolder<Float> scaleX = new PropertyValuesHolder<Float>("scaleX", scale);
- PropertyValuesHolder<Float> scaleY = new PropertyValuesHolder<Float>("scaleY", scale);
+ PropertyValuesHolder scaleX = PropertyValuesHolder.ofFloat("scaleX", scale);
+ PropertyValuesHolder scaleY = PropertyValuesHolder.ofFloat("scaleY", scale);
r = (float) Math.pow(r, 2);
@@ -247,9 +245,9 @@
(mMeasuredHeight * (1 - PERSPECTIVE_SHIFT_FACTOR) / 2.0f);
float transY = perspectiveTranslation + scaleShiftCorrection;
- PropertyValuesHolder<Float> translationY =
- new PropertyValuesHolder<Float>("translationY", transY);
- ObjectAnimator pa = new ObjectAnimator(100, view, scaleX, scaleY, translationY);
+ PropertyValuesHolder translationY = PropertyValuesHolder.ofFloat("translationY", transY);
+ ObjectAnimator pa = ObjectAnimator.ofPropertyValuesHolder(view, scaleX, scaleY, translationY);
+ pa.setDuration(100);
pa.start();
}
@@ -538,12 +536,11 @@
}
StackSlider animationSlider = new StackSlider(mStackSlider);
- PropertyValuesHolder<Float> snapBackY =
- new PropertyValuesHolder<Float>("YProgress", finalYProgress);
- PropertyValuesHolder<Float> snapBackX =
- new PropertyValuesHolder<Float>("XProgress", 0.0f);
- ObjectAnimator pa = new ObjectAnimator(duration, animationSlider,
+ PropertyValuesHolder snapBackY = PropertyValuesHolder.ofFloat("YProgress", finalYProgress);
+ PropertyValuesHolder snapBackX = PropertyValuesHolder.ofFloat("XProgress", 0.0f);
+ ObjectAnimator pa = ObjectAnimator.ofPropertyValuesHolder(animationSlider,
snapBackX, snapBackY);
+ pa.setDuration(duration);
pa.setInterpolator(new LinearInterpolator());
pa.start();
} else if (mSwipeGestureType == GESTURE_SLIDE_DOWN) {
@@ -557,12 +554,12 @@
}
StackSlider animationSlider = new StackSlider(mStackSlider);
- PropertyValuesHolder<Float> snapBackY =
- new PropertyValuesHolder<Float>("YProgress", finalYProgress);
- PropertyValuesHolder<Float> snapBackX =
- new PropertyValuesHolder<Float>("XProgress", 0.0f);
- ObjectAnimator pa = new ObjectAnimator(duration, animationSlider,
+ PropertyValuesHolder snapBackY =
+ PropertyValuesHolder.ofFloat("YProgress",finalYProgress);
+ PropertyValuesHolder snapBackX = PropertyValuesHolder.ofFloat("XProgress", 0.0f);
+ ObjectAnimator pa = ObjectAnimator.ofPropertyValuesHolder(animationSlider,
snapBackX, snapBackY);
+ pa.setDuration(duration);
pa.start();
}
diff --git a/core/java/com/android/internal/widget/ActionBarView.java b/core/java/com/android/internal/widget/ActionBarView.java
index 054423c..4c3bba1 100644
--- a/core/java/com/android/internal/widget/ActionBarView.java
+++ b/core/java/com/android/internal/widget/ActionBarView.java
@@ -351,7 +351,7 @@
break;
case ActionBar.NAVIGATION_MODE_DROPDOWN_LIST:
mSpinner = new Spinner(mContext, null,
- com.android.internal.R.attr.dropDownSpinnerStyle);
+ com.android.internal.R.attr.actionDropDownStyle);
mSpinner.setOnItemSelectedListener(mNavItemSelectedListener);
addView(mSpinner);
break;
diff --git a/core/java/com/android/internal/widget/DrawableHolder.java b/core/java/com/android/internal/widget/DrawableHolder.java
index d53860c..958cabb 100644
--- a/core/java/com/android/internal/widget/DrawableHolder.java
+++ b/core/java/com/android/internal/widget/DrawableHolder.java
@@ -41,8 +41,8 @@
private float mScaleY = 1.0f;
private BitmapDrawable mDrawable;
private float mAlpha = 1f;
- private ArrayList<ObjectAnimator<Float>> mAnimators = new ArrayList<ObjectAnimator<Float>>();
- private ArrayList<ObjectAnimator<Float>> mNeedToStart = new ArrayList<ObjectAnimator<Float>>();
+ private ArrayList<ObjectAnimator> mAnimators = new ArrayList<ObjectAnimator>();
+ private ArrayList<ObjectAnimator> mNeedToStart = new ArrayList<ObjectAnimator>();
public DrawableHolder(BitmapDrawable drawable) {
this(drawable, 0.0f, 0.0f);
@@ -67,12 +67,13 @@
* @param toValue the target value
* @param replace if true, replace the current animation with this one.
*/
- public ObjectAnimator<Float> addAnimTo(long duration, long delay,
+ public ObjectAnimator addAnimTo(long duration, long delay,
String property, float toValue, boolean replace) {
if (replace) removeAnimationFor(property);
- ObjectAnimator<Float> anim = new ObjectAnimator<Float>(duration, this, property, toValue);
+ ObjectAnimator anim = ObjectAnimator.ofFloat(this, property, toValue);
+ anim.setDuration(duration);
anim.setStartDelay(delay);
anim.setInterpolator(EASE_OUT_INTERPOLATOR);
this.addAnimation(anim, replace);
@@ -86,8 +87,8 @@
* @param property
*/
public void removeAnimationFor(String property) {
- ArrayList<ObjectAnimator<Float>> removalList = new ArrayList<ObjectAnimator<Float>>();
- for (ObjectAnimator<Float> currentAnim : mAnimators) {
+ ArrayList<ObjectAnimator> removalList = new ArrayList<ObjectAnimator>();
+ for (ObjectAnimator currentAnim : mAnimators) {
if (property.equals(currentAnim.getPropertyName())) {
currentAnim.cancel();
removalList.add(currentAnim);
@@ -101,7 +102,7 @@
* Stops all animations and removes them from the list.
*/
public void clearAnimations() {
- for (ObjectAnimator<Float> currentAnim : mAnimators) {
+ for (ObjectAnimator currentAnim : mAnimators) {
currentAnim.cancel();
}
mAnimators.clear();
@@ -114,7 +115,7 @@
* @param overwrite
* @return
*/
- private DrawableHolder addAnimation(ObjectAnimator<Float> anim, boolean overwrite) {
+ private DrawableHolder addAnimation(ObjectAnimator anim, boolean overwrite) {
if (anim != null)
mAnimators.add(anim);
mNeedToStart.add(anim);
@@ -148,7 +149,7 @@
*/
public void startAnimations(ValueAnimator.AnimatorUpdateListener listener) {
for (int i = 0; i < mNeedToStart.size(); i++) {
- ObjectAnimator<Float> anim = mNeedToStart.get(i);
+ ObjectAnimator anim = mNeedToStart.get(i);
anim.addUpdateListener(listener);
anim.addListener(this);
anim.start();
diff --git a/core/res/res/drawable-hdpi/spinner_active_holo_dark.9.png b/core/res/res/drawable-hdpi/spinner_active_holo_dark.9.png
new file mode 100644
index 0000000..bbf2861
--- /dev/null
+++ b/core/res/res/drawable-hdpi/spinner_active_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/spinner_active_holo_light.9.png b/core/res/res/drawable-hdpi/spinner_active_holo_light.9.png
new file mode 100644
index 0000000..a10098d
--- /dev/null
+++ b/core/res/res/drawable-hdpi/spinner_active_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/spinner_cab_active_holo_dark.9.png b/core/res/res/drawable-hdpi/spinner_cab_active_holo_dark.9.png
new file mode 100644
index 0000000..ffae7e7
--- /dev/null
+++ b/core/res/res/drawable-hdpi/spinner_cab_active_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/spinner_cab_active_holo_light.9.png b/core/res/res/drawable-hdpi/spinner_cab_active_holo_light.9.png
new file mode 100644
index 0000000..eaa38e2
--- /dev/null
+++ b/core/res/res/drawable-hdpi/spinner_cab_active_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/spinner_cab_default_holo_dark.9.png b/core/res/res/drawable-hdpi/spinner_cab_default_holo_dark.9.png
new file mode 100644
index 0000000..8693710
--- /dev/null
+++ b/core/res/res/drawable-hdpi/spinner_cab_default_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/spinner_cab_default_holo_light.9.png b/core/res/res/drawable-hdpi/spinner_cab_default_holo_light.9.png
new file mode 100644
index 0000000..941739e
--- /dev/null
+++ b/core/res/res/drawable-hdpi/spinner_cab_default_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/spinner_cab_disabled_holo_dark.9.png b/core/res/res/drawable-hdpi/spinner_cab_disabled_holo_dark.9.png
new file mode 100644
index 0000000..e672c95
--- /dev/null
+++ b/core/res/res/drawable-hdpi/spinner_cab_disabled_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/spinner_cab_disabled_holo_light.9.png b/core/res/res/drawable-hdpi/spinner_cab_disabled_holo_light.9.png
new file mode 100644
index 0000000..f499540
--- /dev/null
+++ b/core/res/res/drawable-hdpi/spinner_cab_disabled_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/spinner_cab_focused_holo_dark.9.png b/core/res/res/drawable-hdpi/spinner_cab_focused_holo_dark.9.png
new file mode 100644
index 0000000..f4900a5
--- /dev/null
+++ b/core/res/res/drawable-hdpi/spinner_cab_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/spinner_cab_focused_holo_light.9.png b/core/res/res/drawable-hdpi/spinner_cab_focused_holo_light.9.png
new file mode 100644
index 0000000..1286542
--- /dev/null
+++ b/core/res/res/drawable-hdpi/spinner_cab_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/spinner_cab_pressed_holo_dark.9.png b/core/res/res/drawable-hdpi/spinner_cab_pressed_holo_dark.9.png
new file mode 100644
index 0000000..dc236ec
--- /dev/null
+++ b/core/res/res/drawable-hdpi/spinner_cab_pressed_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/spinner_cab_pressed_holo_light.9.png b/core/res/res/drawable-hdpi/spinner_cab_pressed_holo_light.9.png
new file mode 100644
index 0000000..17e3a27
--- /dev/null
+++ b/core/res/res/drawable-hdpi/spinner_cab_pressed_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/spinner_default_holo_dark.9.png b/core/res/res/drawable-hdpi/spinner_default_holo_dark.9.png
new file mode 100644
index 0000000..7189c6d
--- /dev/null
+++ b/core/res/res/drawable-hdpi/spinner_default_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/spinner_default_holo_light.9.png b/core/res/res/drawable-hdpi/spinner_default_holo_light.9.png
new file mode 100644
index 0000000..996ef15
--- /dev/null
+++ b/core/res/res/drawable-hdpi/spinner_default_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/spinner_disabled_holo_dark.9.png b/core/res/res/drawable-hdpi/spinner_disabled_holo_dark.9.png
new file mode 100644
index 0000000..adde694
--- /dev/null
+++ b/core/res/res/drawable-hdpi/spinner_disabled_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/spinner_disabled_holo_light.9.png b/core/res/res/drawable-hdpi/spinner_disabled_holo_light.9.png
new file mode 100644
index 0000000..fdb4bdf
--- /dev/null
+++ b/core/res/res/drawable-hdpi/spinner_disabled_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/spinner_focused_holo_dark.9.png b/core/res/res/drawable-hdpi/spinner_focused_holo_dark.9.png
new file mode 100644
index 0000000..d40d165
--- /dev/null
+++ b/core/res/res/drawable-hdpi/spinner_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/spinner_focused_holo_light.9.png b/core/res/res/drawable-hdpi/spinner_focused_holo_light.9.png
new file mode 100644
index 0000000..096b977
--- /dev/null
+++ b/core/res/res/drawable-hdpi/spinner_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/spinner_pressed_holo_dark.9.png b/core/res/res/drawable-hdpi/spinner_pressed_holo_dark.9.png
new file mode 100644
index 0000000..5428b0a
--- /dev/null
+++ b/core/res/res/drawable-hdpi/spinner_pressed_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/spinner_pressed_holo_light.9.png b/core/res/res/drawable-hdpi/spinner_pressed_holo_light.9.png
new file mode 100644
index 0000000..33b661b
--- /dev/null
+++ b/core/res/res/drawable-hdpi/spinner_pressed_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/spinner_active_holo_dark.9.png b/core/res/res/drawable-mdpi/spinner_active_holo_dark.9.png
new file mode 100644
index 0000000..c235501
--- /dev/null
+++ b/core/res/res/drawable-mdpi/spinner_active_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/spinner_active_holo_light.9.png b/core/res/res/drawable-mdpi/spinner_active_holo_light.9.png
new file mode 100644
index 0000000..06e2bde
--- /dev/null
+++ b/core/res/res/drawable-mdpi/spinner_active_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/spinner_cab_active_holo_dark.9.png b/core/res/res/drawable-mdpi/spinner_cab_active_holo_dark.9.png
new file mode 100644
index 0000000..bb57d8d
--- /dev/null
+++ b/core/res/res/drawable-mdpi/spinner_cab_active_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/spinner_cab_active_holo_light.9.png b/core/res/res/drawable-mdpi/spinner_cab_active_holo_light.9.png
new file mode 100644
index 0000000..4e3edff
--- /dev/null
+++ b/core/res/res/drawable-mdpi/spinner_cab_active_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/spinner_cab_default_holo_dark.9.png b/core/res/res/drawable-mdpi/spinner_cab_default_holo_dark.9.png
new file mode 100644
index 0000000..62d2f6e
--- /dev/null
+++ b/core/res/res/drawable-mdpi/spinner_cab_default_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/spinner_cab_default_holo_light.9.png b/core/res/res/drawable-mdpi/spinner_cab_default_holo_light.9.png
new file mode 100644
index 0000000..df80aa6
--- /dev/null
+++ b/core/res/res/drawable-mdpi/spinner_cab_default_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/spinner_cab_disabled_holo_dark.9.png b/core/res/res/drawable-mdpi/spinner_cab_disabled_holo_dark.9.png
new file mode 100644
index 0000000..fc9c109
--- /dev/null
+++ b/core/res/res/drawable-mdpi/spinner_cab_disabled_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/spinner_cab_disabled_holo_light.9.png b/core/res/res/drawable-mdpi/spinner_cab_disabled_holo_light.9.png
new file mode 100644
index 0000000..7fc7cc1
--- /dev/null
+++ b/core/res/res/drawable-mdpi/spinner_cab_disabled_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/spinner_cab_focused_holo_dark.9.png b/core/res/res/drawable-mdpi/spinner_cab_focused_holo_dark.9.png
new file mode 100644
index 0000000..0f49fe9
--- /dev/null
+++ b/core/res/res/drawable-mdpi/spinner_cab_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/spinner_cab_focused_holo_light.9.png b/core/res/res/drawable-mdpi/spinner_cab_focused_holo_light.9.png
new file mode 100644
index 0000000..032d5d3
--- /dev/null
+++ b/core/res/res/drawable-mdpi/spinner_cab_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/spinner_cab_pressed_holo_dark.9.png b/core/res/res/drawable-mdpi/spinner_cab_pressed_holo_dark.9.png
new file mode 100644
index 0000000..9b8a54b
--- /dev/null
+++ b/core/res/res/drawable-mdpi/spinner_cab_pressed_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/spinner_cab_pressed_holo_light.9.png b/core/res/res/drawable-mdpi/spinner_cab_pressed_holo_light.9.png
new file mode 100644
index 0000000..6d4fa54
--- /dev/null
+++ b/core/res/res/drawable-mdpi/spinner_cab_pressed_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/spinner_default_holo_dark.9.png b/core/res/res/drawable-mdpi/spinner_default_holo_dark.9.png
new file mode 100644
index 0000000..3dba2352
--- /dev/null
+++ b/core/res/res/drawable-mdpi/spinner_default_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/spinner_default_holo_light.9.png b/core/res/res/drawable-mdpi/spinner_default_holo_light.9.png
new file mode 100644
index 0000000..4614cfa
--- /dev/null
+++ b/core/res/res/drawable-mdpi/spinner_default_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/spinner_disabled_holo_dark.9.png b/core/res/res/drawable-mdpi/spinner_disabled_holo_dark.9.png
new file mode 100644
index 0000000..95d7c86
--- /dev/null
+++ b/core/res/res/drawable-mdpi/spinner_disabled_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/spinner_disabled_holo_light.9.png b/core/res/res/drawable-mdpi/spinner_disabled_holo_light.9.png
new file mode 100644
index 0000000..2dba270
--- /dev/null
+++ b/core/res/res/drawable-mdpi/spinner_disabled_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/spinner_focused_holo_dark.9.png b/core/res/res/drawable-mdpi/spinner_focused_holo_dark.9.png
new file mode 100644
index 0000000..2e2fadd
--- /dev/null
+++ b/core/res/res/drawable-mdpi/spinner_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/spinner_focused_holo_light.9.png b/core/res/res/drawable-mdpi/spinner_focused_holo_light.9.png
new file mode 100644
index 0000000..5bbbf63
--- /dev/null
+++ b/core/res/res/drawable-mdpi/spinner_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/spinner_pressed_holo_dark.9.png b/core/res/res/drawable-mdpi/spinner_pressed_holo_dark.9.png
new file mode 100644
index 0000000..25aaed2
--- /dev/null
+++ b/core/res/res/drawable-mdpi/spinner_pressed_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/spinner_pressed_holo_light.9.png b/core/res/res/drawable-mdpi/spinner_pressed_holo_light.9.png
new file mode 100644
index 0000000..29cbc46
--- /dev/null
+++ b/core/res/res/drawable-mdpi/spinner_pressed_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable/spinner_background_holo_dark.xml b/core/res/res/drawable/spinner_background_holo_dark.xml
new file mode 100644
index 0000000..eb6b18b
--- /dev/null
+++ b/core/res/res/drawable/spinner_background_holo_dark.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_enabled="false"
+ android:drawable="@drawable/spinner_disabled_holo_dark" />
+ <item android:state_pressed="true"
+ android:drawable="@drawable/spinner_pressed_holo_dark" />
+ <item android:state_pressed="false" android:state_focused="true"
+ android:drawable="@drawable/spinner_focused_holo_dark" />
+ <item android:drawable="@drawable/spinner_default_holo_dark" />
+</selector>
diff --git a/core/res/res/drawable/spinner_background_holo_light.xml b/core/res/res/drawable/spinner_background_holo_light.xml
new file mode 100644
index 0000000..9d17ed0c
--- /dev/null
+++ b/core/res/res/drawable/spinner_background_holo_light.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_enabled="false"
+ android:drawable="@drawable/spinner_disabled_holo_light" />
+ <item android:state_pressed="true"
+ android:drawable="@drawable/spinner_pressed_holo_light" />
+ <item android:state_pressed="false" android:state_focused="true"
+ android:drawable="@drawable/spinner_focused_holo_light" />
+ <item android:drawable="@drawable/spinner_default_holo_light" />
+</selector>
diff --git a/core/res/res/drawable/spinner_cab_background_holo_dark.xml b/core/res/res/drawable/spinner_cab_background_holo_dark.xml
new file mode 100644
index 0000000..5572450
--- /dev/null
+++ b/core/res/res/drawable/spinner_cab_background_holo_dark.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_enabled="false"
+ android:drawable="@drawable/spinner_cab_disabled_holo_dark" />
+ <item android:state_pressed="true"
+ android:drawable="@drawable/spinner_cab_pressed_holo_dark" />
+ <item android:state_pressed="false" android:state_focused="true"
+ android:drawable="@drawable/spinner_cab_focused_holo_dark" />
+ <item android:drawable="@drawable/spinner_cab_default_holo_dark" />
+</selector>
diff --git a/core/res/res/drawable/spinner_cab_background_holo_light.xml b/core/res/res/drawable/spinner_cab_background_holo_light.xml
new file mode 100644
index 0000000..98ff48d
--- /dev/null
+++ b/core/res/res/drawable/spinner_cab_background_holo_light.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_enabled="false"
+ android:drawable="@drawable/spinner_cab_disabled_holo_light" />
+ <item android:state_pressed="true"
+ android:drawable="@drawable/spinner_cab_pressed_holo_light" />
+ <item android:state_pressed="false" android:state_focused="true"
+ android:drawable="@drawable/spinner_cab_focused_holo_light" />
+ <item android:drawable="@drawable/spinner_cab_default_holo_light" />
+</selector>
diff --git a/core/res/res/layout/action_menu_item_layout.xml b/core/res/res/layout/action_menu_item_layout.xml
index 5e89f52..1f3117b 100644
--- a/core/res/res/layout/action_menu_item_layout.xml
+++ b/core/res/res/layout/action_menu_item_layout.xml
@@ -17,7 +17,11 @@
<com.android.internal.view.menu.ActionMenuItemView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center">
+ android:layout_gravity="center"
+ android:minWidth="64dip"
+ android:minHeight="?attr/actionBarSize"
+ android:paddingLeft="12dip"
+ android:paddingRight="12dip">
<ImageButton android:id="@+id/imageButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -30,5 +34,8 @@
android:layout_gravity="center"
android:visibility="gone"
android:background="?attr/groupButtonBackground"
- style="?attr/buttonStyleSmall" />
+ android:textAppearance="?attr/textAppearanceMedium"
+ style="?attr/buttonStyleSmall"
+ android:paddingLeft="4dip"
+ android:paddingRight="4dip" />
</com.android.internal.view.menu.ActionMenuItemView>
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index 6ec8017..0928ce0 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -46,8 +46,6 @@
<dimen name="fastscroll_thumb_height">52dp</dimen>
<!-- Min width for a tablet device -->
<dimen name="min_xlarge_screen_width">800dp</dimen>
- <!-- Fixed viewport margin for website content width change -->
- <dimen name="fixed_viewport_margin">7dp</dimen>
<!-- Default height of a key in the password keyboard for alpha -->
<dimen name="password_keyboard_key_height_alpha">56dip</dimen>
<!-- Default height of a key in the password keyboard for numeric -->
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index 0031a01a..b772809 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -1380,6 +1380,7 @@
</style>
<style name="Widget.Holo.Spinner" parent="Widget.Spinner.DropDown">
+ <item name="android:background">@android:drawable/spinner_background_holo_dark</item>
<item name="android:dropDownSelector">@android:drawable/list_selector_holo_dark</item>
<item name="android:popupBackground">@android:drawable/menu_dropdown_panel_holo_dark</item>
<item name="android:dropDownVerticalOffset">0dip</item>
@@ -1391,6 +1392,10 @@
<style name="Widget.Holo.Spinner.DropDown">
</style>
+ <style name="Widget.Holo.Spinner.DropDown.ActionBar">
+ <item name="android:background">@android:drawable/spinner_cab_background_holo_dark</item>
+ </style>
+
<style name="Widget.Holo.CompoundButton.Star" parent="Widget.CompoundButton.Star">
</style>
@@ -1454,10 +1459,10 @@
</style>
<style name="Widget.Holo.ActionButton" parent="Widget.ActionButton">
- <item name="android:paddingLeft">16dip</item>
- <item name="android:paddingRight">16dip</item>
- <item name="android:minWidth">64dip</item>
+ <item name="android:paddingLeft">4dip</item>
+ <item name="android:paddingRight">4dip</item>
<item name="android:minHeight">56dip</item>
+ <item name="android:scaleType">center</item>
</style>
<style name="Widget.Holo.ActionButton.Overflow">
@@ -1631,7 +1636,8 @@
<style name="Widget.Holo.Light.HorizontalScrollView" parent="Widget.HorizontalScrollView">
</style>
- <style name="Widget.Holo.Light.Spinner" parent="Widget.Spinner.DropDown">
+ <style name="Widget.Holo.Light.Spinner" parent="Widget.Holo.Spinner">
+ <item name="android:background">@android:drawable/spinner_background_holo_light</item>
<item name="android:dropDownSelector">@android:drawable/list_selector_holo_light</item>
<item name="android:popupBackground">@android:drawable/menu_dropdown_panel_holo_light</item>
<item name="android:dropDownVerticalOffset">0dip</item>
@@ -1643,6 +1649,10 @@
<style name="Widget.Holo.Light.Spinner.DropDown">
</style>
+ <style name="Widget.Holo.Light.Spinner.DropDown.ActionBar">
+ <item name="android:background">@android:drawable/spinner_cab_background_holo_light</item>
+ </style>
+
<style name="Widget.Holo.Light.CompoundButton.Star" parent="Widget.CompoundButton.Star">
</style>
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index e30adf3..9dbb1de 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -835,7 +835,7 @@
<item name="searchWidgetCorpusItemBackground">@android:color/search_widget_corpus_item_background</item>
<!-- Action bar styles -->
- <item name="actionDropDownStyle">@android:style/Widget.Holo.Spinner.DropDown</item>
+ <item name="actionDropDownStyle">@android:style/Widget.Holo.Spinner.DropDown.ActionBar</item>
<item name="actionButtonStyle">@android:style/Widget.Holo.ActionButton</item>
<item name="actionOverflowButtonStyle">@android:style/Widget.Holo.ActionButton.Overflow</item>
<item name="actionModeBackground">@android:drawable/cab_holo_dark</item>
@@ -1064,17 +1064,17 @@
<item name="searchWidgetCorpusItemBackground">@android:color/search_widget_corpus_item_background</item>
<!-- Action bar styles -->
- <item name="actionDropDownStyle">@android:style/Widget.Holo.Spinner.DropDown</item>
- <item name="actionButtonStyle">@android:style/Widget.Holo.ActionButton</item>
- <item name="actionOverflowButtonStyle">@android:style/Widget.Holo.ActionButton.Overflow</item>
+ <item name="actionDropDownStyle">@android:style/Widget.Holo.Light.Spinner.DropDown.ActionBar</item>
+ <item name="actionButtonStyle">@android:style/Widget.Holo.Light.ActionButton</item>
+ <item name="actionOverflowButtonStyle">@android:style/Widget.Holo.Light.ActionButton.Overflow</item>
<item name="actionModeBackground">@android:drawable/cab_holo_light</item>
<item name="actionModeCloseDrawable">@android:drawable/cab_ic_close_holo</item>
- <item name="actionBarTabStyle">@style/Widget.Holo.ActionBarView_TabView</item>
- <item name="actionBarTabBarStyle">@style/Widget.Holo.ActionBarView_TabBar</item>
- <item name="actionBarTabTextStyle">@style/Widget.Holo.ActionBarView_TabText</item>
+ <item name="actionBarTabStyle">@style/Widget.Holo.Light.ActionBarView_TabView</item>
+ <item name="actionBarTabBarStyle">@style/Widget.Holo.Light.ActionBarView_TabBar</item>
+ <item name="actionBarTabTextStyle">@style/Widget.Holo.Light.ActionBarView_TabText</item>
<item name="actionModeStyle">@style/Widget.Holo.Light.ActionMode</item>
- <item name="actionModeCloseButtonStyle">@style/Widget.Holo.ActionButton.CloseMode</item>
- <item name="actionBarStyle">@android:style/Widget.Holo.ActionBar</item>
+ <item name="actionModeCloseButtonStyle">@style/Widget.Holo.Light.ActionButton.CloseMode</item>
+ <item name="actionBarStyle">@android:style/Widget.Holo.Light.ActionBar</item>
<item name="actionBarSize">56dip</item>
<item name="dividerVertical">@drawable/divider_vertical_holo_light</item>
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 2876010..81fa1ea 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -388,7 +388,8 @@
snapshot->invisible = true;
} else {
// TODO: Should take the mode into account
- snapshot->invisible = snapshot->previous->invisible || alpha <= ALPHA_THRESHOLD;
+ snapshot->invisible = snapshot->previous->invisible ||
+ (alpha <= ALPHA_THRESHOLD && fboLayer);
}
// Bail out if we won't draw in this snapshot
@@ -551,7 +552,7 @@
Rect* bounds = mLayers.itemAt(i);
// Clear the framebuffer where the layer will draw
- glScissor(bounds->left, mHeight - bounds->bottom,
+ glScissor(bounds->left, mSnapshot->height - bounds->bottom,
bounds->getWidth(), bounds->getHeight());
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT);
@@ -620,7 +621,12 @@
Rect r(left, top, right, bottom);
mSnapshot->transform->mapRect(r);
- return !mSnapshot->clipRect->intersects(r);
+ r.snapToPixelBoundaries();
+
+ Rect clipRect(*mSnapshot->clipRect);
+ clipRect.snapToPixelBoundaries();
+
+ return !clipRect.intersects(r);
}
bool OpenGLRenderer::clipRect(float left, float top, float right, float bottom, SkRegion::Op op) {
diff --git a/libs/hwui/Snapshot.h b/libs/hwui/Snapshot.h
index 35cdf6f..2da1950 100644
--- a/libs/hwui/Snapshot.h
+++ b/libs/hwui/Snapshot.h
@@ -152,7 +152,6 @@
}
if (clipped) {
- clipRect->snapToPixelBoundaries();
flags |= Snapshot::kFlagClipSet | Snapshot::kFlagDirtyLocalClip;
}
diff --git a/policy/src/com/android/internal/policy/impl/StatusView.java b/policy/src/com/android/internal/policy/impl/StatusView.java
index 3f08cfd..2b78851 100644
--- a/policy/src/com/android/internal/policy/impl/StatusView.java
+++ b/policy/src/com/android/internal/policy/impl/StatusView.java
@@ -4,11 +4,14 @@
import com.android.internal.R;
import com.android.internal.widget.LockPatternUtils;
+import com.google.android.util.AbstractMessageParser.Resources;
import java.util.Date;
+import android.content.ContentResolver;
import android.content.Context;
import android.graphics.drawable.Drawable;
+import android.provider.Settings;
import android.text.TextUtils;
import android.text.format.DateFormat;
import android.util.Log;
@@ -138,11 +141,14 @@
/** Originated from PatternUnlockScreen **/
void updateStatusLines() {
if (mHasProperty) {
- // TODO Get actual name & email
- String name = "John Smith";
- String email = "jsmith@gmail.com";
- mPropertyOf.setText("Property of:\n" + name + "\n" + email);
- mPropertyOf.setVisibility(View.VISIBLE);
+ ContentResolver res = getContext().getContentResolver();
+ String info = Settings.Secure.getString(res, Settings.Secure.LOCK_SCREEN_OWNER_INFO);
+ boolean enabled = Settings.Secure.getInt(res,
+ Settings.Secure.LOCK_SCREEN_OWNER_INFO_ENABLED, 1) != 0;
+
+ mPropertyOf.setText(info);
+ mPropertyOf.setVisibility(enabled && !TextUtils.isEmpty(info) ?
+ View.VISIBLE : View.INVISIBLE);
}
if (!mHasStatus2) return;
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index 6c23e376..def36de 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -555,6 +555,12 @@
}
}
+ int getDragLayerLw() {
+ return mPolicy.windowTypeToLayerLw(WindowManager.LayoutParams.TYPE_DRAG)
+ * TYPE_LAYER_MULTIPLIER
+ + TYPE_LAYER_OFFSET;
+ }
+
/* call out to each visible window/session informing it about the drag
*/
void broadcastDragStartedLw(final float touchX, final float touchY) {
@@ -5533,7 +5539,7 @@
return null;
}
- private void addDragInputWindow(InputWindowList windowList) {
+ private void addDragInputWindowLw(InputWindowList windowList) {
final InputWindow inputWindow = windowList.add();
inputWindow.inputChannel = mDragState.mServerChannel;
inputWindow.name = "drag";
@@ -5545,9 +5551,7 @@
inputWindow.hasFocus = true;
inputWindow.hasWallpaper = false;
inputWindow.paused = false;
- inputWindow.layer = mPolicy.windowTypeToLayerLw(inputWindow.layoutParamsType)
- * TYPE_LAYER_MULTIPLIER
- + TYPE_LAYER_OFFSET;
+ inputWindow.layer = mDragState.getDragLayerLw();
inputWindow.ownerPid = Process.myPid();
inputWindow.ownerUid = Process.myUid();
@@ -5583,7 +5587,7 @@
if (DEBUG_DRAG) {
Log.d(TAG, "Inserting drag window");
}
- addDragInputWindow(mTempInputWindows);
+ addDragInputWindowLw(mTempInputWindows);
}
final int N = windows.size();
@@ -6231,6 +6235,7 @@
surface.setPosition((int)(touchX - thumbCenterX),
(int)(touchY - thumbCenterY));
surface.setAlpha(.5f);
+ surface.setLayer(mDragState.getDragLayerLw());
surface.show();
} finally {
surface.closeTransaction();
diff --git a/voip/java/com/android/server/sip/SipSessionGroup.java b/voip/java/com/android/server/sip/SipSessionGroup.java
index 57b3710..b5f8d39 100644
--- a/voip/java/com/android/server/sip/SipSessionGroup.java
+++ b/voip/java/com/android/server/sip/SipSessionGroup.java
@@ -153,7 +153,13 @@
}
synchronized void onConnectivityChanged() {
- for (SipSessionImpl s : mSessionMap.values()) {
+ SipSessionImpl[] ss = mSessionMap.values().toArray(
+ new SipSessionImpl[mSessionMap.size()]);
+ // Iterate on the copied array instead of directly on mSessionMap to
+ // avoid ConcurrentModificationException being thrown when
+ // SipSessionImpl removes itself from mSessionMap in onError() in the
+ // following loop.
+ for (SipSessionImpl s : ss) {
s.onError(SipErrorCode.DATA_CONNECTION_LOST,
"data connection lost");
}