Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 275ca2a6 authored by Andrey Kulikov's avatar Andrey Kulikov
Browse files

Fix IntDef's usages in the platform Transitions

Bug: 68490704

1) Add annotation in some places where it was missed: constructors of Fade and Slide
2) Add Fade.IN and Fade.OUT into a set of allowed values for Visibility.MODE IntDef. Without it Lint will false alarm on this line:
new Fade().setMode(Fade.IN);
It should be allowed as Fade.IN is just a proxy value for Visibility.MODE_IN.

Test: n/a
Change-Id: I56d8ba5f49b1cf8f6a61357f58ac76312e7cf037
parent 75edffed
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ public class Fade extends Visibility {
     * @param fadingMode The behavior of this transition, a combination of
     * {@link #IN} and {@link #OUT}.
     */
    public Fade(int fadingMode) {
    public Fade(@VisibilityMode int fadingMode) {
        setMode(fadingMode);
    }

+1 −1
Original line number Diff line number Diff line
@@ -147,7 +147,7 @@ public class Slide extends Visibility {
    /**
     * Constructor using the provided slide edge direction.
     */
    public Slide(int slideEdge) {
    public Slide(@GravityFlag int slideEdge) {
        setSlideEdge(slideEdge);
    }

+4 −2
Original line number Diff line number Diff line
@@ -52,9 +52,11 @@ public abstract class Visibility extends Transition {

    /** @hide */
    @Retention(RetentionPolicy.SOURCE)
    @IntDef(flag = true, prefix = { "MODE_" }, value = {
    @IntDef(flag = true, value = {
            MODE_IN,
            MODE_OUT
            MODE_OUT,
            Fade.IN,
            Fade.OUT
    })
    @interface VisibilityMode {}