I am using a fragment list, so I have a child .xml to manage the formatting of each bit of text within each drop down. How do I manipulate my code to embold my heading?
ItemClass
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val rootView = inflater.inflate(R.layout.fragment_list, container, false)
val parent1 = Parent(0, "Wudu")
val childItems1 = ArrayList<Child>()
childItems1.add(Child(parent1, 0, getString(R.string.wudu)))
parent1.childItems.clear()
parent1.childItems.addAll(childItems1)
My String code
<string name="wudu">
<b>Introduction</b>
"\n
What is most important is to set intentions…
</string>
Child XML
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingTop="16dp"
android:paddingEnd="16dp"
android:paddingBottom="16dp"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="20sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Text" />
</androidx.constraintlayout.widget.ConstraintLayout>
You can see the result in the image. The text is not bold. I believe the container overrides the string formatting: Image