(Document d, String[] texts)
| 3415 | } |
| 3416 | |
| 3417 | static boolean contains(Document d, String[] texts) { |
| 3418 | Map<String, Boolean> condition = new HashMap<>(); |
| 3419 | for (String t : texts) |
| 3420 | condition.put(t, false); |
| 3421 | |
| 3422 | for (Element elm : d.body().select("*")) |
| 3423 | for (Node child : elm.childNodes()) { |
| 3424 | if (child instanceof TextNode) { |
| 3425 | TextNode tnode = ((TextNode) child); |
| 3426 | String text = tnode.getWholeText(); |
| 3427 | for (String t : texts) |
| 3428 | if (!condition.get(t) && text.contains(t)) { |
| 3429 | condition.put(t, true); |
| 3430 | |
| 3431 | boolean found = true; |
| 3432 | for (String c : texts) |
| 3433 | if (!condition.get(c)) { |
| 3434 | found = false; |
| 3435 | break; |
| 3436 | } |
| 3437 | |
| 3438 | if (found) |
| 3439 | return true; |
| 3440 | } |
| 3441 | } |
| 3442 | } |
| 3443 | |
| 3444 | return false; |
| 3445 | } |
| 3446 | |
| 3447 | static SpannableStringBuilder fromDocument( |
| 3448 | Context context, @NonNull Document document, |
no test coverage detected