Loading packages/SystemUI/compose/features/src/com/android/systemui/people/ui/compose/PeopleScreen.kt +7 −18 Original line number Diff line number Diff line Loading @@ -26,12 +26,12 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.safeDrawingPadding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.safeContentPadding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.verticalScroll import androidx.compose.material3.Divider import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface import androidx.compose.material3.Text Loading @@ -47,7 +47,6 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.android.compose.theme.colorAttr import com.android.systemui.compose.modifiers.sysuiResTag import com.android.systemui.people.ui.viewmodel.PeopleTileViewModel import com.android.systemui.people.ui.viewmodel.PeopleViewModel Loading Loading @@ -75,13 +74,7 @@ fun PeopleScreen(viewModel: PeopleViewModel, onResult: (PeopleViewModel.Result) } } // Make sure to use the Android colors and not the default Material3 colors to have the exact // same colors as the View implementation. Surface( color = colorAttr(com.android.internal.R.attr.colorBackground), contentColor = colorAttr(com.android.internal.R.attr.textColorPrimary), modifier = Modifier.fillMaxSize(), ) { Surface(color = MaterialTheme.colorScheme.background, modifier = Modifier.fillMaxSize()) { if (priorityTiles.isNotEmpty() || recentTiles.isNotEmpty()) { PeopleScreenWithConversations(priorityTiles, recentTiles, viewModel.onTileClicked) } else { Loading @@ -97,7 +90,7 @@ private fun PeopleScreenWithConversations( onTileClicked: (PeopleTileViewModel) -> Unit, ) { Column( Modifier.fillMaxSize().safeContentPadding().sysuiResTag("top_level_with_conversations") Modifier.fillMaxSize().safeDrawingPadding().sysuiResTag("top_level_with_conversations") ) { Column( Modifier.fillMaxWidth().padding(PeopleSpacePadding), Loading Loading @@ -151,17 +144,14 @@ private fun ConversationList( stringResource(headerTextResource), Modifier.padding(start = 16.dp), style = MaterialTheme.typography.labelLarge, color = colorAttr(com.android.internal.R.attr.colorAccentPrimaryVariant), color = MaterialTheme.colorScheme.primary, ) Spacer(Modifier.height(10.dp)) tiles.forEachIndexed { index, tile -> if (index > 0) { Divider( color = colorAttr(com.android.internal.R.attr.colorBackground), thickness = 2.dp, ) HorizontalDivider(color = MaterialTheme.colorScheme.background, thickness = 2.dp) } key(tile.key.toString()) { Loading @@ -187,8 +177,7 @@ private fun Tile( val bottomCornerRadius = if (withBottomCornerRadius) cornerRadius else 0.dp Surface( color = colorAttr(com.android.internal.R.attr.colorSurface), contentColor = colorAttr(com.android.internal.R.attr.textColorPrimary), color = MaterialTheme.colorScheme.secondaryContainer, shape = RoundedCornerShape( topStart = topCornerRadius, Loading packages/SystemUI/compose/features/src/com/android/systemui/people/ui/compose/PeopleScreenEmpty.kt +4 −15 Original line number Diff line number Diff line Loading @@ -25,12 +25,11 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.safeDrawingPadding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.safeContentPadding 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 Loading @@ -42,13 +41,12 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import com.android.compose.theme.colorAttr import com.android.systemui.res.R @Composable internal fun PeopleScreenEmpty(onGotItClicked: () -> Unit) { Column( Modifier.fillMaxSize().safeContentPadding().padding(PeopleSpacePadding), Modifier.fillMaxSize().safeDrawingPadding().padding(PeopleSpacePadding), horizontalAlignment = Alignment.CenterHorizontally, ) { Text( Loading @@ -69,15 +67,7 @@ internal fun PeopleScreenEmpty(onGotItClicked: () -> Unit) { ExampleTile() Spacer(Modifier.weight(1f)) Button( onGotItClicked, Modifier.fillMaxWidth().defaultMinSize(minHeight = 56.dp), colors = ButtonDefaults.buttonColors( containerColor = colorAttr(com.android.internal.R.attr.colorAccentPrimary), contentColor = colorAttr(com.android.internal.R.attr.textColorOnAccent), ), ) { Button(onGotItClicked, Modifier.fillMaxWidth().defaultMinSize(minHeight = 56.dp)) { Text(stringResource(R.string.got_it)) } } Loading @@ -87,8 +77,7 @@ internal fun PeopleScreenEmpty(onGotItClicked: () -> Unit) { private fun ExampleTile() { Surface( shape = RoundedCornerShape(28.dp), color = colorAttr(com.android.internal.R.attr.colorSurface), contentColor = colorAttr(com.android.internal.R.attr.textColorPrimary), color = MaterialTheme.colorScheme.secondaryContainer, ) { Row( Modifier.padding(vertical = 20.dp, horizontal = 16.dp), Loading packages/SystemUI/src/com/android/systemui/people/PeopleSpaceActivity.kt +4 −1 Original line number Diff line number Diff line Loading @@ -21,15 +21,16 @@ import android.os.Bundle import android.util.Log import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge import androidx.lifecycle.Lifecycle import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle import com.android.app.tracing.coroutines.launchTraced as launch import com.android.compose.theme.PlatformTheme import com.android.systemui.people.ui.compose.PeopleScreen import com.android.systemui.people.ui.viewmodel.PeopleViewModel import javax.inject.Inject import com.android.app.tracing.coroutines.launchTraced as launch /** People Tile Widget configuration activity that shows the user their conversation tiles. */ class PeopleSpaceActivity Loading @@ -37,6 +38,8 @@ class PeopleSpaceActivity constructor(private val viewModelFactory: PeopleViewModel.Factory) : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) enableEdgeToEdge() setResult(RESULT_CANCELED) // Update the widget ID coming from the intent. Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/people/ui/compose/PeopleScreen.kt +7 −18 Original line number Diff line number Diff line Loading @@ -26,12 +26,12 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.safeDrawingPadding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.safeContentPadding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.verticalScroll import androidx.compose.material3.Divider import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface import androidx.compose.material3.Text Loading @@ -47,7 +47,6 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.android.compose.theme.colorAttr import com.android.systemui.compose.modifiers.sysuiResTag import com.android.systemui.people.ui.viewmodel.PeopleTileViewModel import com.android.systemui.people.ui.viewmodel.PeopleViewModel Loading Loading @@ -75,13 +74,7 @@ fun PeopleScreen(viewModel: PeopleViewModel, onResult: (PeopleViewModel.Result) } } // Make sure to use the Android colors and not the default Material3 colors to have the exact // same colors as the View implementation. Surface( color = colorAttr(com.android.internal.R.attr.colorBackground), contentColor = colorAttr(com.android.internal.R.attr.textColorPrimary), modifier = Modifier.fillMaxSize(), ) { Surface(color = MaterialTheme.colorScheme.background, modifier = Modifier.fillMaxSize()) { if (priorityTiles.isNotEmpty() || recentTiles.isNotEmpty()) { PeopleScreenWithConversations(priorityTiles, recentTiles, viewModel.onTileClicked) } else { Loading @@ -97,7 +90,7 @@ private fun PeopleScreenWithConversations( onTileClicked: (PeopleTileViewModel) -> Unit, ) { Column( Modifier.fillMaxSize().safeContentPadding().sysuiResTag("top_level_with_conversations") Modifier.fillMaxSize().safeDrawingPadding().sysuiResTag("top_level_with_conversations") ) { Column( Modifier.fillMaxWidth().padding(PeopleSpacePadding), Loading Loading @@ -151,17 +144,14 @@ private fun ConversationList( stringResource(headerTextResource), Modifier.padding(start = 16.dp), style = MaterialTheme.typography.labelLarge, color = colorAttr(com.android.internal.R.attr.colorAccentPrimaryVariant), color = MaterialTheme.colorScheme.primary, ) Spacer(Modifier.height(10.dp)) tiles.forEachIndexed { index, tile -> if (index > 0) { Divider( color = colorAttr(com.android.internal.R.attr.colorBackground), thickness = 2.dp, ) HorizontalDivider(color = MaterialTheme.colorScheme.background, thickness = 2.dp) } key(tile.key.toString()) { Loading @@ -187,8 +177,7 @@ private fun Tile( val bottomCornerRadius = if (withBottomCornerRadius) cornerRadius else 0.dp Surface( color = colorAttr(com.android.internal.R.attr.colorSurface), contentColor = colorAttr(com.android.internal.R.attr.textColorPrimary), color = MaterialTheme.colorScheme.secondaryContainer, shape = RoundedCornerShape( topStart = topCornerRadius, Loading
packages/SystemUI/compose/features/src/com/android/systemui/people/ui/compose/PeopleScreenEmpty.kt +4 −15 Original line number Diff line number Diff line Loading @@ -25,12 +25,11 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.safeDrawingPadding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.safeContentPadding 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 Loading @@ -42,13 +41,12 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import com.android.compose.theme.colorAttr import com.android.systemui.res.R @Composable internal fun PeopleScreenEmpty(onGotItClicked: () -> Unit) { Column( Modifier.fillMaxSize().safeContentPadding().padding(PeopleSpacePadding), Modifier.fillMaxSize().safeDrawingPadding().padding(PeopleSpacePadding), horizontalAlignment = Alignment.CenterHorizontally, ) { Text( Loading @@ -69,15 +67,7 @@ internal fun PeopleScreenEmpty(onGotItClicked: () -> Unit) { ExampleTile() Spacer(Modifier.weight(1f)) Button( onGotItClicked, Modifier.fillMaxWidth().defaultMinSize(minHeight = 56.dp), colors = ButtonDefaults.buttonColors( containerColor = colorAttr(com.android.internal.R.attr.colorAccentPrimary), contentColor = colorAttr(com.android.internal.R.attr.textColorOnAccent), ), ) { Button(onGotItClicked, Modifier.fillMaxWidth().defaultMinSize(minHeight = 56.dp)) { Text(stringResource(R.string.got_it)) } } Loading @@ -87,8 +77,7 @@ internal fun PeopleScreenEmpty(onGotItClicked: () -> Unit) { private fun ExampleTile() { Surface( shape = RoundedCornerShape(28.dp), color = colorAttr(com.android.internal.R.attr.colorSurface), contentColor = colorAttr(com.android.internal.R.attr.textColorPrimary), color = MaterialTheme.colorScheme.secondaryContainer, ) { Row( Modifier.padding(vertical = 20.dp, horizontal = 16.dp), Loading
packages/SystemUI/src/com/android/systemui/people/PeopleSpaceActivity.kt +4 −1 Original line number Diff line number Diff line Loading @@ -21,15 +21,16 @@ import android.os.Bundle import android.util.Log import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge import androidx.lifecycle.Lifecycle import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle import com.android.app.tracing.coroutines.launchTraced as launch import com.android.compose.theme.PlatformTheme import com.android.systemui.people.ui.compose.PeopleScreen import com.android.systemui.people.ui.viewmodel.PeopleViewModel import javax.inject.Inject import com.android.app.tracing.coroutines.launchTraced as launch /** People Tile Widget configuration activity that shows the user their conversation tiles. */ class PeopleSpaceActivity Loading @@ -37,6 +38,8 @@ class PeopleSpaceActivity constructor(private val viewModelFactory: PeopleViewModel.Factory) : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) enableEdgeToEdge() setResult(RESULT_CANCELED) // Update the widget ID coming from the intent. Loading