Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3274fdf1 authored by Anton Potapov's avatar Anton Potapov
Browse files

Refactor the new Volume Dialog a bit to accomodate Android TV

Android TV needs different set of components for their Volume Dialog to
maintain previous UI. These changes make the Volume Dialog more modular
to allow those components

Flag: com.android.systemui.volume_redesign
Bug: 387284759
Test: manual on foldable. Observe the Volume Dialog appearance
Test: atest VolumeDialogScreenshotTest
Change-Id: I093c48f641501cd2d2109fb5908183d1a7a01a7b
parent 1c72035d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@
        android:layout_marginBottom="@dimen/volume_dialog_components_spacing"
        android:clipChildren="false"
        app:layout_constraintBottom_toTopOf="@id/volume_dialog_main_slider_container"
        app:layout_constraintEnd_toEndOf="@id/volume_dialog_main_slider_container"
        app:layout_constraintEnd_toEndOf="@id/volume_dialog_background"
        app:layout_constraintHeight_default="spread"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
@@ -70,9 +70,9 @@
        android:layout_marginTop="@dimen/volume_dialog_components_spacing"
        android:clipChildren="false"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="@id/volume_dialog_main_slider_container"
        app:layout_constraintEnd_toEndOf="@id/volume_dialog_background"
        app:layout_constraintHeight_default="wrap"
        app:layout_constraintStart_toStartOf="@id/volume_dialog_main_slider_container"
        app:layout_constraintStart_toStartOf="@id/volume_dialog_background"
        app:layout_constraintTop_toBottomOf="@id/volume_dialog_main_slider_container"
        app:layout_constraintVertical_bias="0"
        app:layout_constraintWidth_default="wrap">
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
    android:clipChildren="false"
    android:clipToPadding="false"
    android:gravity="center"
    android:paddingEnd="@dimen/volume_dialog_ringer_drawer_diff_end_margin"
    android:paddingEnd="@dimen/volume_dialog_buttons_margin"
    app:layoutDescription="@xml/volume_dialog_ringer_drawer_motion_scene">

    <View
+0 −5
Original line number Diff line number Diff line
@@ -2189,11 +2189,6 @@
    <dimen name="volume_dialog_background_square_corner_radius">12dp</dimen>

    <dimen name="volume_dialog_ringer_drawer_margin">@dimen/volume_dialog_buttons_margin</dimen>
    <!--
     (volume_dialog_slider_width - volume_dialog_button_size) / 2
     This centers ringer drawer against the volume slider
    -->
    <dimen name="volume_dialog_ringer_drawer_diff_end_margin">6dp</dimen>
    <dimen name="volume_dialog_ringer_drawer_button_size">@dimen/volume_dialog_button_size</dimen>
    <dimen name="volume_dialog_ringer_drawer_button_icon_radius">10dp</dimen>
    <dimen name="volume_dialog_ringer_selected_button_background_radius">20dp</dimen>
+2 −2
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.lifecycle.repeatWhenAttached
import com.android.systemui.res.R
import com.android.systemui.volume.Events
import com.android.systemui.volume.dialog.dagger.VolumeDialogComponent
import com.android.systemui.volume.dialog.dagger.factory.VolumeDialogComponentFactory
import com.android.systemui.volume.dialog.domain.interactor.VolumeDialogVisibilityInteractor
import javax.inject.Inject
import kotlinx.coroutines.awaitCancellation
@@ -37,7 +37,7 @@ class VolumeDialog
@Inject
constructor(
    @Application context: Context,
    private val componentFactory: VolumeDialogComponent.Factory,
    private val componentFactory: VolumeDialogComponentFactory,
    private val visibilityInteractor: VolumeDialogVisibilityInteractor,
) : ComponentDialog(context, R.style.Theme_SystemUI_Dialog_Volume) {

+3 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.volume.dialog.dagger

import com.android.systemui.volume.dialog.dagger.factory.VolumeDialogComponentFactory
import com.android.systemui.volume.dialog.dagger.module.VolumeDialogModule
import com.android.systemui.volume.dialog.dagger.scope.VolumeDialog
import com.android.systemui.volume.dialog.dagger.scope.VolumeDialogScope
@@ -38,9 +39,9 @@ interface VolumeDialogComponent {
    fun sliderComponentFactory(): VolumeDialogSliderComponent.Factory

    @Subcomponent.Factory
    interface Factory {
    interface Factory : VolumeDialogComponentFactory {

        fun create(
        override fun create(
            /**
             * Provides a coroutine scope to use inside [VolumeDialogScope].
             * [com.android.systemui.volume.dialog.VolumeDialogPlugin] manages the lifecycle of this
Loading