aboutsummaryrefslogtreecommitdiffstats
path: root/ide_common/src
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2011-04-18 13:14:47 -0700
committerXavier Ducrohet <xav@android.com>2011-04-18 13:14:47 -0700
commitc615e18b2fa4070d1d1a5d72ccf5491a13e927e8 (patch)
tree063ce289a2fa28d8d2d27b38992823885d4fcc08 /ide_common/src
parentf72b32fb3d4c173d447fe3b48574a1242390d3ed (diff)
downloadsdk-c615e18b2fa4070d1d1a5d72ccf5491a13e927e8.zip
sdk-c615e18b2fa4070d1d1a5d72ccf5491a13e927e8.tar.gz
sdk-c615e18b2fa4070d1d1a5d72ccf5491a13e927e8.tar.bz2
Add getViewBaseline to the LayoutLibrary class.
Change-Id: I29caadc8cb31c4a3aab0863a4fec16534b9bc900
Diffstat (limited to 'ide_common/src')
-rw-r--r--ide_common/src/com/android/ide/common/rendering/LayoutLibrary.java17
1 files changed, 17 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 3294cbe..e1256fe 100644
--- a/ide_common/src/com/android/ide/common/rendering/LayoutLibrary.java
+++ b/ide_common/src/com/android/ide/common/rendering/LayoutLibrary.java
@@ -354,6 +354,23 @@ public class LayoutLibrary {
return NOT_IMPLEMENTED.createResult();
}
+ /**
+ * Utility method returning the baseline value for a given view object. This basically returns
+ * View.getBaseline().
+ *
+ * @param viewObject the object for which to return the index.
+ *
+ * @return the baseline value or -1 if not applicable to the view object or if this layout
+ * library does not implement this method.
+ */
+ public int getViewBaseline(Object viewObject) {
+ if (mBridge != null) {
+ return mBridge.getViewBaseline(viewObject);
+ }
+
+ return -1;
+ }
+
// ------ Implementation