Last active
September 14, 2022 11:55
-
-
Save ercnksgl/52520292d074e96d4239153141d382eb to your computer and use it in GitHub Desktop.
Customize Object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context | |
import androidx.annotation.ColorRes | |
import androidx.core.content.ContextCompat | |
/** | |
* Set font types and color to customize text. | |
*/ | |
data class Customize( | |
var hexColor: Int? = null, | |
val isItalic: Boolean = false, | |
val isBold: Boolean = false, | |
val isUnderline: Boolean = false | |
) { | |
fun setColor(context: Context, @ColorRes colorResId: Int): Customize { | |
this.hexColor = ContextCompat.getColor(context, colorResId) | |
return this | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment