aboutsummaryrefslogtreecommitdiffstats
path: root/layoutlib_api
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2010-05-17 17:04:26 -0700
committerXavier Ducrohet <xav@android.com>2010-05-18 11:44:19 -0700
commitb35d352fc9e9e10793e5dc7303a9fb02bfadf7a4 (patch)
tree503da4aafec4c575eda8b3fd2dde15c5ece46d7b /layoutlib_api
parent3cf7a66c2837c858c74aeab7a660162855e034c2 (diff)
downloadsdk-b35d352fc9e9e10793e5dc7303a9fb02bfadf7a4.zip
sdk-b35d352fc9e9e10793e5dc7303a9fb02bfadf7a4.tar.gz
sdk-b35d352fc9e9e10793e5dc7303a9fb02bfadf7a4.tar.bz2
move the resource enums from the qualifier classes to sdklib.
This is so that other code (like the manifest parser) can use them. Change-Id: I53be59bbe752e77752e90cedb528f25cf3b3792f
Diffstat (limited to 'layoutlib_api')
-rw-r--r--layoutlib_api/src/com/android/layoutlib/api/IDensityBasedResourceValue.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/layoutlib_api/src/com/android/layoutlib/api/IDensityBasedResourceValue.java b/layoutlib_api/src/com/android/layoutlib/api/IDensityBasedResourceValue.java
index 57a776f..c004f2f 100644
--- a/layoutlib_api/src/com/android/layoutlib/api/IDensityBasedResourceValue.java
+++ b/layoutlib_api/src/com/android/layoutlib/api/IDensityBasedResourceValue.java
@@ -38,6 +38,21 @@ public interface IDensityBasedResourceValue extends IResourceValue {
public int getValue() {
return mValue;
}
+
+ /**
+ * Returns the enum matching the given density value
+ * @param value The density value.
+ * @return the enum for the density value or null if no match was found.
+ */
+ public static Density getEnum(int value) {
+ for (Density d : values()) {
+ if (d.mValue == value) {
+ return d;
+ }
+ }
+
+ return null;
+ }
}
/**