package com.mick88.dittimetable.event_details;

import java.util.List;

import com.mick88.dittimetable.R;
import com.mick88.dittimetable.utils.FontApplicator;


import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class KeyValueAdapter extends ArrayAdapter<KeyValue>
{
	FontApplicator 
		fontApplicator;
	
	public KeyValueAdapter(Context context, List<KeyValue> objects) {
		super(context, 0, 0, objects);
		this.fontApplicator = new FontApplicator(context.getAssets(), "Roboto-Light.ttf");
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent)
	{
		LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View view = inflater.inflate(R.layout.list_item_detail, parent, false);
		
		TextView tvName, tvValue;
		
		tvName = (TextView) view.findViewById(android.R.id.text1);
		tvValue = (TextView) view.findViewById(android.R.id.text2);
		
		fontApplicator.applyFont(view);
		
		tvName.setText(getItem(position).key);
		tvValue.setText(getItem(position).value);
				
		return view;
	}
	
}

@@ -447,16 +447,85 @@
 ator;%0A%09%0A
+%09private static class ViewHolder%0A%09%7B%0A%09%09TextView tvName, tvValue;%0A%09%7D%0A%09%0A
 %09public 
@@ -791,16 +791,97 @@
 ent)%0A%09%7B%0A
+%09%09final View view;%0A%09%09final ViewHolder holder;%0A%09%09%0A%09%09if (convertView == null)%0A%09%09%7B%0A%09
 %09%09Layout
@@ -983,21 +983,17 @@
 ICE);%0A%09%09
-View 
+%09
 view = i
@@ -1057,42 +1057,85 @@
 ;%0A%09%09
-%0A%09%09TextView tvName, tvValue;%0A%09%09%0A%09%09
+%09fontApplicator.applyFont(view);%0A%09%09%09%0A%09%09%09holder = new ViewHolder();%0A%09%09%09holder.
 tvNa
@@ -1187,24 +1187,32 @@
 d.text1);%0A%09%09
+%09holder.
 tvValue = (T
@@ -1265,48 +1265,128 @@
 ;%0A%09%09
+%09
 %0A%09%09
-fontApplicator.applyFont(view
+%09view.setTag(holder);%0A%09%09%7D%0A%09%09else%0A%09%09%7B%0A%09%09%09view = convertView;%0A%09%09%09holder = (ViewHolder) view.getTag(
 );%0A%09%09
+%7D
 %0A%09%09
+%0A%09%09holder.
 tvNa
@@ -1422,16 +1422,23 @@
 key);%0A%09%09
+holder.
 tvValue.

Use view holder for details list