Loading packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputAdapter.java +5 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,11 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter { @Override public int getItemViewType(int position) { if (mController.isAdvancedLayoutSupported() && position >= mController.getMediaItemList().size()) { Log.d(TAG, "Incorrect position for item type: " + position); return MediaItem.MediaItemType.TYPE_GROUP_DIVIDER; } return mController.isAdvancedLayoutSupported() ? mController.getMediaItemList().get(position).getMediaItemType() : super.getItemViewType(position); Loading packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseAdapter.java +12 −9 Original line number Diff line number Diff line Loading @@ -333,7 +333,7 @@ public abstract class MediaOutputBaseAdapter extends if (!mController.isVolumeControlEnabled(device)) { disableSeekBar(); } else { enableSeekBar(); enableSeekBar(device); } mSeekBar.setMaxVolume(device.getMaxVolume()); final int currentVolume = device.getCurrentVolume(); Loading Loading @@ -369,13 +369,6 @@ public abstract class MediaOutputBaseAdapter extends if (mIsInitVolumeFirstTime) { mIsInitVolumeFirstTime = false; } if (mController.isAdvancedLayoutSupported()) { updateIconAreaClickListener((v) -> { mSeekBar.resetVolume(); mController.adjustVolume(device, 0); updateMutedVolumeIcon(); }); } mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { Loading Loading @@ -556,11 +549,21 @@ public abstract class MediaOutputBaseAdapter extends protected void disableSeekBar() { mSeekBar.setEnabled(false); mSeekBar.setOnTouchListener((v, event) -> true); if (mController.isAdvancedLayoutSupported()) { updateIconAreaClickListener(null); } } private void enableSeekBar() { private void enableSeekBar(MediaDevice device) { mSeekBar.setEnabled(true); mSeekBar.setOnTouchListener((v, event) -> false); if (mController.isAdvancedLayoutSupported()) { updateIconAreaClickListener((v) -> { mSeekBar.resetVolume(); mController.adjustVolume(device, 0); updateMutedVolumeIcon(); }); } } protected void setUpDeviceIcon(MediaDevice device) { Loading Loading
packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputAdapter.java +5 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,11 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter { @Override public int getItemViewType(int position) { if (mController.isAdvancedLayoutSupported() && position >= mController.getMediaItemList().size()) { Log.d(TAG, "Incorrect position for item type: " + position); return MediaItem.MediaItemType.TYPE_GROUP_DIVIDER; } return mController.isAdvancedLayoutSupported() ? mController.getMediaItemList().get(position).getMediaItemType() : super.getItemViewType(position); Loading
packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseAdapter.java +12 −9 Original line number Diff line number Diff line Loading @@ -333,7 +333,7 @@ public abstract class MediaOutputBaseAdapter extends if (!mController.isVolumeControlEnabled(device)) { disableSeekBar(); } else { enableSeekBar(); enableSeekBar(device); } mSeekBar.setMaxVolume(device.getMaxVolume()); final int currentVolume = device.getCurrentVolume(); Loading Loading @@ -369,13 +369,6 @@ public abstract class MediaOutputBaseAdapter extends if (mIsInitVolumeFirstTime) { mIsInitVolumeFirstTime = false; } if (mController.isAdvancedLayoutSupported()) { updateIconAreaClickListener((v) -> { mSeekBar.resetVolume(); mController.adjustVolume(device, 0); updateMutedVolumeIcon(); }); } mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { Loading Loading @@ -556,11 +549,21 @@ public abstract class MediaOutputBaseAdapter extends protected void disableSeekBar() { mSeekBar.setEnabled(false); mSeekBar.setOnTouchListener((v, event) -> true); if (mController.isAdvancedLayoutSupported()) { updateIconAreaClickListener(null); } } private void enableSeekBar() { private void enableSeekBar(MediaDevice device) { mSeekBar.setEnabled(true); mSeekBar.setOnTouchListener((v, event) -> false); if (mController.isAdvancedLayoutSupported()) { updateIconAreaClickListener((v) -> { mSeekBar.resetVolume(); mController.adjustVolume(device, 0); updateMutedVolumeIcon(); }); } } protected void setUpDeviceIcon(MediaDevice device) { Loading