Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Commit

Permalink
gradlew lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jhugman committed Sep 9, 2019
1 parent 337b9c9 commit 1a22c5a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions app/src/main/java/mozilla/lockbox/autofill/ViewNodeNavigator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.app.assist.AssistStructure.ViewNode
import android.os.Build
import android.view.autofill.AutofillId
import androidx.annotation.RequiresApi
import java.util.Locale

interface AutofillNodeNavigator<T, U> {
val rootNodes: List<T>
Expand Down Expand Up @@ -56,13 +57,12 @@ class ViewNodeNavigator(

override fun autofillId(node: ViewNode): AutofillId? = node.autofillId

override fun isEditText(node: ViewNode): Boolean {
return node.className == "android.widget.EditText"
}
override fun isEditText(node: ViewNode) =
node.className == "android.widget.EditText"

override fun isHtmlInputField(node: ViewNode): Boolean {
return node.htmlInfo?.tag?.toLowerCase() == "input"
}
override fun isHtmlInputField(node: ViewNode) =
// Use English locale, as the HTML tags are all in English.
node.htmlInfo?.tag?.toLowerCase(Locale.ENGLISH) == "input"

override fun packageName(node: ViewNode): String? = node.idPackage

Expand All @@ -81,4 +81,4 @@ class ViewNodeNavigator(
packageName
)
}
}
}

0 comments on commit 1a22c5a

Please sign in to comment.