diff options
Diffstat (limited to 'layoutlib_api/src/com')
3 files changed, 38 insertions, 27 deletions
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/Bridge.java b/layoutlib_api/src/com/android/ide/common/rendering/api/Bridge.java index 48309cf..f04b266 100644 --- a/layoutlib_api/src/com/android/ide/common/rendering/api/Bridge.java +++ b/layoutlib_api/src/com/android/ide/common/rendering/api/Bridge.java @@ -17,6 +17,8 @@ package com.android.ide.common.rendering.api; +import static com.android.ide.common.rendering.api.Result.Status.NOT_IMPLEMENTED; + import com.android.ide.common.rendering.api.Result.Status; import java.awt.image.BufferedImage; @@ -109,4 +111,27 @@ public abstract class Bridge { public void clearCaches(Object projectKey) { } + + /** + * Utility method returning the parent of a given view object. + * + * @param viewObject the object for which to return the parent. + * + * @return a {@link Result} indicating the status of the action, and if success, the parent + * object in {@link Result#getData()} + */ + public Result getViewParent(Object viewObject) { + return NOT_IMPLEMENTED.createResult(); + } + + /** + * Utility method returning the index of a given view in its parent. + * @param viewObject the object for which to return the index. + * + * @return a {@link Result} indicating the status of the action, and if success, the index in + * the parent in {@link Result#getData()} + */ + public Result getViewIndex(Object viewObject) { + return NOT_IMPLEMENTED.createResult(); + } } diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/IProjectCallback.java b/layoutlib_api/src/com/android/ide/common/rendering/api/IProjectCallback.java index 144d317..99a1267 100644 --- a/layoutlib_api/src/com/android/ide/common/rendering/api/IProjectCallback.java +++ b/layoutlib_api/src/com/android/ide/common/rendering/api/IProjectCallback.java @@ -100,7 +100,12 @@ public interface IProjectCallback { * @param itemRef the {@link ResourceReference} for the layout used by the adapter item. * @param fullPosition the position of the item in the full list. * @param typePosition 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 <var>position</var>. + * If there is only one type of items, this is the same as <var>fullPosition</var>. + * @param fullChildPosition the position of the item in the full children list. This is only + * valid if the adapter view is an ExpandableListView. + * @param typeChildPosition the position of the child item if only items of the same type are + * considered. This is only valid if the adapter view is an ExpandableListView. + * If there is only one type of items, this is the same as <var>fullChildPosition</var>. * @param viewRef The {@link ResourceReference} for the view we're trying to fill. * @param ViewAttribute the attribute being queried. * @param defaultValue the default value for this attribute. The object class matches the @@ -110,7 +115,9 @@ public interface IProjectCallback { * @see ViewAttribute#getAttributeClass() */ Object getAdapterItemValue(ResourceReference adapterView, Object adapterCookie, - ResourceReference itemRef, int fullPosition, int typePosition, + ResourceReference itemRef, + int fullPosition, int typePosition, + int fullChildPosition, int typeChildPosition, ResourceReference viewRef, ViewAttribute viewAttribute, Object defaultValue); /** @@ -118,9 +125,11 @@ public interface IProjectCallback { * This is only called if {@link SessionParams} does not have an {@link AdapterBinding} for * the given {@link ResourceReference} already. * - * @param adapterView the adapter view to return the adapter binding for. + * @param adapterViewRef the reference of adapter view to return the adapter binding for. * @param adapterCookie the view cookie for this particular view. + * @param viewObject the view object for the adapter. * @return an adapter binding for the given view or null if there's no data. */ - AdapterBinding getAdapterBinding(ResourceReference adapterView, Object adapterCookie); + AdapterBinding getAdapterBinding(ResourceReference adapterViewRef, Object adapterCookie, + Object viewObject); } diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/RenderSession.java b/layoutlib_api/src/com/android/ide/common/rendering/api/RenderSession.java index a2e087c..188909e 100644 --- a/layoutlib_api/src/com/android/ide/common/rendering/api/RenderSession.java +++ b/layoutlib_api/src/com/android/ide/common/rendering/api/RenderSession.java @@ -162,29 +162,6 @@ public class RenderSession { } /** - * Returns the View parent. - * - * @param viewObject the object for which to return the parent. - * - * @return a {@link Result} indicating the status of the action, and if success, the parent - * object in {@link Result#getData()} - */ - public Result getViewParent(Object viewObject) { - return NOT_IMPLEMENTED.createResult(); - } - - /** - * Returns the index of a given view it its parent. - * @param viewObject the object for which to return the index. - * - * @return a {@link Result} indicating the status of the action, and if success, the index in - * the parent in {@link Result#getData()} - */ - public Result getViewIndex(Object viewObject) { - return NOT_IMPLEMENTED.createResult(); - } - - /** * Inserts a new child in a ViewGroup object, and renders the result. * <p/> * The child is first inflated and then added to its new parent, at the given <var>index<var> |