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

Commit 633066bd authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "Bugfix : Expanded volume overlay" into ics

parents d65817b1 9b06af9f
Loading
Loading
Loading
Loading
+15 −7
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
    private boolean mRingIsSilent;
    private boolean mShowCombinedVolumes;
    private boolean mVoiceCapable;
    private int mCurrentOverlayStyle;
    private int mCurrentOverlayStyle = -1;

    /** Dialog containing all the sliders */
    private final Dialog mDialog;
@@ -250,16 +250,16 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
        mVoiceCapable = context.getResources().getBoolean(R.bool.config_voice_capable);

        // get the users preference
        mCurrentOverlayStyle = Settings.System.getInt(context.getContentResolver(),Settings.System.MODE_VOLUME_OVERLAY, Settings.System.VOLUME_OVERLAY_SINGLE);
        int choosenStyle = Settings.System.getInt(context.getContentResolver(),Settings.System.MODE_VOLUME_OVERLAY, Settings.System.VOLUME_OVERLAY_SINGLE);
        // by default -1 is expected - deal with choosing the right default
        if (mCurrentOverlayStyle == -1) {
        if (choosenStyle == -1) {
            if (mVoiceCapable) {
                mCurrentOverlayStyle = Settings.System.VOLUME_OVERLAY_SINGLE;
                choosenStyle = Settings.System.VOLUME_OVERLAY_SINGLE;
            } else {
                mCurrentOverlayStyle = Settings.System.VOLUME_OVERLAY_EXPANDABLE;
                choosenStyle = Settings.System.VOLUME_OVERLAY_EXPANDABLE;
            }
        }
        changeOverlayStyle(mCurrentOverlayStyle);
        changeOverlayStyle(choosenStyle);
        mMoreButton.setOnClickListener(this);

        listenToRingerModeAndConfigChanges();
@@ -287,6 +287,8 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie

    private void changeOverlayStyle(int newStyle) {
        Log.i("VolumePanel", "changeOverlayStyle : " + newStyle);
        // Don't change to the same style
        if (newStyle == mCurrentOverlayStyle) return;
        switch (newStyle) {
            case Settings.System.VOLUME_OVERLAY_SINGLE :
                mMoreButton.setVisibility(View.GONE);
@@ -403,8 +405,10 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
        final int count = mSliderGroup.getChildCount();

        for (int i = 0; i < count; i++) {
            if (mSliderGroup.getChildAt(i).getVisibility() != View.VISIBLE) {
                mSliderGroup.getChildAt(i).setVisibility(View.VISIBLE);
            }
        }
        mMoreButton.setVisibility(View.GONE);
        mDivider.setVisibility(View.GONE);
    }
@@ -585,6 +589,10 @@ public class VolumePanel extends Handler implements OnSeekBarChangeListener, Vie
            if (mShowCombinedVolumes && mCurrentOverlayStyle != Settings.System.VOLUME_OVERLAY_EXPANDED) {
                collapse();
            }
            // If just changed the style and we need to expand
            if (mCurrentOverlayStyle == Settings.System.VOLUME_OVERLAY_EXPANDED) {
                expand();
            }
            mDialog.show();
        }