diff options
| author | Xavier Ducrohet <xav@android.com> | 2009-08-20 15:21:12 -0700 |
|---|---|---|
| committer | Xavier Ducrohet <xav@android.com> | 2009-08-21 11:32:17 -0700 |
| commit | 9f944d673b4d13dd9cb5dc2c4be3afdb88805a70 (patch) | |
| tree | 93b09120b5cecd2b23822ee7e53e86a2fdf0eb36 /tools/eclipse | |
| parent | c22870b7ba5c4c9d8941304888a048fa8d89541c (diff) | |
| download | android_development-9f944d673b4d13dd9cb5dc2c4be3afdb88805a70.tar.gz android_development-9f944d673b4d13dd9cb5dc2c4be3afdb88805a70.tar.bz2 android_development-9f944d673b4d13dd9cb5dc2c4be3afdb88805a70.zip | |
Add basic support for full height rendering.
Diffstat (limited to 'tools/eclipse')
| -rw-r--r-- | tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/GraphicalLayoutEditor.java | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/GraphicalLayoutEditor.java b/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/GraphicalLayoutEditor.java index 0dfa0b41d..4efe4c361 100644 --- a/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/GraphicalLayoutEditor.java +++ b/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/GraphicalLayoutEditor.java @@ -42,6 +42,7 @@ import com.android.ide.eclipse.adt.internal.sdk.LoadStatus; import com.android.ide.eclipse.adt.internal.sdk.Sdk; import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData.LayoutBridge; import com.android.ide.eclipse.adt.internal.sdk.Sdk.ITargetChangeListener; +import com.android.layoutlib.api.ILayoutBridge; import com.android.layoutlib.api.ILayoutLog; import com.android.layoutlib.api.ILayoutResult; import com.android.layoutlib.api.IProjectCallback; @@ -1277,7 +1278,7 @@ public class GraphicalLayoutEditor extends AbstractGraphicalLayoutEditor * the implementation API level. */ @SuppressWarnings("deprecation") - private ILayoutResult computeLayout(LayoutBridge bridge, + private static ILayoutResult computeLayout(LayoutBridge bridge, IXmlPullParser layoutDescription, Object projectKey, int screenWidth, int screenHeight, int density, float xdpi, float ydpi, String themeName, boolean isProjectTheme, @@ -1285,9 +1286,17 @@ public class GraphicalLayoutEditor extends AbstractGraphicalLayoutEditor Map<String, Map<String, IResourceValue>> frameworkResources, IProjectCallback projectCallback, ILayoutLog logger) { - if (bridge.apiLevel >= 3) { - // newer api with boolean for separation of project/framework theme, - // and density support. + if (bridge.apiLevel >= ILayoutBridge.API_CURRENT) { + // newest API with support for "render full height" + // TODO: link boolean to UI. + return bridge.bridge.computeLayout(layoutDescription, + projectKey, screenWidth, screenHeight, false /* renderFullHeight */, + density, xdpi, ydpi, + themeName, isProjectTheme, + projectResources, frameworkResources, projectCallback, + logger); + } else if (bridge.apiLevel == 3) { + // newer api with density support. return bridge.bridge.computeLayout(layoutDescription, projectKey, screenWidth, screenHeight, density, xdpi, ydpi, themeName, isProjectTheme, @@ -1297,8 +1306,8 @@ public class GraphicalLayoutEditor extends AbstractGraphicalLayoutEditor // api with boolean for separation of project/framework theme return bridge.bridge.computeLayout(layoutDescription, projectKey, screenWidth, screenHeight, themeName, isProjectTheme, - mConfiguredProjectRes, frameworkResources, mProjectCallback, - mLogger); + projectResources, frameworkResources, projectCallback, + logger); } else { // oldest api with no density/dpi, and project theme boolean mixed // into the theme name. @@ -1311,8 +1320,8 @@ public class GraphicalLayoutEditor extends AbstractGraphicalLayoutEditor return bridge.bridge.computeLayout(layoutDescription, projectKey, screenWidth, screenHeight, themeName, - mConfiguredProjectRes, frameworkResources, mProjectCallback, - mLogger); + projectResources, frameworkResources, projectCallback, + logger); } } |
