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

Commit 4d209afb authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[SB] Only hide the status bar if the shade is at least 40% showing.

If you have a HUN then start a touch event on it to swipe it away or
swipe open the shade, then the shade starts at ~23% expanded, which was
enough for HomeStatusBarViewModel to decide the shade is "expanded
enough" so we should hide the status bar. This CL increases that
"expanded enough" threshold to 40% so that the status bar doesn't
immediately disappear when interacting with a HUN.

Fixes: 412820391
Bug: 394257529
Flag: com.android.systemui.status_bar_root_modernization
Test: atest HomeStatusBarViewModelImplTest
Test: Trigger normal HUN then drag up to dismiss -> verify status bar
doesn't hide
Test: Trigger normal HUN then drag down to open shade -> verify status
bar doesn't hide
Test: Trigger chip, tap chip to show HUN, then drag up to dismiss ->
verify status bar doesn't hide
Test: Trigger chip, tap chip to show HUN, then drag down to open shade
-> verify status bar doesn't hide

Change-Id: I5b94620b5b4c35d2ac3c0bbe590bd01fb1c91477
parent c097c66d
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -280,11 +280,11 @@ constructor(
        get() = statusBarPopupChips.shownPopupChips

    private val isShadeExpandedEnough =
        // Keep the status bar visible while the shade is just starting to open, but otherwise
        // hide it so that the status bar doesn't draw while it can't be seen.
        // See b/394257529#comment24.
        // Keep the status bar visible while the shade is just starting to open or while a HUN is
        // being dragged on (b/412820391), but otherwise hide it so that the status bar doesn't draw
        // while it can't be seen. See b/394257529#comment24.
        shadeInteractor.anyExpansion
            .map { it >= 0.2 }
            .map { it >= 0.4 }
            .distinctUntilChanged()
            .logDiffsForTable(
                tableLogBuffer = tableLogger,