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

Commit a8aae28c authored by Lujiang Xue's avatar Lujiang Xue
Browse files

make updateWidth aware of side margins

Bug: 63716325

Test: build and flash
Change-Id: Ia8644737e5377a72c1e6c2eaac1a11a734b8fb31
parent c920506d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -297,7 +297,8 @@ public class VolumeDialogImpl implements VolumeDialog, TunerService.Tunable {
    }

    private void updateWindowWidthH() {
        final ViewGroup.LayoutParams lp = mDialogView.getLayoutParams();
        final ViewGroup.MarginLayoutParams lp =
                (ViewGroup.MarginLayoutParams) mDialogView.getLayoutParams();
        final DisplayMetrics dm = mContext.getResources().getDisplayMetrics();
        if (D.BUG) Log.d(TAG, "updateWindowWidth dm.w=" + dm.widthPixels);
        int w = dm.widthPixels;
@@ -306,7 +307,7 @@ public class VolumeDialogImpl implements VolumeDialog, TunerService.Tunable {
        if (w > max) {
            w = max;
        }
        lp.width = w;
        lp.width = w - lp.getMarginEnd() - lp.getMarginStart();
        mDialogView.setLayoutParams(lp);
    }