发布网友 发布时间:2022-04-24 01:00
共5个回答
热心网友 时间:2023-10-16 20:34
首先:电子信息专业毕设,大部分就是提取外界信息通过某一个控制器做出反馈和控制。热心网友 时间:2023-10-16 20:34
应该差不多了吧!仅供参考哦!
热心网友 时间:2023-10-16 20:35
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.lingnet.app.tv.R;
import com.zhy.autolayout.utils.AutoUtils;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import butterknife.ButterKnife;
public class MessageAdapter extends RecyclerView.Adapter<MessageAdapter.ViewHolder> {
private List<Map<String, String>> dataList = null;
Context context;
public MessageAdapter(Context context) {
this.context = context;
}
public void notifyDataSetChanged(List<Map<String, String>> dataList) {
if (dataList == null) {
this.dataList = new LinkedList<>();
} else {
if (this.dataList == null) {
this.dataList = new LinkedList<>();
}
this.dataList.addAll(dataList);
}
super.notifyDataSetChanged();
}
public void addData(List<Map<String, String>> dataList) {
if (dataList != null) {
this.dataList.addAll(dataList);
} else {
this.dataList = dataList;
}
}
//创建新View,被LayoutManager所调用
@Override
public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout
.list_item_message, viewGroup, false);
ViewHolder vh = new ViewHolder(view);
return vh;
}
//将数据与界面进行绑定的操作
@Override
public void onBindViewHolder(ViewHolder viewHolder, int position) {
Map<String, String> data = dataList.get(position);
viewHolder.itemView.setTag(data);
}
//获取数据的数量
@Override
public int getItemCount() {
int count = 0;
if (dataList != null) {
count = dataList.size();
}
return count;
}
//自定义的ViewHolder,持有每个Item的的所有界面元素
public static class ViewHolder extends RecyclerView.ViewHolder {
public ViewHolder(View view) {
super(view);
ButterKnife.bind(this, view);
AutoUtils.autoSize(view);
}
}
}
热心网友 时间:2023-10-16 20:35
题目是老师出的。热心网友 时间:2023-10-16 20:36
现在要这些有什么用,毕设恐怕都基本做完了。热心网友 时间:2023-10-16 20:34
首先:电子信息专业毕设,大部分就是提取外界信息通过某一个控制器做出反馈和控制。热心网友 时间:2023-10-16 20:34
应该差不多了吧!仅供参考哦!
热心网友 时间:2023-10-16 20:35
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.lingnet.app.tv.R;
import com.zhy.autolayout.utils.AutoUtils;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import butterknife.ButterKnife;
public class MessageAdapter extends RecyclerView.Adapter<MessageAdapter.ViewHolder> {
private List<Map<String, String>> dataList = null;
Context context;
public MessageAdapter(Context context) {
this.context = context;
}
public void notifyDataSetChanged(List<Map<String, String>> dataList) {
if (dataList == null) {
this.dataList = new LinkedList<>();
} else {
if (this.dataList == null) {
this.dataList = new LinkedList<>();
}
this.dataList.addAll(dataList);
}
super.notifyDataSetChanged();
}
public void addData(List<Map<String, String>> dataList) {
if (dataList != null) {
this.dataList.addAll(dataList);
} else {
this.dataList = dataList;
}
}
//创建新View,被LayoutManager所调用
@Override
public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout
.list_item_message, viewGroup, false);
ViewHolder vh = new ViewHolder(view);
return vh;
}
//将数据与界面进行绑定的操作
@Override
public void onBindViewHolder(ViewHolder viewHolder, int position) {
Map<String, String> data = dataList.get(position);
viewHolder.itemView.setTag(data);
}
//获取数据的数量
@Override
public int getItemCount() {
int count = 0;
if (dataList != null) {
count = dataList.size();
}
return count;
}
//自定义的ViewHolder,持有每个Item的的所有界面元素
public static class ViewHolder extends RecyclerView.ViewHolder {
public ViewHolder(View view) {
super(view);
ButterKnife.bind(this, view);
AutoUtils.autoSize(view);
}
}
}
热心网友 时间:2023-10-16 20:35
题目是老师出的。热心网友 时间:2023-10-16 20:36
现在要这些有什么用,毕设恐怕都基本做完了。