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

Commit 69a24144 authored by Cam Bickel's avatar Cam Bickel Committed by Camden Bickel
Browse files

Screen capture: Add region box composable

This CL adds the RegionBox composable to the PreCaptureUI to make it
easier to iterate on the partial screenshot UI. This CL also adds a stub
to update the region state in the viewmodel.

Bug: 432039382
Test: Manual
Flag: com.android.systemui.desktop_screen_capture
Change-Id: I6d57493010b26f6e6f3f37e63b8b53213c032162
parent 720941f3
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -65,7 +65,13 @@ fun PreCaptureUI(viewModel: PreCaptureViewModel) {
                }
            }
            ScreenCaptureRegion.PARTIAL -> {
                // TODO(b/422834671) If the capture region is PARTIAL, add region box here.
                // TODO(b/427541309) Set the initial width and height of the RegionBox based on the
                // viewmodel state.
                RegionBox(
                    initialWidth = 100.dp,
                    initialHeight = 100.dp,
                    onDragEnd = viewModel::onPartialRegionDragEnd,
                )
            }
            ScreenCaptureRegion.APP_WINDOW -> {}
        }
+6 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
package com.android.systemui.screencapture.record.largescreen.ui.viewmodel

import android.content.Context
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.unit.Dp
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.lifecycle.HydratedActivatable
@@ -100,6 +102,10 @@ constructor(
        // TODO(b/427500006) Close the window after requesting a fullscreen screenshot.
    }

    fun onPartialRegionDragEnd(offset: Offset, width: Dp, height: Dp) {
        // TODO(b/427541309) Update region box position and size.
    }

    override suspend fun onActivated() {
        coroutineScope { launch { iconProvider.collectIcons() } }
    }