@Test public void testAllCaps() { final String text1 = mResources.getString(R.string.sample_text1); final String text2 = mResources.getString(R.string.sample_text2); final AppCompatTextView textView1 = mContainer.findViewById(R.id.text_view_caps1); final AppCompatTextView textView2 = mContainer.findViewById(R.id.text_view_caps2); assertEquals("Text view starts in all caps on", text1.toUpperCase(), textView1.getLayout().getText().toString()); assertEquals("Text view starts in all caps off", text2, textView2.getLayout().getText().toString()); onView(withId(R.id.text_view_caps1)).perform( setTextAppearance(R.style.TextStyleAllCapsOff)); assertEquals("Text view is now in all caps off", text1, textView1.getLayout().getText().toString()); onView(withId(R.id.text_view_caps2)).perform( setTextAppearance(R.style.TextStyleAllCapsOn)); assertEquals("Text view is now in all caps on", text2.toUpperCase(), textView2.getLayout().getText().toString()); }
@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);  }