I am creating a list using recyclerview
. I am using weathericons for textview.
The problem is, if I use the font in BindViewHolder
as:
@Override
public void onBindViewHolder(MyViewHolder holder, int position) {
holder.textViewSicon.setText(Html.fromHtml(""));
}
its working fine, i.e. the intended font is properly displayed. But, I want to use it from array list itself, as: in adapter
@Override
public void onBindViewHolder(MyViewHolder holder, int position) {
holder.textViewSicon.setText(sunSession.getSicon());
where the getSicon is defined as:
public String getSicon() {
return sicon;
}
and finally I am populating the list as:
sunsList.add(
new SunSession(
""
}
which is not giving me the proper font.
I have also defined the layout as
<TextView
android:fontFamily="@font/weathericons"
android:gravity="center|clip_vertical|clip_horizontal"
android:text="@string/sunrise"
android:textAlignment="center">
</TextView>