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

Commit cb2243cb authored by andrewxu's avatar andrewxu Committed by Andrew Xu
Browse files

Read overlay shade panel radius from XML

With this CL, the corner radius of the overlay shade panel is retrieved
from XML instead of being a code constant. This change facilitates the
subsequent CL to overwrite its value in the AL overlay.

Flag: EXEMPT refactor
Bug: 397436715
Change-Id: Iaf75deea6a6408086b14ace1e6e193fb1a0ecee9
parent 3e2aa3a1
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ import com.android.compose.animation.scene.ElementKey
import com.android.compose.animation.scene.LowestZIndexContentPicker
import com.android.compose.windowsizeclass.LocalWindowSizeClass
import com.android.systemui.res.R
import androidx.compose.ui.unit.Dp

/** Renders a lightweight shade UI container, as an overlay. */
@Composable
@@ -202,10 +203,15 @@ object OverlayShade {
    }

    object Dimensions {
        val PanelCornerRadius = 46.dp
        val PanelCornerRadius: Dp
            @Composable
            @ReadOnlyComposable get() =
                dimensionResource(R.dimen.overlay_shade_panel_shape_radius)
    }

    object Shapes {
        val RoundedCornerPanel = RoundedCornerShape(Dimensions.PanelCornerRadius)
        val RoundedCornerPanel: RoundedCornerShape
            @Composable
            @ReadOnlyComposable get() = RoundedCornerShape(Dimensions.PanelCornerRadius)
    }
}
+7 −0
Original line number Diff line number Diff line
@@ -491,6 +491,9 @@
    <!-- some constraints use a negative margin. must be aligned with overlay_border_width, above;
         overlay_border_width_neg = overlay_border_width * -1 -->
    <dimen name="overlay_border_width_neg">-4dp</dimen>
    <dimen name="overlay_shade_panel_shape_radius">
        @dimen/aux_spacing_overlay_panel_shape_radius
    </dimen>

    <dimen name="clipboard_preview_size">@dimen/overlay_x_scale</dimen>
    <dimen name="clipboard_overlay_min_font">10sp</dimen>
@@ -2215,4 +2218,8 @@
    <dimen name="rear_display_progress_width">231dp</dimen>
    <!-- Rear display mode end -->

    <!-- Spacing attributes to overwrite -->
    <dimen name="aux_spacing_overlay_panel_shape_radius">46dp</dimen>
    <!-- Spacing attributes to overwrite end -->

</resources>