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

Unverified Commit ae211e0a authored by Aditya Eka Pranata's avatar Aditya Eka Pranata Committed by LuK1337
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 6e956d6a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -250,18 +250,18 @@ public class HeadsUpAppearanceController extends ViewController<HeadsUpStatusBar
    private void setShown(boolean isShown) {
        if (mShown != isShown) {
            View clockView = mClockController.getClock();
            boolean isRightClock = clockView.getId() == R.id.clock_right;
            boolean notLeftClock = clockView.getId() != R.id.clock;
            mShown = isShown;
            if (isShown) {
                updateParentClipping(false /* shouldClip */);
                mView.setVisibility(View.VISIBLE);
                show(mView);
                if (!isRightClock) {
                if (!notLeftClock) {
                    hide(mClockView, View.INVISIBLE);
                }
                mOperatorNameViewOptional.ifPresent(view -> hide(view, View.INVISIBLE));
            } else {
                if (!isRightClock) {
                if (!notLeftClock) {
                    show(mClockView);
                }
                mOperatorNameViewOptional.ifPresent(this::show);
+2 −2
Original line number Diff line number Diff line
@@ -676,9 +676,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,