mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-16 19:18:52 +01:00
Allow setting QKTextView color to theme color
This commit is contained in:
@@ -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">
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user