@Test @UiThreadTest public void testSetTextAppearance_resetTypeface() throws PackageManager.NameNotFoundException { TextView textView = mContainer.findViewById(R.id.textview_simple); TextViewCompat.setTextAppearance(textView, R.style.TextView_SansSerif); Typeface firstTypeface = textView.getTypeface(); TextViewCompat.setTextAppearance(textView, R.style.TextView_Serif); Typeface secondTypeface = textView.getTypeface(); assertNotNull(firstTypeface); assertNotNull(secondTypeface); assertNotEquals(firstTypeface, secondTypeface); }
@Override public void setTextAppearance(Context context, int resId) { super.setTextAppearance(context, resId); if (mTextHelper != null) { mTextHelper.onSetTextAppearance(context, resId); } }
AppCompatTextView extends TextView implements TintableBackgroundView,
        AutoSizeableTextView { @Override public void setTextAppearance(Context context, int resId) { super.setTextAppearance(context, resId); if (mTextHelper != null) { mTextHelper.onSetTextAppearance(context, resId); } } }
AppCompatTextView extends TextView implements TintableBackgroundView,
        AutoSizeableTextView { @Override public void setTextAppearance(Context context, int resId) { super.setTextAppearance(context, resId); if (mTextHelper != null) { mTextHelper.onSetTextAppearance(context, resId); } } AppCompatTextView(Context context);  AppCompatTextView(Context context, AttributeSet attrs);  AppCompatTextView(Context context, AttributeSet attrs, int defStyleAttr); }
AppCompatTextView extends TextView implements TintableBackgroundView,
        AutoSizeableTextView { @Override public void setTextAppearance(Context context, int resId) { super.setTextAppearance(context, resId); if (mTextHelper != null) { mTextHelper.onSetTextAppearance(context, resId); } } AppCompatTextView(Context context);  AppCompatTextView(Context context, AttributeSet attrs);  AppCompatTextView(Context context, AttributeSet attrs, int defStyleAttr); @Override void setBackgroundResource(@DrawableRes int resId); @Override void setBackgroundDrawable(Drawable background); @RestrictTo(LIBRARY_GROUP) @Override void setSupportBackgroundTintList(@Nullable ColorStateList tint); @RestrictTo(LIBRARY_GROUP) @Override @Nullable ColorStateList getSupportBackgroundTintList(); @RestrictTo(LIBRARY_GROUP) @Override void setSupportBackgroundTintMode(@Nullable PorterDuff.Mode tintMode); @RestrictTo(LIBRARY_GROUP) @Override @Nullable PorterDuff.Mode getSupportBackgroundTintMode(); @Override void setTextAppearance(Context context, int resId); @Override void setTextSize(int unit, float size); @RestrictTo(LIBRARY_GROUP) @Override void setAutoSizeTextTypeWithDefaults(
            @TextViewCompat.AutoSizeTextType int autoSizeTextType); @RestrictTo(LIBRARY_GROUP) @Override void setAutoSizeTextTypeUniformWithConfiguration(
            int autoSizeMinTextSize,
            int autoSizeMaxTextSize,
            int autoSizeStepGranularity,
            int unit); @RestrictTo(LIBRARY_GROUP) @Override void setAutoSizeTextTypeUniformWithPresetSizes(@NonNull int[] presetSizes, int unit); @RestrictTo(LIBRARY_GROUP) @Override @TextViewCompat.AutoSizeTextType int getAutoSizeTextType(); @RestrictTo(LIBRARY_GROUP) @Override int getAutoSizeStepGranularity(); @RestrictTo(LIBRARY_GROUP) @Override int getAutoSizeMinTextSize(); @RestrictTo(LIBRARY_GROUP) @Override int getAutoSizeMaxTextSize(); @RestrictTo(LIBRARY_GROUP) @Override int[] getAutoSizeTextAvailableSizes(); @Override InputConnection onCreateInputConnection(EditorInfo outAttrs); @Override void setFirstBaselineToTopHeight(@Px @IntRange(from = 0) int firstBaselineToTopHeight); @Override void setLastBaselineToBottomHeight(
            @Px @IntRange(from = 0) int lastBaselineToBottomHeight); @Override int getFirstBaselineToTopHeight(); @Override int getLastBaselineToBottomHeight(); @Override void setLineHeight(@Px @IntRange(from = 0) int lineHeight); }
AppCompatTextView extends TextView implements TintableBackgroundView,
        AutoSizeableTextView { @Override public void setTextAppearance(Context context, int resId) { super.setTextAppearance(context, resId); if (mTextHelper != null) { mTextHelper.onSetTextAppearance(context, resId); } } AppCompatTextView(Context context);  AppCompatTextView(Context context, AttributeSet attrs);  AppCompatTextView(Context context, AttributeSet attrs, int defStyleAttr); @Override void setBackgroundResource(@DrawableRes int resId); @Override void setBackgroundDrawable(Drawable background); @RestrictTo(LIBRARY_GROUP) @Override void setSupportBackgroundTintList(@Nullable ColorStateList tint); @RestrictTo(LIBRARY_GROUP) @Override @Nullable ColorStateList getSupportBackgroundTintList(); @RestrictTo(LIBRARY_GROUP) @Override void setSupportBackgroundTintMode(@Nullable PorterDuff.Mode tintMode); @RestrictTo(LIBRARY_GROUP) @Override @Nullable PorterDuff.Mode getSupportBackgroundTintMode(); @Override void setTextAppearance(Context context, int resId); @Override void setTextSize(int unit, float size); @RestrictTo(LIBRARY_GROUP) @Override void setAutoSizeTextTypeWithDefaults(
            @TextViewCompat.AutoSizeTextType int autoSizeTextType); @RestrictTo(LIBRARY_GROUP) @Override void setAutoSizeTextTypeUniformWithConfiguration(
            int autoSizeMinTextSize,
            int autoSizeMaxTextSize,
            int autoSizeStepGranularity,
            int unit); @RestrictTo(LIBRARY_GROUP) @Override void setAutoSizeTextTypeUniformWithPresetSizes(@NonNull int[] presetSizes, int unit); @RestrictTo(LIBRARY_GROUP) @Override @TextViewCompat.AutoSizeTextType int getAutoSizeTextType(); @RestrictTo(LIBRARY_GROUP) @Override int getAutoSizeStepGranularity(); @RestrictTo(LIBRARY_GROUP) @Override int getAutoSizeMinTextSize(); @RestrictTo(LIBRARY_GROUP) @Override int getAutoSizeMaxTextSize(); @RestrictTo(LIBRARY_GROUP) @Override int[] getAutoSizeTextAvailableSizes(); @Override InputConnection onCreateInputConnection(EditorInfo outAttrs); @Override void setFirstBaselineToTopHeight(@Px @IntRange(from = 0) int firstBaselineToTopHeight); @Override void setLastBaselineToBottomHeight(
            @Px @IntRange(from = 0) int lastBaselineToBottomHeight); @Override int getFirstBaselineToTopHeight(); @Override int getLastBaselineToBottomHeight(); @Override void setLineHeight(@Px @IntRange(from = 0) int lineHeight);  }