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

Commit e4328ad5 authored by Prince's avatar Prince
Browse files

KeyguardIndicationArea: Make indication text focusable for TalkBack

Enable TalkBack focus on KeyguardIndicationArea by setting focusable
and importantForAccessibility properties directly on the view.

Fixes: 378584261
Flag: NONE talkback fix
Test: Device tested
Change-Id: Iefef6a512b778c2d777a324341d223d205253f0e
parent dc082200
Loading
Loading
Loading
Loading
+9 −19
Original line number Diff line number Diff line
@@ -82,20 +82,15 @@ constructor(
                            Modifier.shortcutPadding()
                        } else {
                            Modifier
                        }
                        },
                )
            }
        }
    }

    @Composable
    fun SceneScope.IndicationArea(
        modifier: Modifier = Modifier,
    ) {
        Element(
            key = IndicationAreaElementKey,
            modifier = modifier.indicationAreaPadding(),
        ) {
    fun SceneScope.IndicationArea(modifier: Modifier = Modifier) {
        Element(key = IndicationAreaElementKey, modifier = modifier.indicationAreaPadding()) {
            content {
                IndicationArea(
                    indicationAreaViewModel = indicationAreaViewModel,
@@ -138,24 +133,20 @@ constructor(
                            ResourcesCompat.getDrawable(
                                context.resources,
                                R.drawable.keyguard_bottom_affordance_bg,
                                context.theme
                                context.theme,
                            )
                        foreground =
                            ResourcesCompat.getDrawable(
                                context.resources,
                                R.drawable.keyguard_bottom_affordance_selected_border,
                                context.theme
                                context.theme,
                            )
                        visibility = View.INVISIBLE
                        setPadding(padding, padding, padding, padding)
                    }

                setBinding(
                    binder.bind(
                        view,
                        viewModel,
                        transitionAlpha,
                    ) {
                    binder.bind(view, viewModel, transitionAlpha) {
                        indicationController.showTransientIndication(it)
                    }
                )
@@ -164,10 +155,7 @@ constructor(
            },
            onRelease = { binding?.destroy() },
            modifier =
                modifier.size(
                    width = shortcutSizeDp().width,
                    height = shortcutSizeDp().height,
                )
                modifier.size(width = shortcutSizeDp().width, height = shortcutSizeDp().height),
        )
    }

@@ -182,6 +170,8 @@ constructor(
        AndroidView(
            factory = { context ->
                val view = KeyguardIndicationArea(context, null)
                view.isFocusable = true
                view.importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_YES
                setDisposable(
                    KeyguardIndicationAreaBinder.bind(
                        view = view,