blob: ca710cd470226aa6735fbc0be0e08ed424212394 [file] [log] [blame]
Adam Lesinski282e1812014-01-23 18:17:42 -08001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.animation;
18
19import com.android.layoutlib.bridge.impl.DelegateManager;
20import com.android.tools.layoutlib.annotations.LayoutlibDelegate;
21
22/**
23 * Delegate implementing the native methods of android.animation.PropertyValuesHolder
24 *
25 * Through the layoutlib_create tool, the original native methods of PropertyValuesHolder have been
26 * replaced by calls to methods of the same name in this delegate class.
27 *
28 * Because it's a stateless class to start with, there's no need to keep a {@link DelegateManager}
29 * around to map int to instance of the delegate.
30 *
31 * The main goal of this class' methods are to provide a native way to access setters and getters
32 * on some object. In this case we want to default to using Java reflection instead so the native
33 * methods do nothing.
34 *
35 */
36/*package*/ class PropertyValuesHolder_Delegate {
37
38 @LayoutlibDelegate
Ashok Bhatfbb35fb2014-01-17 16:44:27 +000039 /*package*/ static long nGetIntMethod(Class<?> targetClass, String methodName) {
Adam Lesinski282e1812014-01-23 18:17:42 -080040 // return 0 to force PropertyValuesHolder to use Java reflection.
41 return 0;
42 }
43
44 @LayoutlibDelegate
Ashok Bhatfbb35fb2014-01-17 16:44:27 +000045 /*package*/ static long nGetFloatMethod(Class<?> targetClass, String methodName) {
Adam Lesinski282e1812014-01-23 18:17:42 -080046 // return 0 to force PropertyValuesHolder to use Java reflection.
47 return 0;
48 }
49
50 @LayoutlibDelegate
Deepanshu Guptae05bb952014-01-28 18:55:33 -080051 /*package*/ static int nGetMultipleIntMethod(Class<?> targetClass, String methodName,
52 int numParams) {
53 // TODO: return the right thing.
54 return 0;
55 }
56
57 @LayoutlibDelegate
58 /*package*/ static int nGetMultipleFloatMethod(Class<?> targetClass, String methodName,
59 int numParams) {
60 // TODO: return the right thing.
61 return 0;
62 }
63
64 @LayoutlibDelegate
Ashok Bhatfbb35fb2014-01-17 16:44:27 +000065 /*package*/ static void nCallIntMethod(Object target, long methodID, int arg) {
Adam Lesinski282e1812014-01-23 18:17:42 -080066 // do nothing
67 }
68
69 @LayoutlibDelegate
Ashok Bhatfbb35fb2014-01-17 16:44:27 +000070 /*package*/ static void nCallFloatMethod(Object target, long methodID, float arg) {
Adam Lesinski282e1812014-01-23 18:17:42 -080071 // do nothing
72 }
Deepanshu Guptae05bb952014-01-28 18:55:33 -080073
74 @LayoutlibDelegate
75 /*package*/ static void nCallTwoIntMethod(Object target, long methodID, int arg1,
76 int arg2) {
77 // do nothing
78 }
79
80 @LayoutlibDelegate
81 /*package*/ static void nCallFourIntMethod(Object target, long methodID, int arg1,
82 int arg2, int arg3, int arg4) {
83 // do nothing
84 }
85
86 @LayoutlibDelegate
87 /*package*/ static void nCallMultipleIntMethod(Object target, long methodID,
88 int[] args) {
89 // do nothing
90 }
91
92 @LayoutlibDelegate
93 /*package*/ static void nCallTwoFloatMethod(Object target, long methodID, float arg1,
94 float arg2) {
95 // do nothing
96 }
97
98 @LayoutlibDelegate
99 /*package*/ static void nCallFourFloatMethod(Object target, long methodID, float arg1,
100 float arg2, float arg3, float arg4) {
101 // do nothing
102 }
103
104 @LayoutlibDelegate
105 /*package*/ static void nCallMultipleFloatMethod(Object target, long methodID,
106 float[] args) {
107 // do nothing
108 }
Adam Lesinski282e1812014-01-23 18:17:42 -0800109}