aboutsummaryrefslogtreecommitdiffstats
path: root/layoutlib_api
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2011-01-17 22:48:40 -0800
committerXavier Ducrohet <xav@android.com>2011-01-17 22:53:03 -0800
commitf73c2d98c0496d76b8a1284009e6bfae88cdf8ab (patch)
treeb76cc162b68df5a84ee494827f06208d4161f3fc /layoutlib_api
parent7af11a54cd5246483a4d5cbf2c84963facdf2bbe (diff)
downloadsdk-f73c2d98c0496d76b8a1284009e6bfae88cdf8ab.zip
sdk-f73c2d98c0496d76b8a1284009e6bfae88cdf8ab.tar.gz
sdk-f73c2d98c0496d76b8a1284009e6bfae88cdf8ab.tar.bz2
Add min/targetSdkVersion to the LayoutLib API.
This will allow some widgets to properly behave based on the minSdkVersion and targetSdkVersion of the project during rendering. Change-Id: I96d432b8b92fbc211ce122da51bd18049708c14f
Diffstat (limited to 'layoutlib_api')
-rw-r--r--layoutlib_api/src/com/android/ide/common/rendering/api/Params.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/Params.java b/layoutlib_api/src/com/android/ide/common/rendering/api/Params.java
index 3cede41..4bb41f1 100644
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/Params.java
+++ b/layoutlib_api/src/com/android/ide/common/rendering/api/Params.java
@@ -54,6 +54,8 @@ public class Params {
private final float mYdpi;
private final RenderResources mRenderResources;
private final IProjectCallback mProjectCallback;
+ private final int mMinSdkVersion;
+ private final int mTargetSdkVersion;
private final LayoutLog mLog;
private boolean mCustomBackgroundEnabled;
@@ -85,6 +87,8 @@ public class Params {
* value is the resource value.
* @param projectCallback The {@link IProjectCallback} object to get information from
* the project.
+ * @param minSdkVersion the minSdkVersion of the project
+ * @param targetSdkVersion the targetSdkVersion of the project
* @param log the object responsible for displaying warning/errors to the user.
*/
public Params(ILayoutPullParser layoutDescription,
@@ -92,7 +96,9 @@ public class Params {
int screenWidth, int screenHeight, RenderingMode renderingMode,
int density, float xdpi, float ydpi,
RenderResources renderResources,
- IProjectCallback projectCallback, LayoutLog log) {
+ IProjectCallback projectCallback,
+ int minSdkVersion, int targetSdkVersion,
+ LayoutLog log) {
mLayoutDescription = layoutDescription;
mProjectKey = projectKey;
mScreenWidth = screenWidth;
@@ -103,6 +109,8 @@ public class Params {
mYdpi = ydpi;
mRenderResources = renderResources;
mProjectCallback = projectCallback;
+ mMinSdkVersion = minSdkVersion;
+ mTargetSdkVersion = targetSdkVersion;
mLog = log;
mCustomBackgroundEnabled = false;
mTimeout = DEFAULT_TIMEOUT;
@@ -122,6 +130,8 @@ public class Params {
mYdpi = params.mYdpi;
mRenderResources = params.mRenderResources;
mProjectCallback = params.mProjectCallback;
+ mMinSdkVersion = params.mMinSdkVersion;
+ mTargetSdkVersion = params.mTargetSdkVersion;
mLog = params.mLog;
mCustomBackgroundEnabled = params.mCustomBackgroundEnabled;
mCustomBackgroundColor = params.mCustomBackgroundColor;
@@ -150,6 +160,14 @@ public class Params {
return mProjectKey;
}
+ public int getMinSdkVersion() {
+ return mMinSdkVersion;
+ }
+
+ public int getTargetSdkVersion() {
+ return mTargetSdkVersion;
+ }
+
public int getScreenWidth() {
return mScreenWidth;
}