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

Commit 2dc97828 authored by Josh Tsuji's avatar Josh Tsuji Committed by Automerger Merge Worker
Browse files

Merge "Reinitialize dimens to fix issues with changing display/font size."...

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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14938809

Change-Id: Ia0fd07bc1465f7a3de4a340a232d9649f9759b58
parents cccb1e9b e6eed176
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;
    }