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

Commit 1f051734 authored by minch's avatar minch
Browse files

Add share screen privacy indicator pop up

Screenshots: b/437918357#comment3

Bug: 437918357
Flag: com.android.systemui.status_bar_popup_chips
Test: m
Change-Id: Id52fe77f6062d169d21a5cf34b53aa93ac7c3002
parent 7c005061
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -437,6 +437,9 @@
    <!-- Text shown beneath partial screenshot region displaying the dimensions (width and height) of the area to be captured. [CHAR LIMIT=NONE] [SCREENSHOT=screen/7ytguTQdu3cEn4f] -->
    <string name="screen_capture_region_dimensions"><xliff:g example="210" id="width">%1$d</xliff:g> x <xliff:g example="129" id="height">%2$d</xliff:g></string>

    <!-- Text of the button popup on the share screen privacy indicator to stop screen sharing. -->
    <string name="screen_share_privacy_indicator_stop_sharing">Stop sharing</string>

    <!-- Content description for the status bar chip shown to the user when they're sharing their screen to another app on the device [CHAR LIMIT=NONE] -->
    <string name="share_to_app_chip_accessibility_label">Sharing screen</string>
    <!-- Content description for the status bar chip shown to the user when they're sharing their screen or audio to another app on the device [CHAR LIMIT=NONE] -->
+2 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalView
@@ -56,6 +57,7 @@ fun StatusBarPopup(
) {
    val density = Density(LocalContext.current)
    Popup(
        alignment = Alignment.TopCenter,
        properties =
            PopupProperties(
                focusable = false,
+36 −2
Original line number Diff line number Diff line
@@ -16,11 +16,45 @@

package com.android.systemui.statusbar.featurepods.sharescreen.ui.compose

import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.android.systemui.res.R

@Composable
fun ShareScreenPrivacyIndicatorPopup() {
    // TODO(b/437918357) Add the pop up button and end the screen sharing session on clicking it.
    Text("Share Screen Privacy Indicator Popup")
    Surface(
        shape = RoundedCornerShape(28.dp),
        color = MaterialTheme.colorScheme.surfaceBright,
        shadowElevation = 2.dp,
        modifier = Modifier.size(width = 129.dp, height = 56.dp),
    ) {
        Button(
            onClick = { /* TODO(b/440627312): End screen sharing session */ },
            shape = RoundedCornerShape(20.dp), // Outer radius (28) - border (8)
            modifier = Modifier.fillMaxSize().padding(8.dp),
            contentPadding = PaddingValues(0.dp),
            colors =
                ButtonDefaults.buttonColors(
                    containerColor = MaterialTheme.colorScheme.error,
                    contentColor = MaterialTheme.colorScheme.onError,
                ),
        ) {
            Text(
                text = stringResource(R.string.screen_share_privacy_indicator_stop_sharing),
                softWrap = false,
            )
        }
    }
}