|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
Nested Class Summary | |
---|---|
static class |
IProjectCallback.ViewAttribute
|
Method Summary | |
---|---|
AdapterBinding |
getAdapterBinding(ResourceReference adapterViewRef,
java.lang.Object adapterCookie,
java.lang.Object viewObject)
Returns an adapter binding for a given adapter view. |
java.lang.Object |
getAdapterItemValue(ResourceReference adapterView,
java.lang.Object adapterCookie,
ResourceReference itemRef,
int fullPosition,
int positionPerType,
int fullParentPosition,
int parentPositionPerType,
ResourceReference viewRef,
IProjectCallback.ViewAttribute viewAttribute,
java.lang.Object defaultValue)
Returns the value of an item used by an adapter. |
java.lang.String |
getNamespace()
Returns the namespace of the application. |
ILayoutPullParser |
getParser(ResourceValue layoutResource)
Returns a custom parser for a given layout. |
ILayoutPullParser |
getParser(java.lang.String layoutName)
Deprecated. This is replaced by getParser(ResourceValue) but older version
of the layoutlib (before API7) will still call this method. |
java.lang.Integer |
getResourceId(ResourceType type,
java.lang.String name)
Returns the id of a resource. |
java.lang.Object |
loadView(java.lang.String name,
java.lang.Class[] constructorSignature,
java.lang.Object[] constructorArgs)
Loads a custom view with the given constructor signature and arguments. |
Pair<ResourceType,java.lang.String> |
resolveResourceId(int id)
Resolves the id of a resource Id. |
java.lang.String |
resolveResourceId(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. |
Method Detail |
---|
java.lang.Object loadView(java.lang.String name, java.lang.Class[] constructorSignature, java.lang.Object[] constructorArgs) throws java.lang.ClassNotFoundException, java.lang.Exception
name
- The fully qualified name of the class.constructorSignature
- The signature of the class to useconstructorArgs
- The arguments to use on the constructor
java.lang.ClassNotFoundException
java.lang.Exception
java.lang.String getNamespace()
Pair<ResourceType,java.lang.String> resolveResourceId(int id)
R.<type>.<name>
, and
this method will return both the type and name of the resource.
id
- the Id to resolve.
ResourceType
and resource name, or null if the id
does not match any resource.java.lang.String resolveResourceId(int[] id)
id
- the Id to resolve.
null
if not found.java.lang.Integer getResourceId(ResourceType type, java.lang.String name)
R.<type>.<name>
.
type
- the type of the resourcename
- the name of the resource
null
if not found.@Deprecated ILayoutPullParser getParser(java.lang.String layoutName)
getParser(ResourceValue)
but older version
of the layoutlib (before API7) will still call this method.
layoutName
- the name of the layout.
ILayoutPullParser getParser(ResourceValue layoutResource)
layoutResource
- The layout.
java.lang.Object getAdapterItemValue(ResourceReference adapterView, java.lang.Object adapterCookie, ResourceReference itemRef, int fullPosition, int positionPerType, int fullParentPosition, int parentPositionPerType, ResourceReference viewRef, IProjectCallback.ViewAttribute viewAttribute, java.lang.Object defaultValue)
adapterView
- The ResourceReference
for the adapter view info.adapterCookie
- the view cookie for this particular view.itemRef
- the ResourceReference
for the layout used by the adapter item.fullPosition
- the position of the item in the full list.positionPerType
- the position of the item if only items of the same type are
considered. If there is only one type of items, this is the same as
fullPosition.fullParentPosition
- the full position of the item's parent. This is only
valid if the adapter view is an ExpandableListView.parentPositionPerType
- the position of the parent's item, only considering items
of the same type. This is only valid if the adapter view is an ExpandableListView.
If there is only one type of items, this is the same as fullParentPosition.viewRef
- The ResourceReference
for the view we're trying to fill.viewAttribute
- the attribute being queried.defaultValue
- the default value for this attribute. The object class matches the
class associated with the IProjectCallback.ViewAttribute
.
IProjectCallback.ViewAttribute.getAttributeClass()
AdapterBinding getAdapterBinding(ResourceReference adapterViewRef, java.lang.Object adapterCookie, java.lang.Object viewObject)
SessionParams
does not have an AdapterBinding
for
the given ResourceReference
already.
adapterViewRef
- the reference of adapter view to return the adapter binding for.adapterCookie
- the view cookie for this particular view.viewObject
- the view object for the adapter.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |