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

Unverified Commit 43b6f2cd authored by Aditya Eka Pranata's avatar Aditya Eka Pranata Committed by Michael Bestas
Browse files

SystemUI: Fixup center clock position

When clock position set to center, after a few minutes, there is an
empty space on the left side where the clock is on the left. This is
because it only checks the clock for the right position. So we make it
checking the clock in the center position too.

Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/5832
Change-Id: I4ed24f96106346ead9c12fa3fcab6e87387a552d
parent 0fb0c778
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -251,18 +251,18 @@ public class HeadsUpAppearanceController extends ViewController<HeadsUpStatusBar
    private void setPinnedStatus(PinnedStatus pinnedStatus) {
        if (mPinnedStatus != pinnedStatus) {
            View clockView = mClockController.getClock();
            boolean isRightClock = clockView.getId() == R.id.clock_right;
            boolean notLeftClock = clockView.getId() != R.id.clock;
            mPinnedStatus = pinnedStatus;
            if (pinnedStatus.isPinned()) {
                updateParentClipping(false /* shouldClip */);
                mView.setVisibility(View.VISIBLE);
                show(mView);
                if (!StatusBarRootModernization.isEnabled() && !isRightClock) {
                if (!StatusBarRootModernization.isEnabled() && !notLeftClock) {
                    hide(mClockView, View.INVISIBLE);
                }
                mOperatorNameViewOptional.ifPresent(view -> hide(view, View.INVISIBLE));
            } else {
                if (!StatusBarRootModernization.isEnabled() && !isRightClock) {
                if (!StatusBarRootModernization.isEnabled() && !notLeftClock) {
                    show(mClockView);
                }
                mOperatorNameViewOptional.ifPresent(this::show);
+2 −2
Original line number Diff line number Diff line
@@ -687,9 +687,9 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
                        && mHasSecondaryOngoingActivity;

        View clockView = mClockController.getClock();
        boolean isRightClock = clockView.getId() == R.id.clock_right;
        boolean notLeftClock = clockView.getId() != R.id.clock;
        return new StatusBarVisibilityModel(
                showClock || isRightClock,
                showClock || notLeftClock,
                externalModel.getShowNotificationIcons(),
                showPrimaryOngoingActivityChip && !headsUpVisible,
                showSecondaryOngoingActivityChip && !headsUpVisible,