aboutsummaryrefslogtreecommitdiffstats
path: root/ide_common/src/com/android
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2011-05-19 11:29:32 -0700
committerXavier Ducrohet <xav@android.com>2011-05-19 11:29:32 -0700
commit3586fef5d94506dfa1b5fdf65ec3dd2173df0f85 (patch)
tree957069c25eed70d67abb704fe2feb11e62c702b4 /ide_common/src/com/android
parent9e4e56d1b612fb6f6fd4422bf4ef210df88b34e8 (diff)
downloadsdk-3586fef5d94506dfa1b5fdf65ec3dd2173df0f85.zip
sdk-3586fef5d94506dfa1b5fdf65ec3dd2173df0f85.tar.gz
sdk-3586fef5d94506dfa1b5fdf65ec3dd2173df0f85.tar.bz2
Add method to LayoutLibrary to query layoutlib api level and rev.
Change-Id: Ib70e560e7d0be88305383aac18726858d91990ae
Diffstat (limited to 'ide_common/src/com/android')
-rw-r--r--ide_common/src/com/android/ide/common/rendering/LayoutLibrary.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/ide_common/src/com/android/ide/common/rendering/LayoutLibrary.java b/ide_common/src/com/android/ide/common/rendering/LayoutLibrary.java
index dd1a3dc..3d1c5db 100644
--- a/ide_common/src/com/android/ide/common/rendering/LayoutLibrary.java
+++ b/ide_common/src/com/android/ide/common/rendering/LayoutLibrary.java
@@ -219,6 +219,33 @@ public class LayoutLibrary {
// ------ Layout Lib API proxy
/**
+ * Returns the API level of the layout library.
+ */
+ public int getApiLevel() {
+ if (mBridge != null) {
+ return mBridge.getApiLevel();
+ }
+
+ if (mLegacyBridge != null) {
+ return getLegacyApiLevel();
+ }
+
+ return 0;
+ }
+
+ /**
+ * Returns the revision of the library inside a given (layoutlib) API level.
+ * The true version number of the library is {@link #getApiLevel()}.{@link #getRevision()}
+ */
+ public int getRevision() {
+ if (mBridge != null) {
+ return mBridge.getRevision();
+ }
+
+ return 0;
+ }
+
+ /**
* Returns whether the LayoutLibrary supports a given {@link Capability}.
* @return true if it supports it.
*