diff options
author | Tor Norbye <tnorbye@google.com> | 2011-05-20 20:41:35 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2011-05-23 12:52:37 -0700 |
commit | 8c224181ef61400338120015d1228513104a19e3 (patch) | |
tree | e8e38aeae9e74c92705f13ad05e5883322a60de6 /layoutlib_api/src/com | |
parent | 1f03a6d703421d94c392c5afc74f7036d4c71167 (diff) | |
download | sdk-8c224181ef61400338120015d1228513104a19e3.zip sdk-8c224181ef61400338120015d1228513104a19e3.tar.gz sdk-8c224181ef61400338120015d1228513104a19e3.tar.bz2 |
Detect and add special warning for wrong themes
If you open a layout designed for a particular theme in another theme,
you can get many confusing error messages. Instead of "attribute
missing" it may tell you that it failed to convert a resource to a
color or drawable, and so on.
To help guide users to the root problem (wrong theme chosen) this
changeset detects the scenario where theme attributes can't be
resolved, and when these are found the top of the error log will start
with a bold message stating that theme resources were not found and to
check whether the correct theme is chosen.
To do this, the resource resolver emits a new sub-type of the resource
missing tag into the error log, which is used in the IDE to prefix the
errors with the special error message.
Change-Id: Ic29c9af37da4b5cc2c9fb1ca5670c8b8f79bf852
Diffstat (limited to 'layoutlib_api/src/com')
-rw-r--r-- | layoutlib_api/src/com/android/ide/common/rendering/api/LayoutLog.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/LayoutLog.java b/layoutlib_api/src/com/android/ide/common/rendering/api/LayoutLog.java index 26d0479..df29537 100644 --- a/layoutlib_api/src/com/android/ide/common/rendering/api/LayoutLog.java +++ b/layoutlib_api/src/com/android/ide/common/rendering/api/LayoutLog.java @@ -57,6 +57,13 @@ public class LayoutLog { public final static String TAG_RESOURCES_RESOLVE = TAG_RESOURCES_PREFIX + "resolve"; /** + * Tag for resource resolution failure, specifically for theme attributes. + * In this case the warning/error data object will be a ResourceValue containing the type + * and name of the resource that failed to resolve + */ + public final static String TAG_RESOURCES_RESOLVE_THEME_ATTR = TAG_RESOURCES_RESOLVE + ".theme"; + + /** * Tag for failure when reading the content of a resource file. */ public final static String TAG_RESOURCES_READ = TAG_RESOURCES_PREFIX + "read"; |