static class IntPropertyValuesHolder extends PropertyValuesHolder {
// Cache JNI functions to avoid looking them up twice
- private static final HashMap<Class, HashMap<String, Integer>> sJNISetterPropertyMap =
- new HashMap<Class, HashMap<String, Integer>>();
- int mJniSetter;
+ private static final HashMap<Class, HashMap<String, Long>> sJNISetterPropertyMap =
+ new HashMap<Class, HashMap<String, Long>>();
+ long mJniSetter;
private IntProperty mIntProperty;
IntKeyframeSet mIntKeyframeSet;
// Check new static hashmap<propName, int> for setter method
try {
mPropertyMapLock.writeLock().lock();
- HashMap<String, Integer> propertyMap = sJNISetterPropertyMap.get(targetClass);
+ HashMap<String, Long> propertyMap = sJNISetterPropertyMap.get(targetClass);
if (propertyMap != null) {
- Integer mJniSetterInteger = propertyMap.get(mPropertyName);
- if (mJniSetterInteger != null) {
- mJniSetter = mJniSetterInteger;
+ Long jniSetter = propertyMap.get(mPropertyName);
+ if (jniSetter != null) {
+ mJniSetter = jniSetter;
}
}
if (mJniSetter == 0) {
mJniSetter = nGetIntMethod(targetClass, methodName);
if (mJniSetter != 0) {
if (propertyMap == null) {
- propertyMap = new HashMap<String, Integer>();
+ propertyMap = new HashMap<String, Long>();
sJNISetterPropertyMap.put(targetClass, propertyMap);
}
propertyMap.put(mPropertyName, mJniSetter);
static class FloatPropertyValuesHolder extends PropertyValuesHolder {
// Cache JNI functions to avoid looking them up twice
- private static final HashMap<Class, HashMap<String, Integer>> sJNISetterPropertyMap =
- new HashMap<Class, HashMap<String, Integer>>();
- int mJniSetter;
+ private static final HashMap<Class, HashMap<String, Long>> sJNISetterPropertyMap =
+ new HashMap<Class, HashMap<String, Long>>();
+ long mJniSetter;
private FloatProperty mFloatProperty;
FloatKeyframeSet mFloatKeyframeSet;
// Check new static hashmap<propName, int> for setter method
try {
mPropertyMapLock.writeLock().lock();
- HashMap<String, Integer> propertyMap = sJNISetterPropertyMap.get(targetClass);
+ HashMap<String, Long> propertyMap = sJNISetterPropertyMap.get(targetClass);
if (propertyMap != null) {
- Integer mJniSetterInteger = propertyMap.get(mPropertyName);
- if (mJniSetterInteger != null) {
- mJniSetter = mJniSetterInteger;
+ Long jniSetter = propertyMap.get(mPropertyName);
+ if (jniSetter != null) {
+ mJniSetter = jniSetter;
}
}
if (mJniSetter == 0) {
mJniSetter = nGetFloatMethod(targetClass, methodName);
if (mJniSetter != 0) {
if (propertyMap == null) {
- propertyMap = new HashMap<String, Integer>();
+ propertyMap = new HashMap<String, Long>();
sJNISetterPropertyMap.put(targetClass, propertyMap);
}
propertyMap.put(mPropertyName, mJniSetter);
}
static class MultiFloatValuesHolder extends PropertyValuesHolder {
- private int mJniSetter;
- private static final HashMap<Class, HashMap<String, Integer>> sJNISetterPropertyMap =
- new HashMap<Class, HashMap<String, Integer>>();
+ private long mJniSetter;
+ private static final HashMap<Class, HashMap<String, Long>> sJNISetterPropertyMap =
+ new HashMap<Class, HashMap<String, Long>>();
public MultiFloatValuesHolder(String propertyName, TypeConverter converter,
TypeEvaluator evaluator, Object... values) {
}
try {
mPropertyMapLock.writeLock().lock();
- HashMap<String, Integer> propertyMap = sJNISetterPropertyMap.get(targetClass);
+ HashMap<String, Long> propertyMap = sJNISetterPropertyMap.get(targetClass);
if (propertyMap != null) {
- Integer jniSetterInteger = propertyMap.get(mPropertyName);
- if (jniSetterInteger != null) {
- mJniSetter = jniSetterInteger;
+ Long jniSetterLong = propertyMap.get(mPropertyName);
+ if (jniSetterLong != null) {
+ mJniSetter = jniSetterLong;
}
}
if (mJniSetter == 0) {
}
if (mJniSetter != 0) {
if (propertyMap == null) {
- propertyMap = new HashMap<String, Integer>();
+ propertyMap = new HashMap<String, Long>();
sJNISetterPropertyMap.put(targetClass, propertyMap);
}
propertyMap.put(mPropertyName, mJniSetter);
}
static class MultiIntValuesHolder extends PropertyValuesHolder {
- private int mJniSetter;
- private static final HashMap<Class, HashMap<String, Integer>> sJNISetterPropertyMap =
- new HashMap<Class, HashMap<String, Integer>>();
+ private long mJniSetter;
+ private static final HashMap<Class, HashMap<String, Long>> sJNISetterPropertyMap =
+ new HashMap<Class, HashMap<String, Long>>();
public MultiIntValuesHolder(String propertyName, TypeConverter converter,
TypeEvaluator evaluator, Object... values) {
}
try {
mPropertyMapLock.writeLock().lock();
- HashMap<String, Integer> propertyMap = sJNISetterPropertyMap.get(targetClass);
+ HashMap<String, Long> propertyMap = sJNISetterPropertyMap.get(targetClass);
if (propertyMap != null) {
- Integer jniSetterInteger = propertyMap.get(mPropertyName);
- if (jniSetterInteger != null) {
- mJniSetter = jniSetterInteger;
+ Long jniSetterLong = propertyMap.get(mPropertyName);
+ if (jniSetterLong != null) {
+ mJniSetter = jniSetterLong;
}
}
if (mJniSetter == 0) {
}
if (mJniSetter != 0) {
if (propertyMap == null) {
- propertyMap = new HashMap<String, Integer>();
+ propertyMap = new HashMap<String, Long>();
sJNISetterPropertyMap.put(targetClass, propertyMap);
}
propertyMap.put(mPropertyName, mJniSetter);
}
};
- native static private int nGetIntMethod(Class targetClass, String methodName);
- native static private int nGetFloatMethod(Class targetClass, String methodName);
- native static private int nGetMultipleIntMethod(Class targetClass, String methodName,
+ native static private long nGetIntMethod(Class targetClass, String methodName);
+ native static private long nGetFloatMethod(Class targetClass, String methodName);
+ native static private long nGetMultipleIntMethod(Class targetClass, String methodName,
int numParams);
- native static private int nGetMultipleFloatMethod(Class targetClass, String methodName,
+ native static private long nGetMultipleFloatMethod(Class targetClass, String methodName,
int numParams);
- native static private void nCallIntMethod(Object target, int methodID, int arg);
- native static private void nCallFloatMethod(Object target, int methodID, float arg);
- native static private void nCallTwoIntMethod(Object target, int methodID, int arg1, int arg2);
- native static private void nCallFourIntMethod(Object target, int methodID, int arg1, int arg2,
+ native static private void nCallIntMethod(Object target, long methodID, int arg);
+ native static private void nCallFloatMethod(Object target, long methodID, float arg);
+ native static private void nCallTwoIntMethod(Object target, long methodID, int arg1, int arg2);
+ native static private void nCallFourIntMethod(Object target, long methodID, int arg1, int arg2,
int arg3, int arg4);
- native static private void nCallMultipleIntMethod(Object target, int methodID, int[] args);
- native static private void nCallTwoFloatMethod(Object target, int methodID, float arg1,
+ native static private void nCallMultipleIntMethod(Object target, long methodID, int[] args);
+ native static private void nCallTwoFloatMethod(Object target, long methodID, float arg1,
float arg2);
- native static private void nCallFourFloatMethod(Object target, int methodID, float arg1,
+ native static private void nCallFourFloatMethod(Object target, long methodID, float arg1,
float arg2, float arg3, float arg4);
- native static private void nCallMultipleFloatMethod(Object target, int methodID, float[] args);
+ native static private void nCallMultipleFloatMethod(Object target, long methodID, float[] args);
}
const char* const kClassPathName = "android/animation/PropertyValuesHolder";
-static jmethodID android_animation_PropertyValuesHolder_getIntMethod(
+static jlong android_animation_PropertyValuesHolder_getIntMethod(
JNIEnv* env, jclass pvhClass, jclass targetClass, jstring methodName)
{
const char *nativeString = env->GetStringUTFChars(methodName, 0);
jmethodID mid = env->GetMethodID(targetClass, nativeString, "(I)V");
env->ReleaseStringUTFChars(methodName, nativeString);
- return mid;
+ return reinterpret_cast<jlong>(mid);
}
-static jmethodID android_animation_PropertyValuesHolder_getFloatMethod(
+static jlong android_animation_PropertyValuesHolder_getFloatMethod(
JNIEnv* env, jclass pvhClass, jclass targetClass, jstring methodName)
{
const char *nativeString = env->GetStringUTFChars(methodName, 0);
jmethodID mid = env->GetMethodID(targetClass, nativeString, "(F)V");
env->ReleaseStringUTFChars(methodName, nativeString);
- return mid;
+ return reinterpret_cast<jlong>(mid);
}
-static jmethodID getMultiparameterMethod(JNIEnv* env, jclass targetClass, jstring methodName,
+static jlong getMultiparameterMethod(JNIEnv* env, jclass targetClass, jstring methodName,
jint parameterCount, char parameterType)
{
const char *nativeString = env->GetStringUTFChars(methodName, 0);
jmethodID mid = env->GetMethodID(targetClass, nativeString, signature);
delete[] signature;
env->ReleaseStringUTFChars(methodName, nativeString);
- return mid;
+ return reinterpret_cast<jlong>(mid);
}
-static jmethodID android_animation_PropertyValuesHolder_getMultipleFloatMethod(
+static jlong android_animation_PropertyValuesHolder_getMultipleFloatMethod(
JNIEnv* env, jclass pvhClass, jclass targetClass, jstring methodName, jint parameterCount)
{
return getMultiparameterMethod(env, targetClass, methodName, parameterCount, 'F');
}
-static jmethodID android_animation_PropertyValuesHolder_getMultipleIntMethod(
+static jlong android_animation_PropertyValuesHolder_getMultipleIntMethod(
JNIEnv* env, jclass pvhClass, jclass targetClass, jstring methodName, jint parameterCount)
{
return getMultiparameterMethod(env, targetClass, methodName, parameterCount, 'I');
}
static void android_animation_PropertyValuesHolder_callIntMethod(
- JNIEnv* env, jclass pvhObject, jobject target, jmethodID methodID, int arg)
+ JNIEnv* env, jclass pvhObject, jobject target, jlong methodID, jint arg)
{
- env->CallVoidMethod(target, methodID, arg);
+ env->CallVoidMethod(target, reinterpret_cast<jmethodID>(methodID), arg);
}
static void android_animation_PropertyValuesHolder_callFloatMethod(
- JNIEnv* env, jclass pvhObject, jobject target, jmethodID methodID, float arg)
+ JNIEnv* env, jclass pvhObject, jobject target, jlong methodID, jfloat arg)
{
- env->CallVoidMethod(target, methodID, arg);
+ env->CallVoidMethod(target, reinterpret_cast<jmethodID>(methodID), arg);
}
static void android_animation_PropertyValuesHolder_callTwoFloatMethod(
- JNIEnv* env, jclass pvhObject, jobject target, jmethodID methodID, float arg1, float arg2)
+ JNIEnv* env, jclass pvhObject, jobject target, jlong methodID, float arg1, float arg2)
{
- env->CallVoidMethod(target, methodID, arg1, arg2);
+ env->CallVoidMethod(target, reinterpret_cast<jmethodID>(methodID), arg1, arg2);
}
static void android_animation_PropertyValuesHolder_callFourFloatMethod(
- JNIEnv* env, jclass pvhObject, jobject target, jmethodID methodID, float arg1, float arg2,
+ JNIEnv* env, jclass pvhObject, jobject target, jlong methodID, float arg1, float arg2,
float arg3, float arg4)
{
- env->CallVoidMethod(target, methodID, arg1, arg2, arg3, arg4);
+ env->CallVoidMethod(target, reinterpret_cast<jmethodID>(methodID), arg1, arg2, arg3, arg4);
}
static void android_animation_PropertyValuesHolder_callMultipleFloatMethod(
- JNIEnv* env, jclass pvhObject, jobject target, jmethodID methodID, jfloatArray arg)
+ JNIEnv* env, jclass pvhObject, jobject target, jlong methodID, jfloatArray arg)
{
jsize parameterCount = env->GetArrayLength(arg);
jfloat *floatValues = env->GetFloatArrayElements(arg, NULL);
for (int i = 0; i < parameterCount; i++) {
values[i].f = floatValues[i];
}
- env->CallVoidMethodA(target, methodID, values);
+ env->CallVoidMethodA(target, reinterpret_cast<jmethodID>(methodID), values);
delete[] values;
env->ReleaseFloatArrayElements(arg, floatValues, JNI_ABORT);
}
static void android_animation_PropertyValuesHolder_callTwoIntMethod(
- JNIEnv* env, jclass pvhObject, jobject target, jmethodID methodID, int arg1, int arg2)
+ JNIEnv* env, jclass pvhObject, jobject target, jlong methodID, int arg1, int arg2)
{
- env->CallVoidMethod(target, methodID, arg1, arg2);
+ env->CallVoidMethod(target, reinterpret_cast<jmethodID>(methodID), arg1, arg2);
}
static void android_animation_PropertyValuesHolder_callFourIntMethod(
- JNIEnv* env, jclass pvhObject, jobject target, jmethodID methodID, int arg1, int arg2,
+ JNIEnv* env, jclass pvhObject, jobject target, jlong methodID, int arg1, int arg2,
int arg3, int arg4)
{
- env->CallVoidMethod(target, methodID, arg1, arg2, arg3, arg4);
+ env->CallVoidMethod(target, reinterpret_cast<jmethodID>(methodID), arg1, arg2, arg3, arg4);
}
static void android_animation_PropertyValuesHolder_callMultipleIntMethod(
- JNIEnv* env, jclass pvhObject, jobject target, jmethodID methodID, jintArray arg)
+ JNIEnv* env, jclass pvhObject, jobject target, jlong methodID, jintArray arg)
{
jsize parameterCount = env->GetArrayLength(arg);
jint *intValues = env->GetIntArrayElements(arg, NULL);
for (int i = 0; i < parameterCount; i++) {
values[i].i = intValues[i];
}
- env->CallVoidMethodA(target, methodID, values);
+ env->CallVoidMethodA(target, reinterpret_cast<jmethodID>(methodID), values);
delete[] values;
env->ReleaseIntArrayElements(arg, intValues, JNI_ABORT);
}
static JNINativeMethod gMethods[] = {
- { "nGetIntMethod", "(Ljava/lang/Class;Ljava/lang/String;)I",
+ { "nGetIntMethod", "(Ljava/lang/Class;Ljava/lang/String;)J",
(void*)android_animation_PropertyValuesHolder_getIntMethod },
- { "nGetFloatMethod", "(Ljava/lang/Class;Ljava/lang/String;)I",
+ { "nGetFloatMethod", "(Ljava/lang/Class;Ljava/lang/String;)J",
(void*)android_animation_PropertyValuesHolder_getFloatMethod },
- { "nGetMultipleFloatMethod", "(Ljava/lang/Class;Ljava/lang/String;I)I",
+ { "nGetMultipleFloatMethod", "(Ljava/lang/Class;Ljava/lang/String;I)J",
(void*)android_animation_PropertyValuesHolder_getMultipleFloatMethod },
- { "nGetMultipleIntMethod", "(Ljava/lang/Class;Ljava/lang/String;I)I",
+ { "nGetMultipleIntMethod", "(Ljava/lang/Class;Ljava/lang/String;I)J",
(void*)android_animation_PropertyValuesHolder_getMultipleIntMethod },
- { "nCallIntMethod", "(Ljava/lang/Object;II)V",
+ { "nCallIntMethod", "(Ljava/lang/Object;JI)V",
(void*)android_animation_PropertyValuesHolder_callIntMethod },
- { "nCallFloatMethod", "(Ljava/lang/Object;IF)V",
+ { "nCallFloatMethod", "(Ljava/lang/Object;JF)V",
(void*)android_animation_PropertyValuesHolder_callFloatMethod },
- { "nCallTwoFloatMethod", "(Ljava/lang/Object;IFF)V",
+ { "nCallTwoFloatMethod", "(Ljava/lang/Object;JFF)V",
(void*)android_animation_PropertyValuesHolder_callTwoFloatMethod },
- { "nCallFourFloatMethod", "(Ljava/lang/Object;IFFFF)V",
+ { "nCallFourFloatMethod", "(Ljava/lang/Object;JFFFF)V",
(void*)android_animation_PropertyValuesHolder_callFourFloatMethod },
- { "nCallMultipleFloatMethod", "(Ljava/lang/Object;I[F)V",
+ { "nCallMultipleFloatMethod", "(Ljava/lang/Object;J[F)V",
(void*)android_animation_PropertyValuesHolder_callMultipleFloatMethod },
- { "nCallTwoIntMethod", "(Ljava/lang/Object;III)V",
+ { "nCallTwoIntMethod", "(Ljava/lang/Object;JII)V",
(void*)android_animation_PropertyValuesHolder_callTwoIntMethod },
- { "nCallFourIntMethod", "(Ljava/lang/Object;IIIII)V",
+ { "nCallFourIntMethod", "(Ljava/lang/Object;JIIII)V",
(void*)android_animation_PropertyValuesHolder_callFourIntMethod },
- { "nCallMultipleIntMethod", "(Ljava/lang/Object;I[I)V",
+ { "nCallMultipleIntMethod", "(Ljava/lang/Object;J[I)V",
(void*)android_animation_PropertyValuesHolder_callMultipleIntMethod },
};