Allow setting QKTextView color to theme color

This commit is contained in:
Moez Bhatti
2018-04-29 20:04:55 -04:00
parent 8104af5f14
commit dcda9e40f5
3 changed files with 5 additions and 1 deletions
@@ -47,6 +47,7 @@ open class QkTextView @JvmOverloads constructor(context: Context, attrs: Attribu
const val COLOR_PRIMARY_ON_THEME = 3
const val COLOR_SECONDARY_ON_THEME = 4
const val COLOR_TERTIARY_ON_THEME = 5
const val COLOR_THEME = 6
const val SIZE_PRIMARY = 0
const val SIZE_SECONDARY = 1
@@ -89,6 +90,7 @@ open class QkTextView @JvmOverloads constructor(context: Context, attrs: Attribu
COLOR_PRIMARY_ON_THEME -> R.color.textPrimaryDark
COLOR_SECONDARY_ON_THEME -> R.color.textSecondaryDark
COLOR_TERTIARY_ON_THEME -> R.color.textTertiaryDark
COLOR_THEME -> R.color.tools_theme
else -> R.color.textPrimary
}))
@@ -107,6 +109,7 @@ open class QkTextView @JvmOverloads constructor(context: Context, attrs: Attribu
COLOR_PRIMARY_ON_THEME -> colors.textPrimaryOnTheme
COLOR_SECONDARY_ON_THEME -> colors.textSecondaryOnTheme
COLOR_TERTIARY_ON_THEME -> colors.textTertiaryOnTheme
COLOR_THEME -> colors.theme
else -> null
}
@@ -26,6 +26,7 @@
<enum name="primaryOnTheme" value="3" />
<enum name="secondaryOnTheme" value="4" />
<enum name="tertiaryOnTheme" value="5" />
<enum name="theme" value="6" />
</attr>
<attr name="textSize" format="enum">
+1 -1
View File
@@ -73,7 +73,7 @@
<item name="android:layout_marginStart">72dp</item>
<item name="android:layout_marginTop">16dp</item>
<item name="android:textStyle">bold</item>
<item name="textColor">secondary</item>
<item name="textColor">theme</item>
<item name="textSize">secondary</item>
</style>