Loading packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java +7 −4 Original line number Diff line number Diff line Loading @@ -257,16 +257,18 @@ public class MediaControlPanel { rect.setColor(Color.TRANSPARENT); final MediaDeviceData device = data.getDevice(); int seamlessId = mViewHolder.getSeamless().getId(); if (device != null && !device.getEnabled()) { mViewHolder.getSeamless().setEnabled(false); // TODO(b/156875717): setEnabled should cause the alpha to change. mViewHolder.getSeamless().setAlpha(0.38f); expandedSet.setAlpha(seamlessId, 0.38f); collapsedSet.setAlpha(seamlessId, 0.38f); iconView.setImageResource(R.drawable.ic_hardware_speaker); iconView.setVisibility(View.VISIBLE); deviceName.setText(R.string.media_seamless_remote_device); } else if (device != null) { mViewHolder.getSeamless().setEnabled(true); mViewHolder.getSeamless().setAlpha(1f); expandedSet.setAlpha(seamlessId, 1.0f); collapsedSet.setAlpha(seamlessId, 1.0f); Drawable icon = device.getIcon(); iconView.setVisibility(View.VISIBLE); Loading @@ -282,7 +284,8 @@ public class MediaControlPanel { // Reset to default Log.w(TAG, "device is null. Not binding output chip."); mViewHolder.getSeamless().setEnabled(true); mViewHolder.getSeamless().setAlpha(1f); expandedSet.setAlpha(seamlessId, 1.0f); collapsedSet.setAlpha(seamlessId, 1.0f); iconView.setVisibility(View.GONE); deviceName.setText(com.android.internal.R.string.ext_media_seamless_action); } Loading packages/SystemUI/src/com/android/systemui/util/animation/TransitionLayout.kt +4 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ class TransitionLayout @JvmOverloads constructor( ) : ConstraintLayout(context, attrs, defStyleAttr) { private val originalGoneChildrenSet: MutableSet<Int> = mutableSetOf() private val originalViewAlphas: MutableMap<Int, Float> = mutableMapOf() private var measureAsConstraint: Boolean = false private var currentState: TransitionViewState = TransitionViewState() private var updateScheduled = false Loading Loading @@ -67,6 +68,7 @@ class TransitionLayout @JvmOverloads constructor( if (child.visibility == GONE) { originalGoneChildrenSet.add(child.id) } originalViewAlphas[child.id] = child.alpha } } Loading Loading @@ -198,6 +200,8 @@ class TransitionLayout @JvmOverloads constructor( if (originalGoneChildrenSet.contains(child.id)) { child.visibility = View.GONE } // Reset the alphas, to only have the alphas present from the constraintset child.alpha = originalViewAlphas[child.id] ?: 1.0f } // Let's now apply the constraintSet to get the full state constraintSet.applyTo(this) Loading Loading
packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java +7 −4 Original line number Diff line number Diff line Loading @@ -257,16 +257,18 @@ public class MediaControlPanel { rect.setColor(Color.TRANSPARENT); final MediaDeviceData device = data.getDevice(); int seamlessId = mViewHolder.getSeamless().getId(); if (device != null && !device.getEnabled()) { mViewHolder.getSeamless().setEnabled(false); // TODO(b/156875717): setEnabled should cause the alpha to change. mViewHolder.getSeamless().setAlpha(0.38f); expandedSet.setAlpha(seamlessId, 0.38f); collapsedSet.setAlpha(seamlessId, 0.38f); iconView.setImageResource(R.drawable.ic_hardware_speaker); iconView.setVisibility(View.VISIBLE); deviceName.setText(R.string.media_seamless_remote_device); } else if (device != null) { mViewHolder.getSeamless().setEnabled(true); mViewHolder.getSeamless().setAlpha(1f); expandedSet.setAlpha(seamlessId, 1.0f); collapsedSet.setAlpha(seamlessId, 1.0f); Drawable icon = device.getIcon(); iconView.setVisibility(View.VISIBLE); Loading @@ -282,7 +284,8 @@ public class MediaControlPanel { // Reset to default Log.w(TAG, "device is null. Not binding output chip."); mViewHolder.getSeamless().setEnabled(true); mViewHolder.getSeamless().setAlpha(1f); expandedSet.setAlpha(seamlessId, 1.0f); collapsedSet.setAlpha(seamlessId, 1.0f); iconView.setVisibility(View.GONE); deviceName.setText(com.android.internal.R.string.ext_media_seamless_action); } Loading
packages/SystemUI/src/com/android/systemui/util/animation/TransitionLayout.kt +4 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ class TransitionLayout @JvmOverloads constructor( ) : ConstraintLayout(context, attrs, defStyleAttr) { private val originalGoneChildrenSet: MutableSet<Int> = mutableSetOf() private val originalViewAlphas: MutableMap<Int, Float> = mutableMapOf() private var measureAsConstraint: Boolean = false private var currentState: TransitionViewState = TransitionViewState() private var updateScheduled = false Loading Loading @@ -67,6 +68,7 @@ class TransitionLayout @JvmOverloads constructor( if (child.visibility == GONE) { originalGoneChildrenSet.add(child.id) } originalViewAlphas[child.id] = child.alpha } } Loading Loading @@ -198,6 +200,8 @@ class TransitionLayout @JvmOverloads constructor( if (originalGoneChildrenSet.contains(child.id)) { child.visibility = View.GONE } // Reset the alphas, to only have the alphas present from the constraintset child.alpha = originalViewAlphas[child.id] ?: 1.0f } // Let's now apply the constraintSet to get the full state constraintSet.applyTo(this) Loading