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

Commit 3de7130d authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android (Google) Code Review
Browse files

Merge "Searching for AccessibilityNodeInfo by text not case insensitive."

parents 374d757e ec39c234
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -7658,12 +7658,17 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    }

    @Override
    public void findViewsWithText(ArrayList<View> outViews, CharSequence text) {
    public void findViewsWithText(ArrayList<View> outViews, CharSequence searched) {
        if (TextUtils.isEmpty(searched)) {
            return;
        }
        CharSequence thisText = getText();
        if (TextUtils.isEmpty(thisText)) {
            return;
        }
        if (thisText.toString().toLowerCase().contains(text)) {
        String searchedLowerCase = searched.toString().toLowerCase();
        String thisTextLowerCase = thisText.toString().toLowerCase();
        if (thisTextLowerCase.contains(searched)) {
            outViews.add(this);
        }
    }