TextColor vs TextColorPrimary vs TextColorSecondary TextColor vs TextColorPrimary vs TextColorSecondary android android

TextColor vs TextColorPrimary vs TextColorSecondary


TextColor is just the xml attribute to set a color to the text of any given view.

TextColorPrimary is the default text color for enabled buttons and Large Textviews.

TextColorSecondary is the default text color for Medium and Small Textviews.

Ignore this, as for what you want to do, there is a better way. You want to edit your style.xml such that the default theme AppTheme (or whatever else you have declared as your theme in your manifest) contains the necessary xml attributes to customize your text colors.

The resulting AppTheme style will look like this when youre done.

<!-- Base application theme. --><style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">    <!-- Customize your theme here. -->    <item name="colorPrimary">@color/colorPrimary</item>    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>    <item name="colorAccent">@color/colorAccent</item>    <item name="android:textColor">#hexColorForTextViews</item>    <item name="android:buttonStyle">@style/myDefaultButton</item></style>

textColor will set the default color for all of your textviews. buttonStyle will reference a custom style that you want for all of your buttons. To make this work, add this style tag to your styles.xml file.

<style name="myDefaultButton">    <item name="android:textColor">#hexColorForButtons</item>    <!-- other stuff you want your buttons to inherit by default --></style>