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

Commit 736b0853 authored by Todd Lee's avatar Todd Lee
Browse files

Add API for detection of 'closing' mode

Test: build
Change-Id: Ic8b3193a1e5d0475e875cd06881c2d21295cdd0f
parent 57882662
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ public class TransitionUtil {

    /** Returns {@code true} if the transition is opening or closing mode. */
    public static boolean isOpenOrCloseMode(@TransitionInfo.TransitionMode int mode) {
        return isOpeningMode(mode) || mode == TRANSIT_CLOSE || mode == TRANSIT_TO_BACK;
        return isOpeningMode(mode) || isClosingMode(mode);
    }

    /** Returns {@code true} if the transition is opening mode. */
@@ -77,6 +77,11 @@ public class TransitionUtil {
        return mode == TRANSIT_OPEN || mode == TRANSIT_TO_FRONT;
    }

    /** Returns {@code true} if the transition is closing mode. */
    public static boolean isClosingMode(@TransitionInfo.TransitionMode int mode) {
        return mode == TRANSIT_CLOSE || mode == TRANSIT_TO_BACK;
    }

    /** Returns {@code true} if the transition has a display change. */
    public static boolean hasDisplayChange(@NonNull TransitionInfo info) {
        for (int i = info.getChanges().size() - 1; i >= 0; --i) {