@@ -0,0 +1,2513 @@
+package com.jaselogic.adamsonelearn;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.TreeSet;%0A%0Aimport android.content.Context;%0Aimport android.view.LayoutInflater;%0Aimport android.view.View;%0Aimport android.view.ViewGroup;%0Aimport android.widget.BaseAdapter;%0Aimport android.widget.TextView;%0A%0Aclass DrawerListAdapter extends BaseAdapter %7B%0A%09private static final int TYPE_ID = 0;%0A%09private static final int TYPE_ITEM = 1;%0A%09private static final int TYPE_SEPARATOR = 2;%0A%09private static final int TYPE_MAX_COUNT = 3;%0A%09%0A%09private ArrayList%3CString%3E listData = new ArrayList();%0A%09private LayoutInflater inflater;%0A%09private TreeSet treeSetSeparator;%0A%09%0A%09public DrawerListAdapter(Context context) %7B%0A%09%09inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);%0A%09%7D%0A%09%0A%09public void addItem(final String item) %7B%0A%09%09listData.add(item);%0A%09%09notifyDataSetChanged();%0A%09%7D%0A%09%0A%09public void addSeparatorItem(final String item) %7B%0A%09%09listData.add(item);%0A%09%09treeSetSeparator.add(listData.size() - 1);%0A%09%09notifyDataSetChanged();%0A%09%7D%0A%09%0A%09@Override%0A%09public int getItemViewType(int position) %7B%0A%09%09return treeSetSeparator.contains(position) ? TYPE_SEPARATOR : TYPE_ITEM;%0A%09%7D%0A%09%0A%09@Override%0A%09public int getViewTypeCount() %7B%0A%09%09return TYPE_MAX_COUNT;%0A%09%7D%0A%09%0A%09@Override%0A%09public int getCount() %7B%0A%09%09return listData.size();%0A%09%7D%0A%0A%09@Override%0A%09public String getItem(int position) %7B%0A%09%09return listData.get(position);%0A%09%7D%0A%0A%09@Override%0A%09public long getItemId(int position) %7B%0A%09%09return position;%0A%09%7D%0A%0A%09@Override%0A%09public View getView(int position, View convertView, ViewGroup parent) %7B%0A%09%09ViewHolder holder = null;%0A%09%09int type = getItemViewType(position); //get proper item view type%0A%09%09if (convertView == null) %7B //if view has yet to be inflated%0A%09%09%09holder = new ViewHolder(); //create a new viewholder%0A%09%09%09switch(type) %7B //inflate a proper view according to type%0A%09%09%09%09case TYPE_ITEM:%0A%09%09%09%09%09convertView = inflater.inflate(R.layout.item, null);%0A%09%09%09%09%09holder.textView = (TextView) convertView.findViewById(R.id.item_text);%0A%09%09%09%09%09break;%0A%09%09%09%09case TYPE_SEPARATOR:%0A%09%09%09%09%09convertView = inflater.inflate(R.layout.separator, null);%0A%09%09%09%09%09holder.textView = (TextView) convertView.findViewById(R.id.item_separator);%0A%09%09%09%09%09break;%0A%09%09%09%7D%0A%09%09%09convertView.setTag(holder); //tag to cache%0A%09%09%7D else %7B //if the view has been inflated once%0A%09%09%09holder = (ViewHolder)convertView.getTag(); //get the tagged holder%0A%09%09%7D%0A%09%09holder.textView.setText(listData.get(position)); //set the text from the array list%0A%09%09return convertView;%0A%09%7D%0A%09%0A%09private static class ViewHolder %7B%0A%09%09protected TextView textView;%0A%09%7D%0A%0A%7D%0A

Create drawerlistadapter for drawer navigation - DrawerListAdapter.java