Loading packages/SystemUI/res/drawable/media_output_dialog_seekbar_background.xml +2 −2 Original line number Diff line number Diff line Loading @@ -18,8 +18,8 @@ <item android:id="@android:id/background"> <shape> <corners android:bottomRightRadius="28dp" android:topRightRadius="28dp" android:bottomRightRadius="@dimen/media_output_dialog_active_background_radius" android:topRightRadius="@dimen/media_output_dialog_active_background_radius" /> <solid android:color="@android:color/transparent" /> <size Loading packages/SystemUI/res/drawable/media_output_item_background_active.xml +1 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,6 @@ <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:radius="28dp"/> android:radius="@dimen/media_output_dialog_active_background_radius"/> <solid android:color="@color/media_dialog_item_background" /> </shape> No newline at end of file packages/SystemUI/res/layout/media_output_list_item_advanced.xml +4 −0 Original line number Diff line number Diff line Loading @@ -50,12 +50,16 @@ android:id="@+id/icon_area" android:layout_width="64dp" android:layout_height="64dp" android:focusable="false" android:importantForAccessibility="no" android:background="@drawable/media_output_title_icon_area" android:layout_gravity="center_vertical|start"> <ImageView android:id="@+id/title_icon" android:layout_width="24dp" android:layout_height="24dp" android:focusable="false" android:importantForAccessibility="no" android:animateLayoutChanges="true" android:layout_gravity="center"/> <TextView Loading packages/SystemUI/res/values/dimens.xml +1 −1 Original line number Diff line number Diff line Loading @@ -1319,7 +1319,7 @@ <dimen name="media_output_dialog_title_anim_y_delta">12.5dp</dimen> <dimen name="media_output_dialog_app_tier_icon_size">20dp</dimen> <dimen name="media_output_dialog_background_radius">16dp</dimen> <dimen name="media_output_dialog_active_background_radius">28dp</dimen> <dimen name="media_output_dialog_active_background_radius">30dp</dimen> <dimen name="media_output_dialog_default_margin_end">16dp</dimen> <dimen name="media_output_dialog_selectable_margin_end">80dp</dimen> <dimen name="media_output_dialog_list_padding_top">8dp</dimen> Loading packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseAdapter.java +33 −29 Original line number Diff line number Diff line Loading @@ -186,7 +186,6 @@ public abstract class MediaOutputBaseAdapter extends mEndTouchArea.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO); mContainerLayout.setOnClickListener(null); mContainerLayout.setContentDescription(null); mTitleIcon.setOnClickListener(null); mTitleText.setTextColor(mController.getColorItemContent()); mSubTitleText.setTextColor(mController.getColorItemContent()); mTwoLineTitleText.setTextColor(mController.getColorItemContent()); Loading Loading @@ -313,6 +312,7 @@ public abstract class MediaOutputBaseAdapter extends } mSeekBar.setMaxVolume(device.getMaxVolume()); final int currentVolume = device.getCurrentVolume(); if (!mIsDragging) { if (mSeekBar.getVolume() != currentVolume) { if (isCurrentSeekbarInvisible && !mIsInitVolumeFirstTime) { updateTitleIcon(currentVolume == 0 ? R.drawable.media_output_icon_volume_off Loading @@ -335,10 +335,12 @@ public abstract class MediaOutputBaseAdapter extends mSeekBar.resetVolume(); updateMutedVolumeIcon(); } } if (mIsInitVolumeFirstTime) { mIsInitVolumeFirstTime = false; } mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { boolean mStartFromMute = false; @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { if (device == null || !fromUser) { Loading @@ -352,11 +354,12 @@ public abstract class MediaOutputBaseAdapter extends mVolumeValueText.setText(mContext.getResources().getString( R.string.media_output_dialog_volume_percentage, percentage)); mVolumeValueText.setVisibility(View.VISIBLE); if (progressToVolume != deviceVolume) { mController.adjustVolume(device, progressToVolume); if (deviceVolume == 0) { if (mStartFromMute) { updateUnmutedVolumeIcon(); mStartFromMute = false; } if (progressToVolume != deviceVolume) { mController.adjustVolume(device, progressToVolume); } } Loading @@ -364,6 +367,9 @@ public abstract class MediaOutputBaseAdapter extends public void onStartTrackingTouch(SeekBar seekBar) { mTitleIcon.setVisibility(View.INVISIBLE); mVolumeValueText.setVisibility(View.VISIBLE); int currentVolume = MediaOutputSeekbar.scaleProgressToVolume( seekBar.getProgress()); mStartFromMute = (currentVolume == 0); mIsDragging = true; } Loading @@ -371,10 +377,7 @@ public abstract class MediaOutputBaseAdapter extends public void onStopTrackingTouch(SeekBar seekBar) { int currentVolume = MediaOutputSeekbar.scaleProgressToVolume( seekBar.getProgress()); int percentage = (int) ((double) currentVolume * VOLUME_PERCENTAGE_SCALE_SIZE / (double) seekBar.getMax()); if (percentage == 0) { if (currentVolume == 0) { seekBar.setProgress(0); updateMutedVolumeIcon(); } else { Loading Loading @@ -411,7 +414,7 @@ public abstract class MediaOutputBaseAdapter extends } void updateIconAreaClickListener(View.OnClickListener listener) { mTitleIcon.setOnClickListener(listener); mIconAreaLayout.setOnClickListener(listener); } void initMutingExpectedDevice() { Loading Loading @@ -501,14 +504,15 @@ public abstract class MediaOutputBaseAdapter extends mSeekBar.setOnTouchListener((v, event) -> false); updateIconAreaClickListener((v) -> { if (device.getCurrentVolume() == 0) { mSeekBar.setVolume(UNMUTE_DEFAULT_VOLUME); mController.adjustVolume(device, UNMUTE_DEFAULT_VOLUME); updateUnmutedVolumeIcon(); mTitleIcon.setOnTouchListener(((iconV, event) -> false)); mIconAreaLayout.setOnTouchListener(((iconV, event) -> false)); } else { mSeekBar.resetVolume(); mController.adjustVolume(device, 0); updateMutedVolumeIcon(); mTitleIcon.setOnTouchListener(((iconV, event) -> { mIconAreaLayout.setOnTouchListener(((iconV, event) -> { mSeekBar.dispatchTouchEvent(event); return false; })); Loading Loading
packages/SystemUI/res/drawable/media_output_dialog_seekbar_background.xml +2 −2 Original line number Diff line number Diff line Loading @@ -18,8 +18,8 @@ <item android:id="@android:id/background"> <shape> <corners android:bottomRightRadius="28dp" android:topRightRadius="28dp" android:bottomRightRadius="@dimen/media_output_dialog_active_background_radius" android:topRightRadius="@dimen/media_output_dialog_active_background_radius" /> <solid android:color="@android:color/transparent" /> <size Loading
packages/SystemUI/res/drawable/media_output_item_background_active.xml +1 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,6 @@ <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:radius="28dp"/> android:radius="@dimen/media_output_dialog_active_background_radius"/> <solid android:color="@color/media_dialog_item_background" /> </shape> No newline at end of file
packages/SystemUI/res/layout/media_output_list_item_advanced.xml +4 −0 Original line number Diff line number Diff line Loading @@ -50,12 +50,16 @@ android:id="@+id/icon_area" android:layout_width="64dp" android:layout_height="64dp" android:focusable="false" android:importantForAccessibility="no" android:background="@drawable/media_output_title_icon_area" android:layout_gravity="center_vertical|start"> <ImageView android:id="@+id/title_icon" android:layout_width="24dp" android:layout_height="24dp" android:focusable="false" android:importantForAccessibility="no" android:animateLayoutChanges="true" android:layout_gravity="center"/> <TextView Loading
packages/SystemUI/res/values/dimens.xml +1 −1 Original line number Diff line number Diff line Loading @@ -1319,7 +1319,7 @@ <dimen name="media_output_dialog_title_anim_y_delta">12.5dp</dimen> <dimen name="media_output_dialog_app_tier_icon_size">20dp</dimen> <dimen name="media_output_dialog_background_radius">16dp</dimen> <dimen name="media_output_dialog_active_background_radius">28dp</dimen> <dimen name="media_output_dialog_active_background_radius">30dp</dimen> <dimen name="media_output_dialog_default_margin_end">16dp</dimen> <dimen name="media_output_dialog_selectable_margin_end">80dp</dimen> <dimen name="media_output_dialog_list_padding_top">8dp</dimen> Loading
packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseAdapter.java +33 −29 Original line number Diff line number Diff line Loading @@ -186,7 +186,6 @@ public abstract class MediaOutputBaseAdapter extends mEndTouchArea.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO); mContainerLayout.setOnClickListener(null); mContainerLayout.setContentDescription(null); mTitleIcon.setOnClickListener(null); mTitleText.setTextColor(mController.getColorItemContent()); mSubTitleText.setTextColor(mController.getColorItemContent()); mTwoLineTitleText.setTextColor(mController.getColorItemContent()); Loading Loading @@ -313,6 +312,7 @@ public abstract class MediaOutputBaseAdapter extends } mSeekBar.setMaxVolume(device.getMaxVolume()); final int currentVolume = device.getCurrentVolume(); if (!mIsDragging) { if (mSeekBar.getVolume() != currentVolume) { if (isCurrentSeekbarInvisible && !mIsInitVolumeFirstTime) { updateTitleIcon(currentVolume == 0 ? R.drawable.media_output_icon_volume_off Loading @@ -335,10 +335,12 @@ public abstract class MediaOutputBaseAdapter extends mSeekBar.resetVolume(); updateMutedVolumeIcon(); } } if (mIsInitVolumeFirstTime) { mIsInitVolumeFirstTime = false; } mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { boolean mStartFromMute = false; @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { if (device == null || !fromUser) { Loading @@ -352,11 +354,12 @@ public abstract class MediaOutputBaseAdapter extends mVolumeValueText.setText(mContext.getResources().getString( R.string.media_output_dialog_volume_percentage, percentage)); mVolumeValueText.setVisibility(View.VISIBLE); if (progressToVolume != deviceVolume) { mController.adjustVolume(device, progressToVolume); if (deviceVolume == 0) { if (mStartFromMute) { updateUnmutedVolumeIcon(); mStartFromMute = false; } if (progressToVolume != deviceVolume) { mController.adjustVolume(device, progressToVolume); } } Loading @@ -364,6 +367,9 @@ public abstract class MediaOutputBaseAdapter extends public void onStartTrackingTouch(SeekBar seekBar) { mTitleIcon.setVisibility(View.INVISIBLE); mVolumeValueText.setVisibility(View.VISIBLE); int currentVolume = MediaOutputSeekbar.scaleProgressToVolume( seekBar.getProgress()); mStartFromMute = (currentVolume == 0); mIsDragging = true; } Loading @@ -371,10 +377,7 @@ public abstract class MediaOutputBaseAdapter extends public void onStopTrackingTouch(SeekBar seekBar) { int currentVolume = MediaOutputSeekbar.scaleProgressToVolume( seekBar.getProgress()); int percentage = (int) ((double) currentVolume * VOLUME_PERCENTAGE_SCALE_SIZE / (double) seekBar.getMax()); if (percentage == 0) { if (currentVolume == 0) { seekBar.setProgress(0); updateMutedVolumeIcon(); } else { Loading Loading @@ -411,7 +414,7 @@ public abstract class MediaOutputBaseAdapter extends } void updateIconAreaClickListener(View.OnClickListener listener) { mTitleIcon.setOnClickListener(listener); mIconAreaLayout.setOnClickListener(listener); } void initMutingExpectedDevice() { Loading Loading @@ -501,14 +504,15 @@ public abstract class MediaOutputBaseAdapter extends mSeekBar.setOnTouchListener((v, event) -> false); updateIconAreaClickListener((v) -> { if (device.getCurrentVolume() == 0) { mSeekBar.setVolume(UNMUTE_DEFAULT_VOLUME); mController.adjustVolume(device, UNMUTE_DEFAULT_VOLUME); updateUnmutedVolumeIcon(); mTitleIcon.setOnTouchListener(((iconV, event) -> false)); mIconAreaLayout.setOnTouchListener(((iconV, event) -> false)); } else { mSeekBar.resetVolume(); mController.adjustVolume(device, 0); updateMutedVolumeIcon(); mTitleIcon.setOnTouchListener(((iconV, event) -> { mIconAreaLayout.setOnTouchListener(((iconV, event) -> { mSeekBar.dispatchTouchEvent(event); return false; })); Loading