Loading core/java/android/view/VolumePanel.java +15 −7 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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(); Loading Loading @@ -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); Loading Loading @@ -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); } Loading Loading @@ -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(); } Loading Loading
core/java/android/view/VolumePanel.java +15 −7 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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(); Loading Loading @@ -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); Loading Loading @@ -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); } Loading Loading @@ -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(); } Loading