Loading packages/SystemUI/res/layout/volume_dialog_slider.xml +3 −2 Original line number Diff line number Diff line Loading @@ -14,8 +14,9 @@ limitations under the License. --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="@dimen/volume_dialog_slider_width" android:layout_height="@dimen/volume_dialog_slider_height"> android:layout_width="0dp" android:layout_height="0dp" android:maxHeight="@dimen/volume_dialog_slider_height"> <com.google.android.material.slider.Slider android:id="@+id/volume_dialog_slider" Loading packages/SystemUI/res/values/dimens.xml +5 −0 Original line number Diff line number Diff line Loading @@ -2116,6 +2116,11 @@ <dimen name="volume_dialog_button_size">40dp</dimen> <dimen name="volume_dialog_slider_width">52dp</dimen> <dimen name="volume_dialog_slider_height">254dp</dimen> <!-- A primary goal of this margin is to vertically constraint slider height in the landscape orientation when the vertical space is limited --> <dimen name="volume_dialog_slider_vertical_margin">124dp</dimen> <fraction name="volume_dialog_half_opened_bias">0.2</fraction> Loading packages/SystemUI/res/xml/volume_dialog_constraint_set.xml +4 −1 Original line number Diff line number Diff line Loading @@ -6,10 +6,13 @@ <Constraint android:id="@id/volume_dialog_main_slider_container" android:layout_width="@dimen/volume_dialog_slider_width" android:layout_height="@dimen/volume_dialog_slider_height" android:layout_height="0dp" android:layout_marginTop="@dimen/volume_dialog_slider_vertical_margin" android:layout_marginEnd="@dimen/volume_dialog_components_spacing" android:layout_marginBottom="@dimen/volume_dialog_slider_vertical_margin" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHeight_max="@dimen/volume_dialog_slider_height" app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="0.5" /> </ConstraintSet> No newline at end of file packages/SystemUI/res/xml/volume_dialog_half_folded_constraint_set.xml +4 −1 Original line number Diff line number Diff line Loading @@ -6,10 +6,13 @@ <Constraint android:id="@id/volume_dialog_main_slider_container" android:layout_width="@dimen/volume_dialog_slider_width" android:layout_height="@dimen/volume_dialog_slider_height" android:layout_height="0dp" android:layout_marginTop="@dimen/volume_dialog_slider_vertical_margin" android:layout_marginEnd="@dimen/volume_dialog_components_spacing" android:layout_marginBottom="@dimen/volume_dialog_slider_vertical_margin" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHeight_max="@dimen/volume_dialog_slider_height" app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="@fraction/volume_dialog_half_opened_bias" /> </ConstraintSet> No newline at end of file packages/SystemUI/src/com/android/systemui/volume/dialog/ui/binder/VolumeDialogViewBinder.kt +31 −30 Original line number Diff line number Diff line Loading @@ -24,11 +24,15 @@ import android.view.View import android.view.ViewGroup import android.view.ViewTreeObserver import android.view.ViewTreeObserver.InternalInsetsInfo import android.view.WindowInsets import androidx.constraintlayout.motion.widget.MotionLayout import androidx.core.view.updatePadding import com.android.internal.view.RotationPolicy import com.android.systemui.common.ui.view.onApplyWindowInsets import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.res.R import com.android.systemui.util.children import com.android.systemui.util.kotlin.awaitCancellationThenDispose import com.android.systemui.volume.SystemUIInterpolators import com.android.systemui.volume.dialog.dagger.scope.VolumeDialogScope import com.android.systemui.volume.dialog.ringer.ui.binder.VolumeDialogRingerViewBinder Loading @@ -43,6 +47,7 @@ import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.mapLatest import kotlinx.coroutines.flow.onEach Loading Loading @@ -71,6 +76,8 @@ constructor( resources.getInteger(R.integer.config_dialogHideAnimationDurationMs).toLong() fun CoroutineScope.bind(dialog: Dialog) { val insets: MutableStateFlow<WindowInsets> = MutableStateFlow(WindowInsets.Builder().build()) // Root view of the Volume Dialog. val root: MotionLayout = dialog.requireViewById(R.id.volume_dialog_root) root.alpha = 0f Loading @@ -88,6 +95,22 @@ constructor( launch { root.viewTreeObserver.computeInternalInsetsListener(root) } launch { root .onApplyWindowInsets { v, newInsets -> val insetsValues = newInsets.getInsets(WindowInsets.Type.displayCutout()) v.updatePadding( left = insetsValues.left, top = insetsValues.top, right = insetsValues.right, bottom = insetsValues.bottom, ) insets.value = newInsets WindowInsets.CONSUMED } .awaitCancellationThenDispose() } with(volumeDialogRingerViewBinder) { bind(root) } with(slidersViewBinder) { bind(root) } with(settingsButtonViewBinder) { bind(root) } Loading @@ -103,8 +126,10 @@ constructor( when (it) { is VolumeDialogVisibilityModel.Visible -> { tracer.traceVisibilityEnd(it) calculateTranslationX(view)?.let(view::setTranslationX) view.animateShow(dialogShowAnimationDurationMs) view.animateShow( duration = dialogShowAnimationDurationMs, translationX = calculateTranslationX(view), ) } is VolumeDialogVisibilityModel.Dismissed -> { tracer.traceVisibilityEnd(it) Loading Loading @@ -134,24 +159,15 @@ constructor( } } private suspend fun View.animateShow(duration: Long) { private suspend fun View.animateShow(duration: Long, translationX: Float?) { translationX?.let { setTranslationX(translationX) } alpha = 0f animate() .alpha(1f) .translationX(0f) .setDuration(duration) .setInterpolator(SystemUIInterpolators.LogDecelerateInterpolator()) .suspendAnimate(jankListenerFactory.show(this, duration)) /* TODO(b/369993851) .withEndAction(Runnable { if (!Prefs.getBoolean(mContext, Prefs.Key.TOUCHED_RINGER_TOGGLE, false)) { if (mRingerIcon != null) { mRingerIcon.postOnAnimationDelayed( getSinglePressFor(mRingerIcon), 1500 ) } } }) */ } private suspend fun View.animateHide(duration: Long, translationX: Float?) { Loading @@ -160,22 +176,7 @@ constructor( .alpha(0f) .setDuration(duration) .setInterpolator(SystemUIInterpolators.LogAccelerateInterpolator()) /* TODO(b/369993851) .withEndAction( Runnable { mHandler.postDelayed( Runnable { hideRingerDrawer() }, 50 ) } ) */ if (translationX != null) { animator.translationX(translationX) } translationX?.let { animator.translationX(it) } animator.suspendAnimate(jankListenerFactory.dismiss(this, duration)) } Loading packages/SystemUI/res/layout/volume_dialog.xml +1 −1 File changed.Contains only whitespace changes. Show changes Loading
packages/SystemUI/res/layout/volume_dialog_slider.xml +3 −2 Original line number Diff line number Diff line Loading @@ -14,8 +14,9 @@ limitations under the License. --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="@dimen/volume_dialog_slider_width" android:layout_height="@dimen/volume_dialog_slider_height"> android:layout_width="0dp" android:layout_height="0dp" android:maxHeight="@dimen/volume_dialog_slider_height"> <com.google.android.material.slider.Slider android:id="@+id/volume_dialog_slider" Loading
packages/SystemUI/res/values/dimens.xml +5 −0 Original line number Diff line number Diff line Loading @@ -2116,6 +2116,11 @@ <dimen name="volume_dialog_button_size">40dp</dimen> <dimen name="volume_dialog_slider_width">52dp</dimen> <dimen name="volume_dialog_slider_height">254dp</dimen> <!-- A primary goal of this margin is to vertically constraint slider height in the landscape orientation when the vertical space is limited --> <dimen name="volume_dialog_slider_vertical_margin">124dp</dimen> <fraction name="volume_dialog_half_opened_bias">0.2</fraction> Loading
packages/SystemUI/res/xml/volume_dialog_constraint_set.xml +4 −1 Original line number Diff line number Diff line Loading @@ -6,10 +6,13 @@ <Constraint android:id="@id/volume_dialog_main_slider_container" android:layout_width="@dimen/volume_dialog_slider_width" android:layout_height="@dimen/volume_dialog_slider_height" android:layout_height="0dp" android:layout_marginTop="@dimen/volume_dialog_slider_vertical_margin" android:layout_marginEnd="@dimen/volume_dialog_components_spacing" android:layout_marginBottom="@dimen/volume_dialog_slider_vertical_margin" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHeight_max="@dimen/volume_dialog_slider_height" app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="0.5" /> </ConstraintSet> No newline at end of file
packages/SystemUI/res/xml/volume_dialog_half_folded_constraint_set.xml +4 −1 Original line number Diff line number Diff line Loading @@ -6,10 +6,13 @@ <Constraint android:id="@id/volume_dialog_main_slider_container" android:layout_width="@dimen/volume_dialog_slider_width" android:layout_height="@dimen/volume_dialog_slider_height" android:layout_height="0dp" android:layout_marginTop="@dimen/volume_dialog_slider_vertical_margin" android:layout_marginEnd="@dimen/volume_dialog_components_spacing" android:layout_marginBottom="@dimen/volume_dialog_slider_vertical_margin" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHeight_max="@dimen/volume_dialog_slider_height" app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="@fraction/volume_dialog_half_opened_bias" /> </ConstraintSet> No newline at end of file
packages/SystemUI/src/com/android/systemui/volume/dialog/ui/binder/VolumeDialogViewBinder.kt +31 −30 Original line number Diff line number Diff line Loading @@ -24,11 +24,15 @@ import android.view.View import android.view.ViewGroup import android.view.ViewTreeObserver import android.view.ViewTreeObserver.InternalInsetsInfo import android.view.WindowInsets import androidx.constraintlayout.motion.widget.MotionLayout import androidx.core.view.updatePadding import com.android.internal.view.RotationPolicy import com.android.systemui.common.ui.view.onApplyWindowInsets import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.res.R import com.android.systemui.util.children import com.android.systemui.util.kotlin.awaitCancellationThenDispose import com.android.systemui.volume.SystemUIInterpolators import com.android.systemui.volume.dialog.dagger.scope.VolumeDialogScope import com.android.systemui.volume.dialog.ringer.ui.binder.VolumeDialogRingerViewBinder Loading @@ -43,6 +47,7 @@ import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.mapLatest import kotlinx.coroutines.flow.onEach Loading Loading @@ -71,6 +76,8 @@ constructor( resources.getInteger(R.integer.config_dialogHideAnimationDurationMs).toLong() fun CoroutineScope.bind(dialog: Dialog) { val insets: MutableStateFlow<WindowInsets> = MutableStateFlow(WindowInsets.Builder().build()) // Root view of the Volume Dialog. val root: MotionLayout = dialog.requireViewById(R.id.volume_dialog_root) root.alpha = 0f Loading @@ -88,6 +95,22 @@ constructor( launch { root.viewTreeObserver.computeInternalInsetsListener(root) } launch { root .onApplyWindowInsets { v, newInsets -> val insetsValues = newInsets.getInsets(WindowInsets.Type.displayCutout()) v.updatePadding( left = insetsValues.left, top = insetsValues.top, right = insetsValues.right, bottom = insetsValues.bottom, ) insets.value = newInsets WindowInsets.CONSUMED } .awaitCancellationThenDispose() } with(volumeDialogRingerViewBinder) { bind(root) } with(slidersViewBinder) { bind(root) } with(settingsButtonViewBinder) { bind(root) } Loading @@ -103,8 +126,10 @@ constructor( when (it) { is VolumeDialogVisibilityModel.Visible -> { tracer.traceVisibilityEnd(it) calculateTranslationX(view)?.let(view::setTranslationX) view.animateShow(dialogShowAnimationDurationMs) view.animateShow( duration = dialogShowAnimationDurationMs, translationX = calculateTranslationX(view), ) } is VolumeDialogVisibilityModel.Dismissed -> { tracer.traceVisibilityEnd(it) Loading Loading @@ -134,24 +159,15 @@ constructor( } } private suspend fun View.animateShow(duration: Long) { private suspend fun View.animateShow(duration: Long, translationX: Float?) { translationX?.let { setTranslationX(translationX) } alpha = 0f animate() .alpha(1f) .translationX(0f) .setDuration(duration) .setInterpolator(SystemUIInterpolators.LogDecelerateInterpolator()) .suspendAnimate(jankListenerFactory.show(this, duration)) /* TODO(b/369993851) .withEndAction(Runnable { if (!Prefs.getBoolean(mContext, Prefs.Key.TOUCHED_RINGER_TOGGLE, false)) { if (mRingerIcon != null) { mRingerIcon.postOnAnimationDelayed( getSinglePressFor(mRingerIcon), 1500 ) } } }) */ } private suspend fun View.animateHide(duration: Long, translationX: Float?) { Loading @@ -160,22 +176,7 @@ constructor( .alpha(0f) .setDuration(duration) .setInterpolator(SystemUIInterpolators.LogAccelerateInterpolator()) /* TODO(b/369993851) .withEndAction( Runnable { mHandler.postDelayed( Runnable { hideRingerDrawer() }, 50 ) } ) */ if (translationX != null) { animator.translationX(translationX) } translationX?.let { animator.translationX(it) } animator.suspendAnimate(jankListenerFactory.dismiss(this, duration)) } Loading
packages/SystemUI/res/layout/volume_dialog.xml +1 −1 File changed.Contains only whitespace changes. Show changes