Merge "Pull out common code in createFromParcel's switch" am: 387327585e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2596847 Change-Id: Iba392c4f2ee1273de42932374d4f9b7c242768fc Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
committed by
Automerger Merge Worker
commit
892a66a3f4
@@ -871,126 +871,128 @@ public class TextUtils {
|
|||||||
if (kind == 0)
|
if (kind == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
final Object span;
|
||||||
switch (kind) {
|
switch (kind) {
|
||||||
case ALIGNMENT_SPAN:
|
case ALIGNMENT_SPAN:
|
||||||
readSpan(p, sp, new AlignmentSpan.Standard(p));
|
span = new AlignmentSpan.Standard(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FOREGROUND_COLOR_SPAN:
|
case FOREGROUND_COLOR_SPAN:
|
||||||
readSpan(p, sp, new ForegroundColorSpan(p));
|
span = new ForegroundColorSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RELATIVE_SIZE_SPAN:
|
case RELATIVE_SIZE_SPAN:
|
||||||
readSpan(p, sp, new RelativeSizeSpan(p));
|
span = new RelativeSizeSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SCALE_X_SPAN:
|
case SCALE_X_SPAN:
|
||||||
readSpan(p, sp, new ScaleXSpan(p));
|
span = new ScaleXSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STRIKETHROUGH_SPAN:
|
case STRIKETHROUGH_SPAN:
|
||||||
readSpan(p, sp, new StrikethroughSpan(p));
|
span = new StrikethroughSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UNDERLINE_SPAN:
|
case UNDERLINE_SPAN:
|
||||||
readSpan(p, sp, new UnderlineSpan(p));
|
span = new UnderlineSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STYLE_SPAN:
|
case STYLE_SPAN:
|
||||||
readSpan(p, sp, new StyleSpan(p));
|
span = new StyleSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BULLET_SPAN:
|
case BULLET_SPAN:
|
||||||
readSpan(p, sp, new BulletSpan(p));
|
span = new BulletSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QUOTE_SPAN:
|
case QUOTE_SPAN:
|
||||||
readSpan(p, sp, new QuoteSpan(p));
|
span = new QuoteSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LEADING_MARGIN_SPAN:
|
case LEADING_MARGIN_SPAN:
|
||||||
readSpan(p, sp, new LeadingMarginSpan.Standard(p));
|
span = new LeadingMarginSpan.Standard(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case URL_SPAN:
|
case URL_SPAN:
|
||||||
readSpan(p, sp, new URLSpan(p));
|
span = new URLSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BACKGROUND_COLOR_SPAN:
|
case BACKGROUND_COLOR_SPAN:
|
||||||
readSpan(p, sp, new BackgroundColorSpan(p));
|
span = new BackgroundColorSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPEFACE_SPAN:
|
case TYPEFACE_SPAN:
|
||||||
readSpan(p, sp, new TypefaceSpan(p));
|
span = new TypefaceSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SUPERSCRIPT_SPAN:
|
case SUPERSCRIPT_SPAN:
|
||||||
readSpan(p, sp, new SuperscriptSpan(p));
|
span = new SuperscriptSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SUBSCRIPT_SPAN:
|
case SUBSCRIPT_SPAN:
|
||||||
readSpan(p, sp, new SubscriptSpan(p));
|
span = new SubscriptSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ABSOLUTE_SIZE_SPAN:
|
case ABSOLUTE_SIZE_SPAN:
|
||||||
readSpan(p, sp, new AbsoluteSizeSpan(p));
|
span = new AbsoluteSizeSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TEXT_APPEARANCE_SPAN:
|
case TEXT_APPEARANCE_SPAN:
|
||||||
readSpan(p, sp, new TextAppearanceSpan(p));
|
span = new TextAppearanceSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ANNOTATION:
|
case ANNOTATION:
|
||||||
readSpan(p, sp, new Annotation(p));
|
span = new Annotation(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SUGGESTION_SPAN:
|
case SUGGESTION_SPAN:
|
||||||
readSpan(p, sp, new SuggestionSpan(p));
|
span = new SuggestionSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SPELL_CHECK_SPAN:
|
case SPELL_CHECK_SPAN:
|
||||||
readSpan(p, sp, new SpellCheckSpan(p));
|
span = new SpellCheckSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SUGGESTION_RANGE_SPAN:
|
case SUGGESTION_RANGE_SPAN:
|
||||||
readSpan(p, sp, new SuggestionRangeSpan(p));
|
span = new SuggestionRangeSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EASY_EDIT_SPAN:
|
case EASY_EDIT_SPAN:
|
||||||
readSpan(p, sp, new EasyEditSpan(p));
|
span = new EasyEditSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LOCALE_SPAN:
|
case LOCALE_SPAN:
|
||||||
readSpan(p, sp, new LocaleSpan(p));
|
span = new LocaleSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TTS_SPAN:
|
case TTS_SPAN:
|
||||||
readSpan(p, sp, new TtsSpan(p));
|
span = new TtsSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACCESSIBILITY_CLICKABLE_SPAN:
|
case ACCESSIBILITY_CLICKABLE_SPAN:
|
||||||
readSpan(p, sp, new AccessibilityClickableSpan(p));
|
span = new AccessibilityClickableSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACCESSIBILITY_URL_SPAN:
|
case ACCESSIBILITY_URL_SPAN:
|
||||||
readSpan(p, sp, new AccessibilityURLSpan(p));
|
span = new AccessibilityURLSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LINE_BACKGROUND_SPAN:
|
case LINE_BACKGROUND_SPAN:
|
||||||
readSpan(p, sp, new LineBackgroundSpan.Standard(p));
|
span = new LineBackgroundSpan.Standard(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LINE_HEIGHT_SPAN:
|
case LINE_HEIGHT_SPAN:
|
||||||
readSpan(p, sp, new LineHeightSpan.Standard(p));
|
span = new LineHeightSpan.Standard(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACCESSIBILITY_REPLACEMENT_SPAN:
|
case ACCESSIBILITY_REPLACEMENT_SPAN:
|
||||||
readSpan(p, sp, new AccessibilityReplacementSpan(p));
|
span = new AccessibilityReplacementSpan(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new RuntimeException("bogus span encoding " + kind);
|
throw new RuntimeException("bogus span encoding " + kind);
|
||||||
}
|
}
|
||||||
|
readSpan(p, sp, span);
|
||||||
}
|
}
|
||||||
|
|
||||||
return sp;
|
return sp;
|
||||||
|
|||||||
Reference in New Issue
Block a user