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

Commit d9792b7d authored by John Spurlock's avatar John Spurlock
Browse files

Fix header clipping bug on rotate to landscape.

Since the header view's manual clipping is a function
of its width, we need to update it whenever the width
changes.

onConfigurationChanged is too early, so wait until the width
actually changes before updating the clip.

Change-Id: I017448f7e1c2d4bbcf7c93a6a47ad3073c43f5d5
parent a22aa880
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -87,6 +87,16 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL
                (ToggleSlider) findViewById(R.id.brightness_slider));
        loadDimens();
        updateVisibilities();
        addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
            @Override
            public void onLayoutChange(View v, int left, int top, int right,
                    int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
                if ((right - left) != (oldRight - oldLeft)) {
                    // width changed, update clipping
                    setClipping(getHeight());
                }
            }
        });
    }

    private void loadDimens() {