Wednesday, 26 August 2020

How to detect deprecated androidx.legacy.widget.Space class?

Context

I am using the androidx.legacy.widget.Space in a layout in an Android application project:

<androidx.legacy.widget.Space
    android:layout_width="match_parent"
    android:layout_height="@dimen/space_height" />

The class is marked as @Deprecated - one should use the framework Space class instead:

// Copied from legacy-support-core-ui-1.0.0-sources.jar/androidx/legacy/widget/Space.java
@deprecated Use framework {@link android.widget.Space} class instead.

Finding usage of deprecated APIs

I ran Inspect Code... or Run inspection by Name ... for Java or XML files (see screenshots) in Android Studio 4.2 Canary 7 ...

Deprecated API usage (Java | Code maturity)

Deprecated API usage in XML

... and use the compiler arguments when I build via shell command ..

options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"

... but the deprecated Space class usage is not reported. How can I detect it (and any other such cases)?

Related



from How to detect deprecated androidx.legacy.widget.Space class?

No comments:

Post a Comment