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

Commit a1f3e4ae authored by Romain Guy's avatar Romain Guy
Browse files

Fix int to string mapping of exported properties. The value generated by the

mapping in a @ViewDebug.ExportedProperty annotation was always overriden by
the resolveId attribute.
parent 3d3e307a
Loading
Loading
Loading
Loading
+44 −43
Original line number Diff line number Diff line
@@ -1260,7 +1260,7 @@ public class ViewDebug {

        for (int j = 0; j < valuesCount; j++) {
            String name;
            String value;
            String value = null;

            final int intValue = array[j];

@@ -1276,7 +1276,6 @@ public class ViewDebug {
                }
            }

            value = String.valueOf(intValue);
            if (hasMapping) {
                int mappingCount = mapping.length;
                for (int k = 0; k < mappingCount; k++) {
@@ -1289,7 +1288,9 @@ public class ViewDebug {
            }

            if (resolveId) {
                value = (String) resolveId(context, intValue);
                if (value == null) value = (String) resolveId(context, intValue);
            } else {
                value = String.valueOf(intValue);
            }

            writeEntry(out, prefix, name, suffix, value);
+6 −6
Original line number Diff line number Diff line
@@ -881,7 +881,7 @@ public class RelativeLayout extends ViewGroup {
            @ViewDebug.IntToString(from = RIGHT_OF,            to = "rightOf")
        }, mapping = {
            @ViewDebug.IntToString(from = TRUE, to = "true"),
            @ViewDebug.IntToString(from = 0,    to = "FALSE/NO_ID")
            @ViewDebug.IntToString(from = 0,    to = "false/NO_ID")
        })
        private int[] mRules = new int[VERB_COUNT];