package com.taoke.autopay.android.utils.accessibility; import android.content.Context; import androidx.core.view.accessibility.AccessibilityNodeInfoCompat; public class TextContainsNodeFilter extends NodeFilter { private final String text; public TextContainsNodeFilter(String text) { this.text = text; } @Override public boolean accept(Context context, AccessibilityNodeInfoCompat node) { CharSequence nodeText = AccessibilityNodeInfoUtils.getNodeText(node); return nodeText != null && nodeText.toString().contains(text); } }