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

Commit 0fdd4542 authored by Arian's avatar Arian Committed by Nolen Johnson
Browse files

VolumeDialogImpl: Don't hide the default stream when adjusting the music stream

If there are two visible rows and the user touches the default (music)
row, the other row disappears immediately. Avoid this behaviour by
tracking the row with which this panel was created and keep showing
that row if the user adjusts the music stream.

Test: While receiving a call both rows are touchable and the additional
      row does not disappear when adjusting the music stream.
Change-Id: I4e14a0ea50c5cc41cb279c6fbfc8a7d6e6d1ba61
parent 809bd111
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -260,6 +260,9 @@ public class VolumeDialogImpl implements VolumeDialog,
    private Consumer<Boolean> mCrossWindowBlurEnabledListener;
    private BackgroundBlurDrawable mDialogRowsViewBackground;

    // Variable to track the default row with which the panel is initially shown
    private VolumeRow mDefaultRow = null;

    public VolumeDialogImpl(
            Context context,
            VolumeDialogController volumeDialogController,
@@ -1276,6 +1279,10 @@ public class VolumeDialogImpl implements VolumeDialog,
            mConfigChanged = false;
        }

        if (mDefaultRow == null) {
            mDefaultRow = getActiveRow();
        }

        initSettingsH();
        mShowing = true;
        mIsAnimatingDismiss = false;
@@ -1343,6 +1350,7 @@ public class VolumeDialogImpl implements VolumeDialog,
                .withEndAction(() -> mHandler.postDelayed(() -> {
                    mDialog.dismiss();
                    tryToRemoveCaptionsTooltip();
                    mDefaultRow = null;
                    mIsAnimatingDismiss = false;

                    hideRingerDrawer();
@@ -1383,11 +1391,14 @@ public class VolumeDialogImpl implements VolumeDialog,
                return true;
            }

            if (row.defaultStream) {
            // if the row is the default stream or the row with which this panel was created,
            // show it additonally to the active row if it is one of the following streams
            if (row.defaultStream || mDefaultRow == row) {
                return activeRow.stream == STREAM_RING
                        || activeRow.stream == STREAM_NOTIFICATION
                        || activeRow.stream == STREAM_ALARM
                        || activeRow.stream == STREAM_VOICE_CALL
                        || activeRow.stream == STREAM_MUSIC
                        || activeRow.stream == STREAM_ACCESSIBILITY
                        || mDynamic.get(activeRow.stream);
            }