Can I mark a resource in my android project as deprecated?

后端 未结 2 1536
北恋
北恋 2021-02-18 16:56

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=\"depreca

2条回答
  •  无人及你
    2021-02-18 17:48

    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:

    
    abc
    abcd
    

提交回复
热议问题