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

Commit e6eed176 authored by Josh Tsuji's avatar Josh Tsuji Committed by Android (Google) Code Review
Browse files

Merge "Reinitialize dimens to fix issues with changing display/font size." into sc-dev

parents 5b858bc0 e6147842
Loading
Loading
Loading
Loading
+24 −17
Original line number Diff line number Diff line
@@ -151,12 +151,12 @@ public class VolumeDialogImpl implements VolumeDialog,

    private final int mDialogShowAnimationDurationMs;
    private final int mDialogHideAnimationDurationMs;
    private final int mDialogWidth;
    private final int mDialogCornerRadius;
    private final int mRingerDrawerItemSize;
    private final int mRingerRowsPadding;
    private final boolean mShowVibrate;
    private final int mRingerCount;
    private int mDialogWidth;
    private int mDialogCornerRadius;
    private int mRingerDrawerItemSize;
    private int mRingerRowsPadding;
    private boolean mShowVibrate;
    private int mRingerCount;
    private final boolean mShowLowMediaVolumeIcon;
    private final boolean mChangeVolumeRowTintWhenInactive;

@@ -288,18 +288,8 @@ public class VolumeDialogImpl implements VolumeDialog,
                mDialogRowsView.invalidate();
            };
        }
        mDialogWidth = mContext.getResources().getDimensionPixelSize(
                R.dimen.volume_dialog_panel_width);
        mDialogCornerRadius = mContext.getResources().getDimensionPixelSize(
                R.dimen.volume_dialog_panel_width_half);
        mRingerDrawerItemSize = mContext.getResources().getDimensionPixelSize(
                R.dimen.volume_ringer_drawer_item_size);
        mRingerRowsPadding = mContext.getResources().getDimensionPixelSize(
                R.dimen.volume_dialog_ringer_rows_padding);
        mShowVibrate = mController.hasVibrator();

        // Normal, mute, and possibly vibrate.
        mRingerCount = mShowVibrate ? 3 : 2;
        initDimens();
    }

    @Override
@@ -378,6 +368,8 @@ public class VolumeDialogImpl implements VolumeDialog,
    private void initDialog() {
        mDialog = new CustomDialog(mContext);

        initDimens();

        mConfigurableTexts = new ConfigurableTexts(mContext);
        mHovering = false;
        mShowing = false;
@@ -569,6 +561,21 @@ public class VolumeDialogImpl implements VolumeDialog,
        initODICaptionsH();
    }

    private void initDimens() {
        mDialogWidth = mContext.getResources().getDimensionPixelSize(
                R.dimen.volume_dialog_panel_width);
        mDialogCornerRadius = mContext.getResources().getDimensionPixelSize(
                R.dimen.volume_dialog_panel_width_half);
        mRingerDrawerItemSize = mContext.getResources().getDimensionPixelSize(
                R.dimen.volume_ringer_drawer_item_size);
        mRingerRowsPadding = mContext.getResources().getDimensionPixelSize(
                R.dimen.volume_dialog_ringer_rows_padding);
        mShowVibrate = mController.hasVibrator();

        // Normal, mute, and possibly vibrate.
        mRingerCount = mShowVibrate ? 3 : 2;
    }

    protected ViewGroup getDialogView() {
        return mDialogView;
    }