diff options
author | Tor Norbye <tnorbye@google.com> | 2012-07-25 09:30:43 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2012-07-25 09:30:43 -0700 |
commit | da7ea9a923f66412631f36ee7105c644414eb986 (patch) | |
tree | 1c5e5b6e0111747e5b8451723adf4c1a49d65379 /ide_common/src/com/android/ide/common/resources/ValueResourceParser.java | |
parent | 48e6b702ea40f0904f90bf7d90799d01e007a2e4 (diff) | |
download | sdk-da7ea9a923f66412631f36ee7105c644414eb986.zip sdk-da7ea9a923f66412631f36ee7105c644414eb986.tar.gz sdk-da7ea9a923f66412631f36ee7105c644414eb986.tar.bz2 |
Fix handling of @id/ resources
If you create a relative layout where one of the widgets create a new
id such as @+id/button1, and then a later widget references this
widget in a layout constraint using @id instead of @+id, such as
layout_below="@id/button1", then it's possible for the resource
repository to not update itself properly, and a subsequent layout
editor render will generate error messages (can't find @id/button1).
The problem is that the id parser was only looking up the resource
repository for the @id reference, it was not also looking up the
current resource file, to see if an @id reference is valid. This made
it erroneously mark an error, and therefore return false from the
parse method. This then had the cascaded effect of not updating the
repository information from the parse, so the newly added id didn't
get added to the maps.
Change-Id: Iae3d215897525582579faf1c8ba64260215fec9d
Diffstat (limited to 'ide_common/src/com/android/ide/common/resources/ValueResourceParser.java')
-rw-r--r-- | ide_common/src/com/android/ide/common/resources/ValueResourceParser.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ide_common/src/com/android/ide/common/resources/ValueResourceParser.java b/ide_common/src/com/android/ide/common/resources/ValueResourceParser.java index 7c11dd7..aabfd35 100644 --- a/ide_common/src/com/android/ide/common/resources/ValueResourceParser.java +++ b/ide_common/src/com/android/ide/common/resources/ValueResourceParser.java @@ -44,6 +44,7 @@ public final class ValueResourceParser extends DefaultHandler { public interface IValueResourceRepository { void addResourceValue(ResourceValue value); + boolean hasResourceValue(ResourceType type, String name); } private boolean inResources = false; |