I have code like:
SpecialAdapter adapter = new SpecialAdapter(
this,
list,
R.layout.list_display_item,
from,
to );
myTextListView.setAdapter(adapter);
.
.
.
.
public class SpecialAdapter extends SimpleAdapter
{
public SpecialAdapter(Context context, List<HashMap<String,
String>> items, int resource, String[] from, int[] to) {
super(context, items, resource, from, to);
}
@Override
public View getView(
int position, View convertView, ViewGroup parent)
{
View view = super.getView(position, convertView, parent);
}
}
and list_display_item.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/myDisplayItemLinearLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TextView
android:id="@+id/arabicTextView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right|center_vertical"
android:lineSpacingMultiplier="3"
android:text="Arabic"
android:textSize="30dp"/>
<TextView
android:id="@+id/translationTextView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="English"
android:gravity="left|center_vertical"
android:textSize="30dp"/>
</LinearLayout>
I just want to set my own arabic font to android:id="@+id/arabicTextView" and english font to android:id="@+id/translationTextView".
In getView() function of SpecialAdapter class i get View view = super.getView(position, convertView, parent) and view.getId() is actually the id of linearlayout android:id="@+id/myDisplayItemLinearLayout"
I just want to get inner textviews of this linearLayout to set seperate fonts to each using typeface here... how can i get these textViews there??
Is it correct way to set my fonts here or it should be done in someother way???? please help me..