今天做了什么:
完成了对社区中帖子的详情界面的评论的功能
再详情界面固定底部进行评论,还有显示评论的适配器
package com.hui.testend.list;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.hui.testend.R;
import com.hui.testend.mytool.ImageUtil;
import java.util.Base64;
import java.util.List;
public class RecordAdapter extends BaseAdapter {
private List<recordBean> MyList;
private LayoutInflater mlayoutInflater;
private Context mContext;
public RecordAdapter(Context mContext,List<recordBean> myList) {
MyList = myList;
this.mlayoutInflater = LayoutInflater.from(mContext);
this.mContext = mContext;
}
@Override
public int getCount() {
return MyList.size();
}
@Override
public Object getItem(int position) {
return MyList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
convertView=mlayoutInflater.inflate(R.layout.layout_comm_item,parent,false);
TextView tv_content=convertView.findViewById(R.id.tv_comment);
recordBean itemBean=MyList.get(position);
tv_content.setText(itemBean.getComment());
return convertView;
}
}
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.hui.testend.R;
import com.hui.testend.mytool.ImageUtil;
import java.util.Base64;
import java.util.List;
public class RecordAdapter extends BaseAdapter {
private List<recordBean> MyList;
private LayoutInflater mlayoutInflater;
private Context mContext;
public RecordAdapter(Context mContext,List<recordBean> myList) {
MyList = myList;
this.mlayoutInflater = LayoutInflater.from(mContext);
this.mContext = mContext;
}
@Override
public int getCount() {
return MyList.size();
}
@Override
public Object getItem(int position) {
return MyList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
convertView=mlayoutInflater.inflate(R.layout.layout_comm_item,parent,false);
TextView tv_content=convertView.findViewById(R.id.tv_comment);
recordBean itemBean=MyList.get(position);
tv_content.setText(itemBean.getComment());
return convertView;
}
}
遇到了什么困难:
无
明天准备做什么:
继续完成作业
代码量 80行
时间 0.45小时