diff --git a/OSJ Forum/AndroidManifest.xml b/OSJ Forum/AndroidManifest.xml index 5d2ae80..297d3cd 100644 --- a/OSJ Forum/AndroidManifest.xml +++ b/OSJ Forum/AndroidManifest.xml @@ -1,5 +1,5 @@ content; @@ -55,6 +57,9 @@ public class ForumContent { public ForumItem(final String id, final HashMap content) { this.id = id; this.content = content; + + for(Object key: content.keySet()) + Log.d(TAG, key.toString()); } /** @@ -105,7 +110,7 @@ public class ForumContent { } /** - * Downloads the forum from the internet + * Downloads the forum from the Internet * @param context * @author ricky barrette */ diff --git a/OSJ Forum/src/com/RickBarrette/osj/forum/content/TopicAdapter.java b/OSJ Forum/src/com/RickBarrette/osj/forum/content/TopicAdapter.java index 4835a19..519b95c 100644 --- a/OSJ Forum/src/com/RickBarrette/osj/forum/content/TopicAdapter.java +++ b/OSJ Forum/src/com/RickBarrette/osj/forum/content/TopicAdapter.java @@ -22,10 +22,12 @@ package com.RickBarrette.osj.forum.content; import java.util.HashMap; import android.content.Context; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; +import android.widget.QuickContactBadge; import android.widget.TextView; import com.RickBarrette.osj.forum.R; @@ -38,8 +40,13 @@ public class TopicAdapter extends BaseAdapter { class ViewHolder { TextView title; + TextView lastestPost; + TextView user; + QuickContactBadge badage; } + private static final String TAG = "TopicAdapter"; + private LayoutInflater mInflater; private Object[] mTopics; @@ -98,14 +105,17 @@ public class TopicAdapter extends BaseAdapter { // supplied // by ListView is null. if (convertView == null) { - convertView = mInflater.inflate(R.layout.forum_item, null); + convertView = mInflater.inflate(R.layout.topic_item, null); // Creates a ViewHolder and store references to the two children // views // we want to bind data to. holder = new ViewHolder(); holder.title = (TextView) convertView.findViewById(R.id.textView1); - + holder.lastestPost = (TextView) convertView.findViewById(R.id.textView2); + holder.user = (TextView) convertView.findViewById(R.id.textView3); + holder.badage = (QuickContactBadge) convertView.findViewById(R.id.quickContactBadge1); + convertView.setTag(holder); } else // Get the ViewHolder back to get fast access to the TextView @@ -119,6 +129,11 @@ public class TopicAdapter extends BaseAdapter { * This will prevent the list from changing the values on you. */ holder.title.setText(new String((byte[]) getItem(position).get("topic_title"))); + holder.user.setText(new String((byte[]) getItem(position).get("topic_author_name"))); + holder.lastestPost.setText(new String((byte[]) getItem(position).get("short_content"))); + + for(Object key: getItem(position).keySet()) + Log.d(TAG, key.toString()); return convertView; }