Skip to content

Commit

Permalink
Merge pull request #33 from Irineu333/release/v0.1.2
Browse files Browse the repository at this point in the history
[Release/v0.1.2] Prototype - Patch 2
  • Loading branch information
Irineu333 authored Apr 22, 2023
2 parents c5fd972 + a5183ca commit 4855364
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
applicationId "com.neo.speaktouch"
minSdk 22
targetSdk 33
versionCode 2
versionName "0.1.1"
versionCode 3
versionName "0.1.2"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import timber.log.Timber

class FocusInterceptor : Interceptor {

override fun handler(event: AccessibilityEvent) {
override fun handle(event: AccessibilityEvent) {

val node = NodeInfo.wrap(event.source ?: return)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class SpeechInterceptor(
private val context: Context
) : Interceptor {

override fun handler(event: AccessibilityEvent) {
override fun handle(event: AccessibilityEvent) {
if (event.eventType == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED) {
speak(NodeInfo.wrap(event.source ?: return))
}
Expand Down Expand Up @@ -72,7 +72,7 @@ class SpeechInterceptor(
for (index in 0 until node.childCount) {
val nodeChild = node.getChild(index)

if (nodeChild.isAvailableForAccessibility) {
if (nodeChild.isAvailableForAccessibility && !nodeChild.isRequiredFocus) {
add(getContent(nodeChild))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ package com.neo.speaktouch.intercepter.interfece
import android.view.accessibility.AccessibilityEvent

interface Interceptor {
fun handler(event: AccessibilityEvent)
fun handle(event: AccessibilityEvent)
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SpeakTouchService : AccessibilityService() {

Timber.d(event.getLog())

interceptors.forEach { it.handler(event) }
interceptors.forEach { it.handle(event) }
}

override fun onDestroy() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ val NodeInfo.hasAnyClick: Boolean
get() = isClickable || isLongClickable

val NodeInfo.isReadable: Boolean
get() = !isIgnore && hasText
get() = !isIgnore && (hasText || isCheckable)

val NodeInfo.hasText: Boolean
get() = !contentDescription.isNullOrEmpty() ||
Expand Down

0 comments on commit 4855364

Please sign in to comment.