我要做的就是簡單地添加一個TODO聲明。它不會標記資源,但doc關鍵字TODO確實在Git中顯示,並在排水溝中顯示爲標記。希望這些警告足以讓您和其他人使用它。
但並非總是如此。正如我們所知,@Deprecated實質上是一個止損點,直到確實被移除爲止,並且代碼被正確清理。
下面是一個我不再使用(並且想要@Deprecate)的shape.xml文件的例子。
<?xml version="1.0" encoding="utf-8"?>
<!--
Border around card elements. For now this is used only within the
cards of the Questionnaire RecyclerView.
TODO: This file is obsolete. Use CardView instead.
-->
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<stroke
android:width="@dimen/tiny_card_margin"
android:color="@color/colorPrimaryDark" />
<solid
android:color="@android:color/white" />
<corners
android:radius="4dp" />
</shape>
我認爲這是一個有趣的問題,但如果不可能,它不會讓我感到驚訝。我唯一能想到的是在目錄名稱中添加限定符,但似乎沒有任何限定符,至少在文檔中沒有。 – wvdz 2014-10-31 21:59:27