• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2008 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 
17 package com.android.tools.layoutlib.create;
18 
19 public class CreateInfo {
20     /**
21      * The list of class from layoutlib_create to inject in layoutlib.
22      */
23     public final static Class<?>[] INJECTED_CLASSES = new Class<?>[] {
24             OverrideMethod.class,
25             MethodListener.class,
26             MethodAdapter.class,
27             CreateInfo.class
28         };
29 
30     /**
31      * The list of methods to stub out. Each entry must be in the form
32      *  "package.package.OuterClass$InnerClass#MethodName".
33      */
34     public final static String[] OVERRIDDEN_METHODS = new String[] {
35             "android.view.View#isInEditMode",
36             "android.content.res.Resources$Theme#obtainStyledAttributes",
37         };
38 
39     /**
40      *  The list of classes to rename, must be an even list: the binary FQCN
41      *  of class to replace followed by the new FQCN.
42      */
43     public final static String[] RENAMED_CLASSES =
44         new String[] {
45             "android.graphics.Bitmap",              "android.graphics._Original_Bitmap",
46             "android.graphics.BitmapShader",        "android.graphics._Original_BitmapShader",
47             "android.graphics.Canvas",              "android.graphics._Original_Canvas",
48             "android.graphics.ComposeShader",       "android.graphics._Original_ComposeShader",
49             "android.graphics.LinearGradient",      "android.graphics._Original_LinearGradient",
50             "android.graphics.Matrix",              "android.graphics._Original_Matrix",
51             "android.graphics.Paint",               "android.graphics._Original_Paint",
52             "android.graphics.Path",                "android.graphics._Original_Path",
53             "android.graphics.PorterDuffXfermode",  "android.graphics._Original_PorterDuffXfermode",
54             "android.graphics.RadialGradient",      "android.graphics._Original_RadialGradient",
55             "android.graphics.Shader",              "android.graphics._Original_Shader",
56             "android.graphics.SweepGradient",       "android.graphics._Original_SweepGradient",
57             "android.graphics.Typeface",            "android.graphics._Original_Typeface",
58             "android.os.ServiceManager",            "android.os._Original_ServiceManager",
59             "android.util.FloatMath",               "android.util._Original_FloatMath",
60             "android.view.SurfaceView",             "android.view._Original_SurfaceView",
61             "android.view.accessibility.AccessibilityManager", "android.view.accessibility._Original_AccessibilityManager",
62         };
63 
64     /**
65      * List of classes for which the methods returning them should be deleted.
66      * The array contains a list of null terminated section starting with the name of the class
67      * to rename in which the methods are deleted, followed by a list of return types identifying
68      * the methods to delete.
69      */
70     public final static String[] REMOVED_METHODS =
71         new String[] {
72             "android.graphics.Paint",       // class to delete methods from
73             "android.graphics.Paint$Align", // list of type identifying methods to delete
74             "android.graphics.Paint$Style",
75             "android.graphics.Paint$Join",
76             "android.graphics.Paint$Cap",
77             "android.graphics.Paint$FontMetrics",
78             "android.graphics.Paint$FontMetricsInt",
79             null };                         // separator, for next class/methods list.
80 }
81 
82