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

Commit cffa14fa authored by Todd Lee's avatar Todd Lee Committed by Android (Google) Code Review
Browse files

Merge "Add API for detection of 'closing' mode" into main

parents e54764ab 736b0853
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) {