use of android.util.Property in project android_frameworks_base by ResurrectionRemix.
the class AnimatedVectorDrawable method updateAnimatorProperty.
private static void updateAnimatorProperty(Animator animator, String targetName, VectorDrawable vectorDrawable, boolean ignoreInvalidAnim) {
if (animator instanceof ObjectAnimator) {
// Change the property of the Animator from using reflection based on the property
// name to a Property object that wraps the setter and getter for modifying that
// specific property for a given object. By replacing the reflection with a direct call,
// we can largely reduce the time it takes for a animator to modify a VD property.
PropertyValuesHolder[] holders = ((ObjectAnimator) animator).getValues();
for (int i = 0; i < holders.length; i++) {
PropertyValuesHolder pvh = holders[i];
String propertyName = pvh.getPropertyName();
Object targetNameObj = vectorDrawable.getTargetByName(targetName);
Property property = null;
if (targetNameObj instanceof VectorDrawable.VObject) {
property = ((VectorDrawable.VObject) targetNameObj).getProperty(propertyName);
} else if (targetNameObj instanceof VectorDrawable.VectorDrawableState) {
property = ((VectorDrawable.VectorDrawableState) targetNameObj).getProperty(propertyName);
}
if (property != null) {
if (containsSameValueType(pvh, property)) {
pvh.setProperty(property);
} else if (!ignoreInvalidAnim) {
throw new RuntimeException("Wrong valueType for Property: " + propertyName + ". Expected type: " + property.getType().toString() + ". Actual " + "type defined in resources: " + pvh.getValueType().toString());
}
}
}
} else if (animator instanceof AnimatorSet) {
for (Animator anim : ((AnimatorSet) animator).getChildAnimations()) {
updateAnimatorProperty(anim, targetName, vectorDrawable, ignoreInvalidAnim);
}
}
}
use of android.util.Property in project android_frameworks_base by DirtyUnicorns.
the class AnimatedVectorDrawable method updateAnimatorProperty.
private static void updateAnimatorProperty(Animator animator, String targetName, VectorDrawable vectorDrawable, boolean ignoreInvalidAnim) {
if (animator instanceof ObjectAnimator) {
// Change the property of the Animator from using reflection based on the property
// name to a Property object that wraps the setter and getter for modifying that
// specific property for a given object. By replacing the reflection with a direct call,
// we can largely reduce the time it takes for a animator to modify a VD property.
PropertyValuesHolder[] holders = ((ObjectAnimator) animator).getValues();
for (int i = 0; i < holders.length; i++) {
PropertyValuesHolder pvh = holders[i];
String propertyName = pvh.getPropertyName();
Object targetNameObj = vectorDrawable.getTargetByName(targetName);
Property property = null;
if (targetNameObj instanceof VectorDrawable.VObject) {
property = ((VectorDrawable.VObject) targetNameObj).getProperty(propertyName);
} else if (targetNameObj instanceof VectorDrawable.VectorDrawableState) {
property = ((VectorDrawable.VectorDrawableState) targetNameObj).getProperty(propertyName);
}
if (property != null) {
if (containsSameValueType(pvh, property)) {
pvh.setProperty(property);
} else if (!ignoreInvalidAnim) {
throw new RuntimeException("Wrong valueType for Property: " + propertyName + ". Expected type: " + property.getType().toString() + ". Actual " + "type defined in resources: " + pvh.getValueType().toString());
}
}
}
} else if (animator instanceof AnimatorSet) {
for (Animator anim : ((AnimatorSet) animator).getChildAnimations()) {
updateAnimatorProperty(anim, targetName, vectorDrawable, ignoreInvalidAnim);
}
}
}
use of android.util.Property in project android_frameworks_base by AOSPA.
the class AnimatedVectorDrawable method updateAnimatorProperty.
private static void updateAnimatorProperty(Animator animator, String targetName, VectorDrawable vectorDrawable, boolean ignoreInvalidAnim) {
if (animator instanceof ObjectAnimator) {
// Change the property of the Animator from using reflection based on the property
// name to a Property object that wraps the setter and getter for modifying that
// specific property for a given object. By replacing the reflection with a direct call,
// we can largely reduce the time it takes for a animator to modify a VD property.
PropertyValuesHolder[] holders = ((ObjectAnimator) animator).getValues();
for (int i = 0; i < holders.length; i++) {
PropertyValuesHolder pvh = holders[i];
String propertyName = pvh.getPropertyName();
Object targetNameObj = vectorDrawable.getTargetByName(targetName);
Property property = null;
if (targetNameObj instanceof VectorDrawable.VObject) {
property = ((VectorDrawable.VObject) targetNameObj).getProperty(propertyName);
} else if (targetNameObj instanceof VectorDrawable.VectorDrawableState) {
property = ((VectorDrawable.VectorDrawableState) targetNameObj).getProperty(propertyName);
}
if (property != null) {
if (containsSameValueType(pvh, property)) {
pvh.setProperty(property);
} else if (!ignoreInvalidAnim) {
throw new RuntimeException("Wrong valueType for Property: " + propertyName + ". Expected type: " + property.getType().toString() + ". Actual " + "type defined in resources: " + pvh.getValueType().toString());
}
}
}
} else if (animator instanceof AnimatorSet) {
for (Animator anim : ((AnimatorSet) animator).getChildAnimations()) {
updateAnimatorProperty(anim, targetName, vectorDrawable, ignoreInvalidAnim);
}
}
}
use of android.util.Property in project platform_frameworks_base by android.
the class AnimatedVectorDrawable method updateAnimatorProperty.
private static void updateAnimatorProperty(Animator animator, String targetName, VectorDrawable vectorDrawable, boolean ignoreInvalidAnim) {
if (animator instanceof ObjectAnimator) {
// Change the property of the Animator from using reflection based on the property
// name to a Property object that wraps the setter and getter for modifying that
// specific property for a given object. By replacing the reflection with a direct call,
// we can largely reduce the time it takes for a animator to modify a VD property.
PropertyValuesHolder[] holders = ((ObjectAnimator) animator).getValues();
for (int i = 0; i < holders.length; i++) {
PropertyValuesHolder pvh = holders[i];
String propertyName = pvh.getPropertyName();
Object targetNameObj = vectorDrawable.getTargetByName(targetName);
Property property = null;
if (targetNameObj instanceof VectorDrawable.VObject) {
property = ((VectorDrawable.VObject) targetNameObj).getProperty(propertyName);
} else if (targetNameObj instanceof VectorDrawable.VectorDrawableState) {
property = ((VectorDrawable.VectorDrawableState) targetNameObj).getProperty(propertyName);
}
if (property != null) {
if (containsSameValueType(pvh, property)) {
pvh.setProperty(property);
} else if (!ignoreInvalidAnim) {
throw new RuntimeException("Wrong valueType for Property: " + propertyName + ". Expected type: " + property.getType().toString() + ". Actual " + "type defined in resources: " + pvh.getValueType().toString());
}
}
}
} else if (animator instanceof AnimatorSet) {
for (Animator anim : ((AnimatorSet) animator).getChildAnimations()) {
updateAnimatorProperty(anim, targetName, vectorDrawable, ignoreInvalidAnim);
}
}
}
use of android.util.Property in project android_frameworks_base by crdroidandroid.
the class AnimatedVectorDrawable method updateAnimatorProperty.
private static void updateAnimatorProperty(Animator animator, String targetName, VectorDrawable vectorDrawable, boolean ignoreInvalidAnim) {
if (animator instanceof ObjectAnimator) {
// Change the property of the Animator from using reflection based on the property
// name to a Property object that wraps the setter and getter for modifying that
// specific property for a given object. By replacing the reflection with a direct call,
// we can largely reduce the time it takes for a animator to modify a VD property.
PropertyValuesHolder[] holders = ((ObjectAnimator) animator).getValues();
for (int i = 0; i < holders.length; i++) {
PropertyValuesHolder pvh = holders[i];
String propertyName = pvh.getPropertyName();
Object targetNameObj = vectorDrawable.getTargetByName(targetName);
Property property = null;
if (targetNameObj instanceof VectorDrawable.VObject) {
property = ((VectorDrawable.VObject) targetNameObj).getProperty(propertyName);
} else if (targetNameObj instanceof VectorDrawable.VectorDrawableState) {
property = ((VectorDrawable.VectorDrawableState) targetNameObj).getProperty(propertyName);
}
if (property != null) {
if (containsSameValueType(pvh, property)) {
pvh.setProperty(property);
} else if (!ignoreInvalidAnim) {
throw new RuntimeException("Wrong valueType for Property: " + propertyName + ". Expected type: " + property.getType().toString() + ". Actual " + "type defined in resources: " + pvh.getValueType().toString());
}
}
}
} else if (animator instanceof AnimatorSet) {
for (Animator anim : ((AnimatorSet) animator).getChildAnimations()) {
updateAnimatorProperty(anim, targetName, vectorDrawable, ignoreInvalidAnim);
}
}
}
Aggregations