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

Commit e7725065 authored by Iavor-Valentin Iftime's avatar Iavor-Valentin Iftime Committed by Android (Google) Code Review
Browse files

Merge "Add notification count contentDescription to BundleHeader" into main

parents c205e0bb c842f26e
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import androidx.compose.ui.layout.Layout
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.collapse
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.dismiss
import androidx.compose.ui.semantics.expand
import androidx.compose.ui.semantics.semantics
@@ -236,7 +237,10 @@ private fun ContentScope.BundleHeaderContent(
        ExpansionControl(
            collapsed = collapsed,
            numberToShow = viewModel.numberOfChildren,
            modifier = Modifier.padding(start = 8.dp, end = 16.dp),
            modifier =
                Modifier.padding(start = 8.dp, end = 16.dp).semantics(mergeDescendants = false) {
                    contentDescription = viewModel.numberOfChildrenContentDescription
                },
        )
    }
}
+6 −0
Original line number Diff line number Diff line
@@ -2183,6 +2183,12 @@
    <!--  Notification bundles onboarding affordance  [CHAR LIMIT=NONE]-->
    <string name="notification_onboarding_bundles_message">Notification organizer bundles and silences lower priority notifications</string>

    <!-- Number of notifications for bundles header [CHAR LIMIT=NONE] -->
    <string name="notification_bundle_header_counter">{count, plural,
        =1 {# notification}
        other {# notifications}
    }</string>

    <!-- Notification Inline controls: button to dismiss the blocking helper [CHAR_LIMIT=20] -->
    <string name="inline_done_button">Done</string>

+10 −0
Original line number Diff line number Diff line
@@ -27,10 +27,12 @@ import com.android.compose.animation.scene.MutableSceneTransitionLayoutState
import com.android.compose.animation.scene.SceneKey
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.notifications.ui.composable.row.BundleHeader
import com.android.systemui.res.R
import com.android.systemui.statusbar.notification.row.dagger.BundleRowScope
import com.android.systemui.statusbar.notification.row.data.model.AppData
import com.android.systemui.statusbar.notification.row.data.repository.BundleRepository
import com.android.systemui.statusbar.notification.row.icon.AppIconProvider
import com.android.systemui.util.icuMessageFormat
import com.android.systemui.util.time.SystemClock
import com.android.systemui.utils.coroutines.flow.mapLatestConflated
import javax.inject.Inject
@@ -62,6 +64,14 @@ constructor(
    val bundleIcon: Int
        get() = repository.bundleIcon

    val numberOfChildrenContentDescription: String
        get() =
            icuMessageFormat(
                context.resources,
                R.string.notification_bundle_header_counter,
                numberOfChildren ?: 0,
            )

    /** Filters the list of AppData based on time of last collapse by user. */
    private fun filterByCollapseTime(
        rawAppDataList: List<AppData>,
+3 −0
Original line number Diff line number Diff line
@@ -54,6 +54,9 @@ class BundleHeaderViewModel @AssistedInject constructor(private val interactor:

    var backgroundDrawable by mutableStateOf<Drawable?>(null)

    val numberOfChildrenContentDescription: String
        get() = interactor.numberOfChildrenContentDescription

    fun onHeaderClicked() {
        val targetScene =
            when (state?.currentScene) {