Textstyle is not woking in release

47 views Asked by At

I am creating textview dynamically and setting the style like this

 val textView = TextView(context).apply {
            tag = data.id
            text = data.name
            gravity = Gravity.CENTER
            layoutParams = params
            TextViewCompat.setTextAppearance(this, R.style.customStyle)
            setOnClickListener {  }
        }

This is the style

<style name="customStyle">
    <item name="android:fontFamily">@font/quicksand_bold</item>
    <item name="android:textColor">@color/icon_grey</item>
    <item name="android:textAllCaps">false</item>
    <item name="android:textSize">14sp</item>
</style>

It works fine when shrinkResources and minifyEnabled are false. It shows blank in the release (shrinkResources and minifyEnabled are true).

0

There are 0 answers