Remove dead code.
This commit is contained in:
parent
803a5292ba
commit
366d040d01
1 changed files with 0 additions and 29 deletions
|
|
@ -1,29 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 2023, 2024 New Vector Ltd.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
||||||
* Please see LICENSE files in the repository root for full details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package io.element.android.libraries.androidutils.accessibility
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import android.view.accessibility.AccessibilityManager
|
|
||||||
import androidx.core.content.getSystemService
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether a screen reader is enabled.
|
|
||||||
*
|
|
||||||
* Avoid changing UI or app behavior based on the state of accessibility.
|
|
||||||
* See [AccessibilityManager.isTouchExplorationEnabled] for more details.
|
|
||||||
*
|
|
||||||
* @return true if the screen reader is enabled.
|
|
||||||
*/
|
|
||||||
fun Context.isScreenReaderEnabled(): Boolean {
|
|
||||||
val accessibilityManager = getSystemService<AccessibilityManager>()
|
|
||||||
?: return false
|
|
||||||
|
|
||||||
return accessibilityManager.let {
|
|
||||||
it.isEnabled && it.isTouchExplorationEnabled
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue