diff options
Diffstat (limited to 'tools/layoutlib/bridge/src/android/content/res/BridgeResources.java')
-rw-r--r-- | tools/layoutlib/bridge/src/android/content/res/BridgeResources.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/layoutlib/bridge/src/android/content/res/BridgeResources.java b/tools/layoutlib/bridge/src/android/content/res/BridgeResources.java index 625b40d..0928ec5 100644 --- a/tools/layoutlib/bridge/src/android/content/res/BridgeResources.java +++ b/tools/layoutlib/bridge/src/android/content/res/BridgeResources.java @@ -417,6 +417,22 @@ public final class BridgeResources extends Resources { } @Override + public boolean getBoolean(int id) throws NotFoundException { + Pair<String, ResourceValue> value = getResourceValue(id, mPlatformResourceFlag); + + if (value != null && value.getSecond().getValue() != null) { + String v = value.getSecond().getValue(); + return Boolean.parseBoolean(v); + } + + // id was not found or not resolved. Throw a NotFoundException. + throwException(id); + + // this is not used since the method above always throws + return false; + } + + @Override public String getResourceEntryName(int resid) throws NotFoundException { throw new UnsupportedOperationException(); } |