Loading packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt +18 −12 Original line number Diff line number Diff line Loading @@ -969,6 +969,8 @@ private fun WidgetContent( val clickActionLabel = stringResource(R.string.accessibility_action_label_select_widget) val removeWidgetActionLabel = stringResource(R.string.accessibility_action_label_remove_widget) val placeWidgetActionLabel = stringResource(R.string.accessibility_action_label_place_widget) val unselectWidgetActionLabel = stringResource(R.string.accessibility_action_label_unselect_widget) val selectedKey by viewModel.selectedKey.collectAsStateWithLifecycle() val selectedIndex = selectedKey?.let { key -> contentListState.list.indexOfFirst { it.key == key } } Loading Loading @@ -1009,18 +1011,7 @@ private fun WidgetContent( contentListState.onSaveList() true } val selectWidgetAction = CustomAccessibilityAction(clickActionLabel) { val currentWidgetKey = index?.let { keyAtIndexIfEditable(contentListState.list, index) } viewModel.setSelectedKey(currentWidgetKey) true } val actions = mutableListOf(selectWidgetAction, deleteAction) val actions = mutableListOf(deleteAction) if (selectedIndex != null && selectedIndex != index) { actions.add( CustomAccessibilityAction(placeWidgetActionLabel) { Loading @@ -1032,6 +1023,21 @@ private fun WidgetContent( ) } if (!selected) { actions.add( CustomAccessibilityAction(clickActionLabel) { viewModel.setSelectedKey(model.key) true } ) } else { actions.add( CustomAccessibilityAction(unselectWidgetActionLabel) { viewModel.setSelectedKey(null) true } ) } customActions = actions } } Loading packages/SystemUI/res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -1249,6 +1249,8 @@ <string name="communal_widget_picker_title">Lock screen widgets</string> <!-- Text displayed below the title in the communal widget picker providing additional details about the communal surface. [CHAR LIMIT=80] --> <string name="communal_widget_picker_description">Anyone can view widgets on your lock screen, even if your tablet\'s locked.</string> <!-- Label for accessibility action to unselect a widget in edit mode. [CHAR LIMIT=NONE] --> <string name="accessibility_action_label_unselect_widget">unselect widget</string> <!-- Title shown above information regarding lock screen widgets. [CHAR LIMIT=50] --> <string name="communal_widgets_disclaimer_title">Lock screen widgets</string> <!-- Information about lock screen widgets presented to the user. [CHAR LIMIT=NONE] --> Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt +18 −12 Original line number Diff line number Diff line Loading @@ -969,6 +969,8 @@ private fun WidgetContent( val clickActionLabel = stringResource(R.string.accessibility_action_label_select_widget) val removeWidgetActionLabel = stringResource(R.string.accessibility_action_label_remove_widget) val placeWidgetActionLabel = stringResource(R.string.accessibility_action_label_place_widget) val unselectWidgetActionLabel = stringResource(R.string.accessibility_action_label_unselect_widget) val selectedKey by viewModel.selectedKey.collectAsStateWithLifecycle() val selectedIndex = selectedKey?.let { key -> contentListState.list.indexOfFirst { it.key == key } } Loading Loading @@ -1009,18 +1011,7 @@ private fun WidgetContent( contentListState.onSaveList() true } val selectWidgetAction = CustomAccessibilityAction(clickActionLabel) { val currentWidgetKey = index?.let { keyAtIndexIfEditable(contentListState.list, index) } viewModel.setSelectedKey(currentWidgetKey) true } val actions = mutableListOf(selectWidgetAction, deleteAction) val actions = mutableListOf(deleteAction) if (selectedIndex != null && selectedIndex != index) { actions.add( CustomAccessibilityAction(placeWidgetActionLabel) { Loading @@ -1032,6 +1023,21 @@ private fun WidgetContent( ) } if (!selected) { actions.add( CustomAccessibilityAction(clickActionLabel) { viewModel.setSelectedKey(model.key) true } ) } else { actions.add( CustomAccessibilityAction(unselectWidgetActionLabel) { viewModel.setSelectedKey(null) true } ) } customActions = actions } } Loading
packages/SystemUI/res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -1249,6 +1249,8 @@ <string name="communal_widget_picker_title">Lock screen widgets</string> <!-- Text displayed below the title in the communal widget picker providing additional details about the communal surface. [CHAR LIMIT=80] --> <string name="communal_widget_picker_description">Anyone can view widgets on your lock screen, even if your tablet\'s locked.</string> <!-- Label for accessibility action to unselect a widget in edit mode. [CHAR LIMIT=NONE] --> <string name="accessibility_action_label_unselect_widget">unselect widget</string> <!-- Title shown above information regarding lock screen widgets. [CHAR LIMIT=50] --> <string name="communal_widgets_disclaimer_title">Lock screen widgets</string> <!-- Information about lock screen widgets presented to the user. [CHAR LIMIT=NONE] --> Loading