Lines Matching refs:prefix
45 * Sets the text on the given text view, highlighting the word that matches the given prefix.
49 * @param prefix the prefix to look for
51 public void setPrefixText(TextView view, String text, String prefix) {
52 view.setText(applyPrefixHighlight(text, prefix));
71 * Returns a CharSequence which highlights the given prefix if found in the given text.
74 * @param prefix the prefix to look for
76 public CharSequence applyPrefixHighlight(CharSequence text, String prefix) {
77 if (prefix == null) {
81 // Skip non-word characters at the beginning of prefix.
83 while (prefixStart < prefix.length() &&
84 !Character.isLetterOrDigit(prefix.charAt(prefixStart))) {
87 final String trimmedPrefix = prefix.substring(prefixStart);