Lines Matching refs:name
31 * Compares a name and query and returns a {@link CharSequence} with bolded characters.
42 * @param name of a contact/string that query will compare to
43 * @return name with query bolded if query can be found in the name.
45 public static CharSequence getNameWithQueryBolded(@Nullable String query, @NonNull String name) {
47 return name;
53 if (QueryFilteringUtil.nameMatchesT9Query(query, name)) {
55 String t9 = QueryFilteringUtil.getT9Representation(name);
58 return getNameWithInitialsBolded(query, name);
70 if (!Character.isLetterOrDigit(name.charAt(i))) {
81 // Bold the query as an exact match in the name
82 index = name.toLowerCase().indexOf(query);
86 return index == -1 ? name : getBoldedString(name, index, numberOfBoldedCharacters);
89 private static CharSequence getNameWithInitialsBolded(String query, String name) {
90 SpannableString boldedInitials = new SpannableString(name);
91 name = name.toLowerCase();
95 while (++nameIndex < name.length() && initialsBolded < query.length()) {
96 if ((nameIndex == 0 || name.charAt(nameIndex - 1) == ' ')
97 && QueryFilteringUtil.getDigit(name.charAt(nameIndex)) == query.charAt(initialsBolded)) {