Skip to content

Commit

Permalink
if hintText is null on api 26 and above, fallback to empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Knee committed Nov 29, 2023
1 parent 0a59b88 commit 1fbbb10
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ object AccessibilityNodeInfoExt {
/**
* Retrieves the hint text associated with this [android.view.accessibility.AccessibilityNodeInfo].
*
* If the device API level is below 26 (Oreo), this function provides a fallback
* If the device API level is below 26 (Oreo) or the hint text is null, this function provides a fallback
* by returning an empty CharSequence instead.
*
* @return [CharSequence] representing the hint text or its fallback.
*/
fun AccessibilityNodeInfo.getHintOrFallback(): CharSequence {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && this.hintText != null) {
this.hintText
} else {
""
Expand Down
Binary file modified maestro-client/src/main/resources/maestro-app.apk
Binary file not shown.
Binary file modified maestro-client/src/main/resources/maestro-server.apk
Binary file not shown.

0 comments on commit 1fbbb10

Please sign in to comment.