android.text.style.UpdateAppearance Java Examples

The following examples show how to use android.text.style.UpdateAppearance. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TextUtils.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
/**
 * Returns whether or not the specified spanned text has a style span.
 * @hide
 */
public static boolean hasStyleSpan(@NonNull Spanned spanned) {
    Preconditions.checkArgument(spanned != null);
    final 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
Source File: SelectionPopupController.java    From 365browser with Apache License 2.0 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 #3
Source File: Clipboard.java    From 365browser with Apache License 2.0 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 #4
Source File: UpdateFatory.java    From RichEditor with Apache License 2.0 4 votes vote down vote up
@Override
public List<UpdateAppearance> createUpdateSpans(String code) {
    return null;
}
 
Example #5
Source File: IUpdateAppearanceFactory.java    From RichEditor with Apache License 2.0 votes vote down vote up
public List<UpdateAppearance> createUpdateSpans(String code);