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

后端 未结 2 1547
北恋
北恋 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:40

    What I do is simply add a TODO statement. It does not flag the resource, but the doc keyword TODO does show up in Git and as marks in the gutter. Hopefully those warnings will be enough to keep you and others from using it.

    But not always. As we know, @Deprecated is essentially a stop-gap until something is really removed for good and the code is cleaned up properly.

    Here's an example of a shape.xml file that I no longer use (and want to @Deprecate).

    
    
    
        
        
        
    
    

提交回复
热议问题