本文整理汇总了Java中android.text.style.UpdateAppearance类的典型用法代码示例。如果您正苦于以下问题:Java UpdateAppearance类的具体用法?Java UpdateAppearance怎么用?Java UpdateAppearance使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UpdateAppearance类属于android.text.style包,在下文中一共展示了UpdateAppearance类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hasStyleSpan
import android.text.style.UpdateAppearance; //导入依赖的package包/类
private boolean hasStyleSpan(Spanned spanned) {
// Only check against those three classes below, which could affect text appearance, since
// there are other kind of classes won't affect appearance.
Class<?>[] styleClasses = {
CharacterStyle.class, ParagraphStyle.class, UpdateAppearance.class};
for (Class<?> clazz : styleClasses) {
if (spanned.nextSpanTransition(-1, spanned.length(), clazz) < spanned.length()) {
return true;
}
}
return false;
}
示例2: hasStyleSpan
import android.text.style.UpdateAppearance; //导入依赖的package包/类
private boolean hasStyleSpan(Spanned spanned) {
Class<?>[] styleClasses = {
CharacterStyle.class, ParagraphStyle.class, UpdateAppearance.class};
for (Class<?> clazz : styleClasses) {
if (spanned.nextSpanTransition(-1, spanned.length(), clazz) < spanned.length()) {
return true;
}
}
return false;
}
示例3: textTransform
import android.text.style.UpdateAppearance; //导入依赖的package包/类
private static void textTransform(TextView view, UpdateAppearance appearance) {
SpannableString viewText = new SpannableString(view.getText());
viewText.setSpan(appearance, 0, viewText.length(), 0);
view.setText(viewText);
}