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

Commit 5a7bf5a5 authored by Nikki Moteva's avatar Nikki Moteva
Browse files

System UI: Add knob to screen capture region select component

Adding a new white knob that will be placed on the corners of the region
box for the user to drag to resize the box.

Screenshot: http://screenshot/4DjZb2fSF7FBWqc

Bug: 417533606
Test: Manual
Flag: com.android.systemui.desktop_screen_capture
Change-Id: I7b7ce5b644e9141286fd61c2525ac3886c45c55d
parent 83e70fac
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -16,10 +16,12 @@

package com.android.systemui.screencapture.ui.compose

import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
@@ -39,3 +41,14 @@ fun RegionBox(width: Dp, height: Dp, modifier: Modifier = Modifier) {
        )
    }
}

/** The circular knob on each corner of the box used for dragging each corner. */
@Composable
private fun Knob(diameter: Dp, modifier: Modifier = Modifier) {
    Box(
        modifier =
            modifier
                .size(diameter)
                .background(color = MaterialTheme.colorScheme.onSurface, shape = CircleShape)
    )
}