Issue
I have an android library for which I would like to mark some resources as deprecated. Drawables, dimensions, durations... I read somewhere that I could add deprecated="deprecated" to the resource definition but it doesn't seem to do anything.
In Android R you can see things such as
@java.lang.Deprecated
public static final int autoText = 16843114;
I'm trying to produce something similar by editing durations.xml, values.xml, or even public.xml...
Thanks!
Solution
Short answer: Not possible.
@deprecated
tags are used by the Android source inside comments as it can be seen in fw/base core/res/values/attrs.xml (see line 3427 for autoText as referred to in the original post), in fw/base core/res/values/public.xml and in other places throughout the project, but it appears that the build tools used for building applications simply skip all comments meaning the annotiation tags get skipped as well in the process making this method fail.
Example usage of deprecation annotations based on Android source:
<!-- {@deprecated Use foobar instead.} -->
<string name="foo">abc</string>
<string name="foobar">abcd</string>
Answered By - Valter Jansons
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.