本文整理汇总了Java中android.text.TextUtils.getChars方法的典型用法代码示例。如果您正苦于以下问题:Java TextUtils.getChars方法的具体用法?Java TextUtils.getChars怎么用?Java TextUtils.getChars使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.text.TextUtils
的用法示例。
在下文中一共展示了TextUtils.getChars方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: filter
import android.text.TextUtils; //导入方法依赖的package包/类
@Override
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend)
{
char[] v = new char[end - start];
TextUtils.getChars(source, start, end, v, 0);
Spannable emojified = EmojiProvider.getInstance(view.getContext()).emojify(new String(v), view);
if (source instanceof Spanned && emojified != null) {
TextUtils.copySpansFrom((Spanned) source, start, end, null, emojified, 0);
}
return emojified;
}
示例2: filter
import android.text.TextUtils; //导入方法依赖的package包/类
@Nullable
@Override
public CharSequence filter(CharSequence source, int start, int end,
Spanned dest, int dstart, int dend) {
char[] v = new char[end - start];
TextUtils.getChars(source, start, end, v, 0);
Spannable emojified = EmojiProvider.getInstance(view.getContext())
.emojify(new String(v), view);
if (source instanceof Spanned && emojified != null) {
TextUtils.copySpansFrom((Spanned) source, start, end, null,
emojified, 0);
}
return emojified;
}
示例3: getTextBounds
import android.text.TextUtils; //导入方法依赖的package包/类
public static void getTextBounds(Paint paint, CharSequence text, @IntRange(from = 0) int start, @IntRange(from = 0) int end, Rect rect) {
char[] currentText = new char[end - start];
TextUtils.getChars(text, start, end, currentText, 0);
paint.getTextBounds(currentText, 0, end - start, rect);
}