mirror of
https://github.com/androidx/media.git
synced 2025-05-12 18:19:50 +08:00
Update @UnstableApi
docs to include a package-info.java
example
#minor-release PiperOrigin-RevId: 572229092 (cherry picked from commit 7009c53c799171c4f8e418af5fdb31a6a5544ab9)
This commit is contained in:
parent
292701ba55
commit
2ec24ac55f
@ -55,10 +55,10 @@ import java.lang.annotation.Target;
|
|||||||
* <p>By default usages of APIs annotated with this annotation generate lint errors in Gradle and
|
* <p>By default usages of APIs annotated with this annotation generate lint errors in Gradle and
|
||||||
* Android Studio, in order to alert developers to the risk of breaking changes.
|
* Android Studio, in order to alert developers to the risk of breaking changes.
|
||||||
*
|
*
|
||||||
* <p>Individual usage sites can be opted-in to suppress the lint error by using the {@link
|
* <p>Individual usage sites or whole packages can be opted-in to suppress the lint error by using
|
||||||
* androidx.annotation.OptIn} annotation.
|
* the {@link androidx.annotation.OptIn} annotation.
|
||||||
*
|
*
|
||||||
* <p>In Java:
|
* <p>In a Java class:
|
||||||
*
|
*
|
||||||
* <pre>{@code
|
* <pre>{@code
|
||||||
* import androidx.annotation.OptIn;
|
* import androidx.annotation.OptIn;
|
||||||
@ -68,6 +68,16 @@ import java.lang.annotation.Target;
|
|||||||
* private void methodUsingUnstableApis() { ... }
|
* private void methodUsingUnstableApis() { ... }
|
||||||
* }</pre>
|
* }</pre>
|
||||||
*
|
*
|
||||||
|
* <p>In a {@code package-info.java} file, to opt-in a whole package:
|
||||||
|
*
|
||||||
|
* <pre>{@code
|
||||||
|
* @OptIn(markerClass = UnstableApi.class)
|
||||||
|
* package name.of.your.package;
|
||||||
|
*
|
||||||
|
* import androidx.annotation.OptIn;
|
||||||
|
* import androidx.media3.common.util.UnstableApi;
|
||||||
|
* }</pre>
|
||||||
|
*
|
||||||
* <p>In Kotlin:
|
* <p>In Kotlin:
|
||||||
*
|
*
|
||||||
* <pre>{@code
|
* <pre>{@code
|
||||||
|
Loading…
x
Reference in New Issue
Block a user