FileDocCategorySizeDatePackage
IProjectCallback.javaAPI DocAndroid 1.5 API2935Wed May 06 22:42:02 BST 2009com.android.layoutlib.api

IProjectCallback

public interface IProjectCallback
Callback for project information needed by the Layout Library. Classes implementing this interface provide methods giving access to some project data, like resource resolution, namespace information, and instantiation of custom view.

Fields Summary
Constructors Summary
Methods Summary
public java.lang.StringgetNamespace()
Returns the namespace of the application.

This lets the Layout Lib load custom attributes for custom views.

public java.lang.IntegergetResourceValue(java.lang.String type, java.lang.String name)
Returns the id of a resource.

The provided type and name must match an existing constant defined as R.<type>.<name>.

param
type the type of the resource
param
name the name of the resource
return
an Integer containing the resource Id, or null if not found.

public java.lang.ObjectloadView(java.lang.String name, java.lang.Class[] constructorSignature, java.lang.Object[] constructorArgs)
Loads a custom view with the given constructor signature and arguments.

param
name The fully qualified name of the class.
param
constructorSignature The signature of the class to use
param
constructorArgs The arguments to use on the constructor
return
A newly instantiated android.view.View object.
throws
ClassNotFoundException.
throws
Exception

public java.lang.String[]resolveResourceValue(int id)
Resolves the id of a resource Id.

The resource id is the value of a R.<type>.<name>, and this method will return both the type and name of the resource.

param
id the Id to resolve.
return
an array of 2 strings containing the resource name and type, or null if the id does not match any resource.

public java.lang.StringresolveResourceValue(int[] id)
Resolves the id of a resource Id of type int[]

The resource id is the value of a R.styleable.<name>, and this method will return the name of the resource.

param
id the Id to resolve.
return
the name of the resource or null if not found.