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

Commit f627cbb1 authored by Diego Perez's avatar Diego Perez
Browse files

Try to resolve IDs also as enums

This is intended to cover the edge case in ConstraintLayout (and
possibly in other places) where an attribute is defined as
reference|enum.
If we can not resolve the value as a reference, try to resolve it as an
enum and return the value.

Change-Id: I2817aa5d78500247a2e9aec5411586a1db13791d
(cherry picked from commit b24b563654bf7c007f0912bf32fbab948fcb6daa)
parent b49c45bb
Loading
Loading
Loading
Loading
+9 −1
Original line number Original line Diff line number Diff line
@@ -638,7 +638,15 @@ public final class BridgeTypedArray extends TypedArray {
            }
            }
        }
        }


        // not a direct id valid reference? resolve it
        // not a direct id valid reference. First check if it's an enum (this is a corner case
        // for attributes that have a reference|enum type), then fallback to resolve
        // as an ID without prefix.
        Integer enumValue = resolveEnumAttribute(index);
        if (enumValue != null) {
            return enumValue;
        }

        // Ok, not an enum, resolve as an ID
        Integer idValue;
        Integer idValue;


        if (resValue.isFramework()) {
        if (resValue.isFramework()) {