Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 162c1dcd authored by Xavier Ducrohet's avatar Xavier Ducrohet
Browse files

Layoutlib: implement Resources.getBoolean(int).

Change-Id: I44cee203bb9a8fabaebfd689fc20ec2f2a9b3561
parent b389bdfb
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -416,6 +416,22 @@ public final class BridgeResources extends Resources {
        return 0;
    }

    @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();