Loading packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputAdapter.java +13 −5 Original line number Diff line number Diff line Loading @@ -205,7 +205,8 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter { && mController.isSubStatusSupported() && mController.isAdvancedLayoutSupported() && device.hasSubtext()) { boolean isActiveWithOngoingSession = (device.hasOngoingSession() && currentlyConnected); (device.hasOngoingSession() && (currentlyConnected || isDeviceIncluded( mController.getSelectedMediaDevice(), device))); boolean isHost = device.isHostForOngoingSession() && isActiveWithOngoingSession; if (isHost) { Loading @@ -224,10 +225,17 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter { if (isActiveWithOngoingSession) { //Selected device which has ongoing session, disable seekbar since we //only allow volume control on Host initSeekbar(device, isCurrentSeekbarInvisible); mCurrentActivePosition = position; } boolean showSeekbar = (!device.hasOngoingSession() && currentlyConnected); if (showSeekbar) { updateTitleIcon(R.drawable.media_output_icon_volume, mController.getColorItemContent()); initSeekbar(device, isCurrentSeekbarInvisible); } else { setUpDeviceIcon(device); } mSubTitleText.setText(device.getSubtextString()); Drawable deviceStatusIcon = device.hasOngoingSession() ? mContext.getDrawable( Loading @@ -241,8 +249,8 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter { updateTwoLineLayoutContentAlpha( updateClickActionBasedOnSelectionBehavior(device) ? DEVICE_CONNECTED_ALPHA : DEVICE_DISCONNECTED_ALPHA); setTwoLineLayout(device, isActiveWithOngoingSession /* bFocused */, isActiveWithOngoingSession /* showSeekBar */, setTwoLineLayout(device, currentlyConnected /* bFocused */, showSeekbar /* showSeekBar */, false /* showProgressBar */, true /* showSubtitle */, deviceStatusIcon != null /* showStatus */, isActiveWithOngoingSession /* isFakeActive */); Loading packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseAdapter.java +2 −2 Original line number Diff line number Diff line Loading @@ -270,10 +270,10 @@ public abstract class MediaOutputBaseAdapter extends final Drawable backgroundDrawable; if (mController.isAdvancedLayoutSupported() && mController.isSubStatusSupported()) { backgroundDrawable = mContext.getDrawable( showSeekBar ? R.drawable.media_output_item_background_active showSeekBar || isFakeActive ? R.drawable.media_output_item_background_active : R.drawable.media_output_item_background).mutate(); backgroundDrawable.setTint( showSeekBar ? mController.getColorConnectedItemBackground() showSeekBar || isFakeActive ? mController.getColorConnectedItemBackground() : mController.getColorItemBackground()); mIconAreaLayout.setBackgroundTintList( ColorStateList.valueOf(showProgressBar || isFakeActive Loading packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputAdapterTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -532,7 +532,7 @@ public class MediaOutputAdapterTest extends SysuiTestCase { mMediaOutputAdapter.onBindViewHolder(mViewHolder, 0); assertThat(mViewHolder.mTitleText.getVisibility()).isEqualTo(View.GONE); assertThat(mViewHolder.mSeekBar.getVisibility()).isEqualTo(View.VISIBLE); assertThat(mViewHolder.mSeekBar.getVisibility()).isEqualTo(View.GONE); assertThat(mViewHolder.mProgressBar.getVisibility()).isEqualTo(View.GONE); assertThat(mViewHolder.mCheckBox.getVisibility()).isEqualTo(View.GONE); assertThat(mViewHolder.mStatusIcon.getVisibility()).isEqualTo(View.VISIBLE); Loading Loading
packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputAdapter.java +13 −5 Original line number Diff line number Diff line Loading @@ -205,7 +205,8 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter { && mController.isSubStatusSupported() && mController.isAdvancedLayoutSupported() && device.hasSubtext()) { boolean isActiveWithOngoingSession = (device.hasOngoingSession() && currentlyConnected); (device.hasOngoingSession() && (currentlyConnected || isDeviceIncluded( mController.getSelectedMediaDevice(), device))); boolean isHost = device.isHostForOngoingSession() && isActiveWithOngoingSession; if (isHost) { Loading @@ -224,10 +225,17 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter { if (isActiveWithOngoingSession) { //Selected device which has ongoing session, disable seekbar since we //only allow volume control on Host initSeekbar(device, isCurrentSeekbarInvisible); mCurrentActivePosition = position; } boolean showSeekbar = (!device.hasOngoingSession() && currentlyConnected); if (showSeekbar) { updateTitleIcon(R.drawable.media_output_icon_volume, mController.getColorItemContent()); initSeekbar(device, isCurrentSeekbarInvisible); } else { setUpDeviceIcon(device); } mSubTitleText.setText(device.getSubtextString()); Drawable deviceStatusIcon = device.hasOngoingSession() ? mContext.getDrawable( Loading @@ -241,8 +249,8 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter { updateTwoLineLayoutContentAlpha( updateClickActionBasedOnSelectionBehavior(device) ? DEVICE_CONNECTED_ALPHA : DEVICE_DISCONNECTED_ALPHA); setTwoLineLayout(device, isActiveWithOngoingSession /* bFocused */, isActiveWithOngoingSession /* showSeekBar */, setTwoLineLayout(device, currentlyConnected /* bFocused */, showSeekbar /* showSeekBar */, false /* showProgressBar */, true /* showSubtitle */, deviceStatusIcon != null /* showStatus */, isActiveWithOngoingSession /* isFakeActive */); Loading
packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseAdapter.java +2 −2 Original line number Diff line number Diff line Loading @@ -270,10 +270,10 @@ public abstract class MediaOutputBaseAdapter extends final Drawable backgroundDrawable; if (mController.isAdvancedLayoutSupported() && mController.isSubStatusSupported()) { backgroundDrawable = mContext.getDrawable( showSeekBar ? R.drawable.media_output_item_background_active showSeekBar || isFakeActive ? R.drawable.media_output_item_background_active : R.drawable.media_output_item_background).mutate(); backgroundDrawable.setTint( showSeekBar ? mController.getColorConnectedItemBackground() showSeekBar || isFakeActive ? mController.getColorConnectedItemBackground() : mController.getColorItemBackground()); mIconAreaLayout.setBackgroundTintList( ColorStateList.valueOf(showProgressBar || isFakeActive Loading
packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputAdapterTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -532,7 +532,7 @@ public class MediaOutputAdapterTest extends SysuiTestCase { mMediaOutputAdapter.onBindViewHolder(mViewHolder, 0); assertThat(mViewHolder.mTitleText.getVisibility()).isEqualTo(View.GONE); assertThat(mViewHolder.mSeekBar.getVisibility()).isEqualTo(View.VISIBLE); assertThat(mViewHolder.mSeekBar.getVisibility()).isEqualTo(View.GONE); assertThat(mViewHolder.mProgressBar.getVisibility()).isEqualTo(View.GONE); assertThat(mViewHolder.mCheckBox.getVisibility()).isEqualTo(View.GONE); assertThat(mViewHolder.mStatusIcon.getVisibility()).isEqualTo(View.VISIBLE); Loading