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

Commit f10d9b31 authored by Anton Potapov's avatar Anton Potapov
Browse files

Add a separated flag for Volume Panel large screen

Flag: aconfig new_volume_panel STAGING
Test: manual on the phone and tablet
Bug: 325019492
Change-Id: I229d11cba32257d094079cbae222f5f17d924d15
parent a7997c13
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -51,10 +51,8 @@ fun VolumePanelComposeScope.HorizontalVolumePanelContent(
            verticalArrangement = Arrangement.spacedBy(space = spacing, alignment = Alignment.Top)
        ) {
            for (component in layout.headerComponents) {
                AnimatedVisibility(component.isVisible) {
                    with(component.component as ComposeVolumePanelUiComponent) {
                        Content(Modifier.weight(1f))
                    }
                AnimatedVisibility(visible = component.isVisible) {
                    with(component.component as ComposeVolumePanelUiComponent) { Content(Modifier) }
                }
            }
            Row(
@@ -62,9 +60,12 @@ fun VolumePanelComposeScope.HorizontalVolumePanelContent(
                horizontalArrangement = Arrangement.spacedBy(spacing),
            ) {
                for (component in layout.footerComponents) {
                    AnimatedVisibility(component.isVisible) {
                    AnimatedVisibility(
                        visible = component.isVisible,
                        modifier = Modifier.weight(1f),
                    ) {
                        with(component.component as ComposeVolumePanelUiComponent) {
                            Content(Modifier.weight(1f))
                            Content(Modifier)
                        }
                    }
                }
+6 −5
Original line number Diff line number Diff line
@@ -39,9 +39,7 @@ fun VolumePanelComposeScope.VerticalVolumePanelContent(
    ) {
        for (component in layout.headerComponents) {
            AnimatedVisibility(component.isVisible) {
                with(component.component as ComposeVolumePanelUiComponent) {
                    Content(Modifier.weight(1f))
                }
                with(component.component as ComposeVolumePanelUiComponent) { Content(Modifier) }
            }
        }
        for (component in layout.contentComponents) {
@@ -55,9 +53,12 @@ fun VolumePanelComposeScope.VerticalVolumePanelContent(
                horizontalArrangement = Arrangement.spacedBy(if (isLargeScreen) 28.dp else 20.dp),
            ) {
                for (component in layout.footerComponents) {
                    AnimatedVisibility(component.isVisible) {
                    AnimatedVisibility(
                        visible = component.isVisible,
                        modifier = Modifier.weight(1f),
                    ) {
                        with(component.component as ComposeVolumePanelUiComponent) {
                            Content(Modifier.weight(1f))
                            Content(Modifier)
                        }
                    }
                }
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ class VolumePanelComposeScope(private val state: VolumePanelState) {

    /** Is true when Volume Panel is using large-screen layout and false the otherwise. */
    val isLargeScreen: Boolean
        get() = state.isWideScreen
        get() = state.isLargeScreen
}

val VolumePanelComposeScope.isPortrait: Boolean
+3 −0
Original line number Diff line number Diff line
@@ -53,4 +53,7 @@
        <item>bottom_start:home</item>
        <item>bottom_end:create_note</item>
    </string-array>

    <!-- Whether volume panel should use the large screen layout or not -->
    <bool name="volume_panel_is_large_screen">true</bool>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -1010,4 +1010,7 @@

    <!--  Whether to use a machine learning model for back gesture falsing. -->
    <bool name="config_useBackGestureML">true</bool>

    <!-- Whether volume panel should use the large screen layout or not -->
    <bool name="volume_panel_is_large_screen">false</bool>
</resources>
Loading