From a84d8ef38565d59c5c71f7e5bbc1afcc6691c8f7 Mon Sep 17 00:00:00 2001 From: Xavier Ducrohet Date: Fri, 1 Apr 2011 14:11:47 -0700 Subject: Sample code to use the layout rendering library. This is very basic sample code showing how to render a layout. This explains how to load the resources, create Folderconfig, ResourceResolver, and how to call the LayoutLibrary to do an actual render. There are some big limitations: - can't render custom views because there's nothing compiling them and generating the compiled R.class file. - not all features of ADT are present because there are things that don't make sense outside of an editor (render in context, expand empty layouts, etc...) Change-Id: I0c8676ebfbff27f0e9412bb4b13193ce64082372 --- .../ide/common/rendering/api/DeclareStyleableResourceValue.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'layoutlib_api/src') diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/DeclareStyleableResourceValue.java b/layoutlib_api/src/com/android/ide/common/rendering/api/DeclareStyleableResourceValue.java index 2b13d0b..0699766 100644 --- a/layoutlib_api/src/com/android/ide/common/rendering/api/DeclareStyleableResourceValue.java +++ b/layoutlib_api/src/com/android/ide/common/rendering/api/DeclareStyleableResourceValue.java @@ -50,6 +50,10 @@ public class DeclareStyleableResourceValue extends ResourceValue { return null; } + public Map> getAllAttributes() { + return mEnumMap; + } + public void addValue(String attribute, String name, Integer value) { Map map; -- cgit v1.1