Started to update adapters to use new layouts
Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<manifest package="com.RickBarrette.osj.forum"
|
<manifest package="com.RickBarrette.osj.forum"
|
||||||
android:versionCode="49"
|
android:versionCode="60"
|
||||||
android:versionName="1.0" xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto">
|
android:versionName="1.0" xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto">
|
||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class ForumAdapter extends BaseAdapter {
|
|||||||
|
|
||||||
class ViewHolder {
|
class ViewHolder {
|
||||||
TextView title;
|
TextView title;
|
||||||
|
TextView description;
|
||||||
}
|
}
|
||||||
|
|
||||||
private LayoutInflater mInflater;
|
private LayoutInflater mInflater;
|
||||||
@@ -99,6 +100,7 @@ public class ForumAdapter extends BaseAdapter {
|
|||||||
// we want to bind data to.
|
// we want to bind data to.
|
||||||
holder = new ViewHolder();
|
holder = new ViewHolder();
|
||||||
holder.title = (TextView) convertView.findViewById(R.id.textView1);
|
holder.title = (TextView) convertView.findViewById(R.id.textView1);
|
||||||
|
holder.description = (TextView) convertView.findViewById(R.id.textView2);
|
||||||
|
|
||||||
convertView.setTag(holder);
|
convertView.setTag(holder);
|
||||||
} else
|
} else
|
||||||
@@ -113,6 +115,7 @@ public class ForumAdapter extends BaseAdapter {
|
|||||||
* This will prevent the list from changing the values on you.
|
* This will prevent the list from changing the values on you.
|
||||||
*/
|
*/
|
||||||
holder.title.setText(new String((byte[]) getItem(position).content.get("forum_name")));
|
holder.title.setText(new String((byte[]) getItem(position).content.get("forum_name")));
|
||||||
|
holder.description.setText(new String((byte[]) getItem(position).content.get("description")));
|
||||||
return convertView;
|
return convertView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import org.xmlrpc.android.XMLRPCClient;
|
|||||||
import org.xmlrpc.android.XMLRPCException;
|
import org.xmlrpc.android.XMLRPCException;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import com.RickBarrette.osj.forum.R;
|
import com.RickBarrette.osj.forum.R;
|
||||||
|
|
||||||
@@ -43,6 +44,7 @@ public class ForumContent {
|
|||||||
*/
|
*/
|
||||||
public static class ForumItem {
|
public static class ForumItem {
|
||||||
|
|
||||||
|
private static final String TAG = "ForumItem";
|
||||||
public String id;
|
public String id;
|
||||||
public HashMap<?, ?> content;
|
public HashMap<?, ?> content;
|
||||||
|
|
||||||
@@ -55,6 +57,9 @@ public class ForumContent {
|
|||||||
public ForumItem(final String id, final HashMap<?, ?> content) {
|
public ForumItem(final String id, final HashMap<?, ?> content) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.content = content;
|
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
|
* @param context
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -22,10 +22,12 @@ package com.RickBarrette.osj.forum.content;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.BaseAdapter;
|
import android.widget.BaseAdapter;
|
||||||
|
import android.widget.QuickContactBadge;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.RickBarrette.osj.forum.R;
|
import com.RickBarrette.osj.forum.R;
|
||||||
@@ -38,8 +40,13 @@ public class TopicAdapter extends BaseAdapter {
|
|||||||
|
|
||||||
class ViewHolder {
|
class ViewHolder {
|
||||||
TextView title;
|
TextView title;
|
||||||
|
TextView lastestPost;
|
||||||
|
TextView user;
|
||||||
|
QuickContactBadge badage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final String TAG = "TopicAdapter";
|
||||||
|
|
||||||
private LayoutInflater mInflater;
|
private LayoutInflater mInflater;
|
||||||
private Object[] mTopics;
|
private Object[] mTopics;
|
||||||
|
|
||||||
@@ -98,13 +105,16 @@ public class TopicAdapter extends BaseAdapter {
|
|||||||
// supplied
|
// supplied
|
||||||
// by ListView is null.
|
// by ListView is null.
|
||||||
if (convertView == 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
|
// Creates a ViewHolder and store references to the two children
|
||||||
// views
|
// views
|
||||||
// we want to bind data to.
|
// we want to bind data to.
|
||||||
holder = new ViewHolder();
|
holder = new ViewHolder();
|
||||||
holder.title = (TextView) convertView.findViewById(R.id.textView1);
|
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);
|
convertView.setTag(holder);
|
||||||
} else
|
} else
|
||||||
@@ -119,6 +129,11 @@ public class TopicAdapter extends BaseAdapter {
|
|||||||
* This will prevent the list from changing the values on you.
|
* This will prevent the list from changing the values on you.
|
||||||
*/
|
*/
|
||||||
holder.title.setText(new String((byte[]) getItem(position).get("topic_title")));
|
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;
|
return convertView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user