Java Code Examples for android.text.style.UpdateAppearance

The following are top voted examples for showing how to use android.text.style.UpdateAppearance. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: 365browser   File: SelectionPopupController.java   Source Code and License 5 votes vote down vote up
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;
}
 
Example 2
Project: 365browser   File: Clipboard.java   Source Code and License 5 votes vote down vote up
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;
}
 
Example 3
Project: BactMan-Adventures   File: ViewUtils.java   Source Code and License 4 votes vote down vote up
private static void textTransform(TextView view, UpdateAppearance appearance) {
    SpannableString viewText = new SpannableString(view.getText());
    viewText.setSpan(appearance, 0, viewText.length(), 0);
    view.setText(viewText);
}