public class ReflectResource
extends java.lang.Object
限定符和类型 | 类和说明 |
---|---|
static class |
ReflectResource.ResourcesType |
构造器和说明 |
---|
ReflectResource() |
ReflectResource(Context context) |
限定符和类型 | 方法和说明 |
---|---|
static ReflectResource |
getInstance() |
static int |
getLayoutId(Context paramContext,
java.lang.String paramString) |
Animation |
getResAnim(Context context,
java.lang.String animationName,
ReflectResource.ResourcesType type)
获取动画anim
|
XmlPullParser |
getResAnimXml(java.lang.String animationName,
ReflectResource.ResourcesType type)
获取anim文件 XmlPullParser
|
int |
getResColor(java.lang.String colorName,
ReflectResource.ResourcesType type)
获取color 值
|
ColorStateList |
getResColorStateList(java.lang.String colorName,
ReflectResource.ResourcesType type) |
float |
getResDimens(java.lang.String dimenName,
ReflectResource.ResourcesType type)
获取dimens文件中值
|
Drawable |
getResDrawable(java.lang.String imgName,
ReflectResource.ResourcesType type)
获取图片资源
|
View |
getResLayoutView(Context context,
java.lang.String layoutName,
ReflectResource.ResourcesType type)
获取布局layout文件
|
int |
getResourceId(java.lang.String name,
ReflectResource.ResourcesType resType)
获取资源文件中的id号
|
java.lang.String |
getResString(java.lang.String stringName,
ReflectResource.ResourcesType type)
获取String字符串
|
int |
getResStyle(java.lang.String styleName,
ReflectResource.ResourcesType type) |
View |
getResWidgetView(View layout,
java.lang.String widgetName,
ReflectResource.ResourcesType type)
获取布局文件中的控件
|
public ReflectResource()
public ReflectResource(Context context)
public static ReflectResource getInstance()
public int getResourceId(java.lang.String name, ReflectResource.ResourcesType resType)
name
- resType
- 资源名 资源类型public View getResLayoutView(Context context, java.lang.String layoutName, ReflectResource.ResourcesType type)
context
- 上下文public static int getLayoutId(Context paramContext, java.lang.String paramString)
public View getResWidgetView(View layout, java.lang.String widgetName, ReflectResource.ResourcesType type)
public Drawable getResDrawable(java.lang.String imgName, ReflectResource.ResourcesType type)
imgName
- public java.lang.String getResString(java.lang.String stringName, ReflectResource.ResourcesType type)
stringName
- public XmlPullParser getResAnimXml(java.lang.String animationName, ReflectResource.ResourcesType type)
animationName
- public Animation getResAnim(Context context, java.lang.String animationName, ReflectResource.ResourcesType type)
animation
- public int getResColor(java.lang.String colorName, ReflectResource.ResourcesType type)
colorName
- public ColorStateList getResColorStateList(java.lang.String colorName, ReflectResource.ResourcesType type)
public float getResDimens(java.lang.String dimenName, ReflectResource.ResourcesType type)
dimenName
- public int getResStyle(java.lang.String styleName, ReflectResource.ResourcesType type)