Home | History | Annotate | Download | only in text

Lines Matching defs:charSequence

49  * Processes the CharSequence and adds the emojis.
67 * Advance the end pointer in CharSequence and reset the start to be the end.
72 * Advance end pointer in CharSequence.
78 * pointer in CharSequence and reset the start to be the end.
117 EmojiMetadata getEmojiMetadata(@NonNull final CharSequence charSequence) {
120 final int end = charSequence.length();
124 final int codePoint = Character.codePointAt(charSequence, currentOffset);
140 * Checks a given CharSequence for emojis, and adds EmojiSpans if any emojis are found.
143 * <li>If no emojis are found, {@code charSequence} given as the input is returned without
144 * any changes. i.e. charSequence is a String, and no emojis are found, the same String is
151 * @param charSequence CharSequence to add the EmojiSpans, cannot be {@code null}
152 * @param start start index in the charSequence to look for emojis, should be greater than or
153 * equal to {@code 0}, also less than {@code charSequence.length()}
154 * @param end end index in the charSequence to look for emojis, should be greater than or
155 * equal to {@code start} parameter, also less than {@code charSequence.length()}
156 * @param maxEmojiCount maximum number of emojis in the {@code charSequence}, should be greater
160 CharSequence process(@NonNull final CharSequence charSequence, @IntRange(from = 0) int start,
163 final boolean isSpannableBuilder = charSequence instanceof SpannableBuilder;
165 ((SpannableBuilder) charSequence).beginBatchEdit();
173 if (isSpannableBuilder || charSequence instanceof Spannable) {
174 spannable = (Spannable) charSequence;
175 } else if (charSequence instanceof Spanned) {
178 final int nextSpanTransition = ((Spanned) charSequence).nextSpanTransition(
182 spannable = new SpannableString(charSequence);
209 if (start == end || start >= charSequence.length()) {
210 return charSequence;
224 int codePoint = Character.codePointAt(charSequence, currentOffset);
231 start += Character.charCount(Character.codePointAt(charSequence, start));
234 codePoint = Character.codePointAt(charSequence, currentOffset);
240 codePoint = Character.codePointAt(charSequence, currentOffset);
244 if (replaceAll || !hasGlyph(charSequence, start, currentOffset,
247 spannable = new SpannableString(charSequence);
262 if (replaceAll || !hasGlyph(charSequence, start, currentOffset,
265 spannable = new SpannableString(charSequence);
271 return spannable == null ? charSequence : spannable;
274 ((SpannableBuilder) charSequence).endBatchEdit();
446 * @param charSequence the CharSequence that the emoji is in
447 * @param start start index of the emoji in the CharSequence
448 * @param end end index of the emoji in the CharSequence
453 private boolean hasGlyph(final CharSequence charSequence, int start, final int end,
464 final boolean hasGlyph = mGlyphChecker.hasGlyph(charSequence, start, end);
672 * @param cs CharSequence to work on
678 private static int findIndexBackward(final CharSequence cs, final int from,
727 * @param cs CharSequence to work on
733 private static int findIndexForward(final CharSequence cs, final int from,
814 * @param charSequence the CharSequence that the emoji is in
815 * @param start start index of the emoji in the CharSequence
816 * @param end end index of the emoji in the CharSequence
820 public boolean hasGlyph(final CharSequence charSequence, int start, final int end) {
825 builder.append(charSequence.charAt(start));