Find in the channel tree and the chat on Android

A find button in the top bar opens a find bar over the tree (clients or
channels) or the conversation on screen, with match stepping, highlights,
only-matches filtering and the desktop's matching options. The tree's
match rule moves to core TreeMatch, which the desktop now uses too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 09:54:02 +00:00
parent 66ef62913a
commit 662e031b6b
10 changed files with 501 additions and 48 deletions

View File

@@ -0,0 +1,22 @@
package com.ts3client.net;
import com.ts3client.text.TextQuery;
/** What finding in the server tree matches a client or a channel on. */
public final class TreeMatch {
private TreeMatch() {
}
/** A client by their nickname, or by the name the contacts give them ({@code null} for none). */
public static boolean client(TextQuery query, String nickname, String contactName) {
return query.matches(nickname) || (contactName != null && query.matches(contactName));
}
/** A channel by its name; a spacer by its caption, unless that only repeats to fill the row. */
public static boolean channel(TextQuery query, String name) {
Spacers.Spacer spacer = Spacers.parse(name);
if (spacer == null) return query.matches(name);
return spacer.align() != '*' && query.matches(spacer.caption());
}
}