...
|
...
|
@@ -4,12 +4,14 @@ package com.yinhebairong.clasmanage.ui.jxt.fragment.Tz; |
|
|
import android.content.Intent;
|
|
|
import android.support.annotation.Nullable;
|
|
|
import android.support.v4.app.Fragment;
|
|
|
import android.support.v4.widget.SwipeRefreshLayout;
|
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
|
import android.support.v7.widget.RecyclerView;
|
|
|
import android.view.View;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.LinearLayout;
|
|
|
import android.widget.TextView;
|
|
|
import android.widget.Toast;
|
|
|
|
|
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
|
|
import com.chad.library.adapter.base.BaseViewHolder;
|
...
|
...
|
@@ -23,11 +25,14 @@ import com.yinhebairong.clasmanage.m.M; |
|
|
import com.yinhebairong.clasmanage.ui.jxt.activity.TZ.Tjtz_Activity;
|
|
|
import com.yinhebairong.clasmanage.ui.jxt.activity.TZ.TzxqActivity;
|
|
|
import com.yinhebairong.clasmanage.utils.CalendarStringtUtil;
|
|
|
import com.yinhebairong.clasmanage.view.DebugLog;
|
|
|
import com.yinhebairong.clasmanage.view.pickerwheelview.builder.TimePickerBuilder;
|
|
|
import com.yinhebairong.clasmanage.view.pickerwheelview.listener.OnTimeSelectListener;
|
|
|
import com.yinhebairong.clasmanage.view.pickerwheelview.utils.MyDataFormatUtil;
|
|
|
import com.yinhebairong.clasmanage.view.pickerwheelview.view.TimePickerView;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.List;
|
|
|
import java.util.Locale;
|
...
|
...
|
@@ -53,7 +58,17 @@ public class Tz_Rv_Fragment extends BaseFragment { |
|
|
RecyclerView dataRv;
|
|
|
@BindView(R.id.tv_time)
|
|
|
TextView tv_time;
|
|
|
@BindView(R.id.tv_week)
|
|
|
TextView tv_week;
|
|
|
@BindView(R.id.my_sw)
|
|
|
SwipeRefreshLayout my_sw;
|
|
|
|
|
|
private TimePickerView mTimePicker3;//三级时间 年月日
|
|
|
|
|
|
//参数
|
|
|
private int page = 1;
|
|
|
private List<JxttzEntity.DataBeanX.DataBean> mList = new ArrayList<>();
|
|
|
|
|
|
@Override
|
|
|
protected void initView(View root) {
|
|
|
Calendar calendar = Calendar.getInstance();
|
...
|
...
|
@@ -65,37 +80,60 @@ public class Tz_Rv_Fragment extends BaseFragment { |
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA);
|
|
|
String dateString = simpleDateFormat.format(calendar.getTime());
|
|
|
tv_time.setText(dateString);
|
|
|
tv_week.setText(MyDataFormatUtil.dateToWeek(dateString));
|
|
|
|
|
|
mTimePicker3 = new TimePickerBuilder(getActivity(), new OnTimeSelectListener() {
|
|
|
@Override
|
|
|
public void onTimeSelect(String date, View v) {
|
|
|
tv_time.setText(date);
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA);
|
|
|
String dateString = simpleDateFormat.format(calendar.getTime());
|
|
|
if (Config.IDENTITY==0){
|
|
|
if (dateString.equals(date)) {//今天
|
|
|
getDate(2, "");
|
|
|
} else {
|
|
|
getDate(2, date);
|
|
|
}
|
|
|
}else {
|
|
|
if (dateString.equals(date)) {//今天
|
|
|
getParentDate(2, "");
|
|
|
} else {
|
|
|
getParentDate(2, date);
|
|
|
}
|
|
|
}
|
|
|
tv_week.setText(MyDataFormatUtil.dateToWeek(date));
|
|
|
setParam(1);
|
|
|
}
|
|
|
}).setType(new boolean[]{true, true, true, false, false, false}).isDialog(false).setFormat("yyyy-MM-dd").setSelectChangeListener().
|
|
|
setTextXOffset(40, 0, -40, 0, 0, 0).build();
|
|
|
mTimePicker3.isBefore(false);
|
|
|
|
|
|
my_sw.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
|
|
@Override
|
|
|
public void onRefresh() {
|
|
|
Toast.makeText(getActivity(), "下拉刷新成功", Toast.LENGTH_SHORT).show();
|
|
|
my_sw.setRefreshing(false);
|
|
|
setParam(1);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
jxt_tz_adapter = new Jxt_Tz_Adapter(R.layout.item_jxt_tz_item, mList);
|
|
|
dataRv.setLayoutManager(new LinearLayoutManager(getActivity()));
|
|
|
dataRv.setAdapter(jxt_tz_adapter);
|
|
|
jxt_tz_adapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
@Override
|
|
|
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
List<JxttzEntity.DataBeanX.DataBean> dataBeans = adapter.getData();
|
|
|
Intent tzintent = new Intent(getContext(), TzxqActivity.class);
|
|
|
tzintent.putExtra("TzId", dataBeans.get(position).getId() + "");
|
|
|
tzintent.putExtra("isMy", dataBeans.get(position).getIs_author());
|
|
|
startActivity(tzintent);
|
|
|
|
|
|
}
|
|
|
});
|
|
|
jxt_tz_adapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
|
|
|
@Override
|
|
|
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
if (mList.get(position).getIs_author() == 1) {
|
|
|
List<JxttzEntity.DataBeanX.DataBean> dataBeans = adapter.getData();
|
|
|
Intent tzintent = new Intent(getContext(), Tjtz_Activity.class);
|
|
|
tzintent.putExtra("TzId", dataBeans.get(position).getId() + "");
|
|
|
startActivity(tzintent);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
protected void initListener() {
|
|
|
|
|
|
}
|
|
|
|
|
|
@OnClick({R.id.jxt_matter_li})
|
|
|
public void onViewClicked(View view) {
|
|
|
switch (view.getId()) {
|
...
|
...
|
@@ -107,21 +145,19 @@ public class Tz_Rv_Fragment extends BaseFragment { |
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
protected void lazyLoad() {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
protected void refreshLoad() {
|
|
|
if (Config.IDENTITY == 0) {//老师
|
|
|
getDate(2, "");
|
|
|
} else {
|
|
|
getParentDate(2,"");
|
|
|
}
|
|
|
setParam(1);
|
|
|
super.refreshLoad();
|
|
|
}
|
|
|
|
|
|
public void getDate(int type,String date) {
|
|
|
Api().getTzList(Config.Token, type,date)
|
|
|
public void getDate(int type, String date) {
|
|
|
Api().getTzList(Config.Token, type, date,page)
|
|
|
.subscribeOn(Schedulers.io())
|
|
|
.observeOn(AndroidSchedulers.mainThread())
|
|
|
.subscribe(new Observer<JxttzEntity>() {
|
...
|
...
|
@@ -133,36 +169,34 @@ public class Tz_Rv_Fragment extends BaseFragment { |
|
|
@Override
|
|
|
public void onNext(JxttzEntity jxttzEntity) {
|
|
|
if (jxttzEntity.getCode() == M.success) {
|
|
|
List<JxttzEntity.DataBeanX.DataBean> data = jxttzEntity.getData().getData();
|
|
|
jxt_tz_adapter = new Jxt_Tz_Adapter(R.layout.item_jxt_tz_item, data);
|
|
|
dataRv.setLayoutManager(new LinearLayoutManager(getActivity()));
|
|
|
dataRv.setAdapter(jxt_tz_adapter);
|
|
|
jxt_tz_adapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
@Override
|
|
|
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
List<JxttzEntity.DataBeanX.DataBean> dataBeans = adapter.getData();
|
|
|
Intent tzintent = new Intent(getContext(), TzxqActivity.class);
|
|
|
tzintent.putExtra("TzId", dataBeans.get(position).getId() + "");
|
|
|
tzintent.putExtra("isMy", dataBeans.get(position).getIs_author() + "");
|
|
|
startActivity(tzintent);
|
|
|
jxt_tz_adapter.notifyDataSetChanged();
|
|
|
if (page == 1 || page == 0) {
|
|
|
dataRv.scrollToPosition(0);
|
|
|
mList.clear();
|
|
|
}
|
|
|
mList.addAll(jxttzEntity.getData().getData());
|
|
|
|
|
|
}
|
|
|
});
|
|
|
jxt_tz_adapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
|
|
|
page = jxttzEntity.getData().getCurrent_page() + 1;
|
|
|
jxt_tz_adapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
|
|
|
@Override
|
|
|
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
if (jxttzEntity.getData().getData().get(position).getIs_author()==1){
|
|
|
List<JxttzEntity.DataBeanX.DataBean> dataBeans = adapter.getData();
|
|
|
Intent tzintent = new Intent(getContext(), Tjtz_Activity.class);
|
|
|
tzintent.putExtra("TzId", dataBeans.get(position).getId() + "");
|
|
|
startActivity(tzintent);
|
|
|
jxt_tz_adapter.notifyDataSetChanged();
|
|
|
}
|
|
|
public void onLoadMoreRequested() {
|
|
|
dataRv.postDelayed(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
if (jxttzEntity.getData().getCurrent_page() >= jxttzEntity.getData().getLast_page()) {
|
|
|
//数据全部加载完毕
|
|
|
jxt_tz_adapter.loadMoreEnd();
|
|
|
} else {
|
|
|
setParam(page);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}, 1000);
|
|
|
}
|
|
|
});
|
|
|
}, dataRv);
|
|
|
jxt_tz_adapter.notifyDataSetChanged();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void onError(Throwable e) {
|
|
|
if (e.hashCode() == 401) {
|
...
|
...
|
@@ -176,8 +210,8 @@ public class Tz_Rv_Fragment extends BaseFragment { |
|
|
});
|
|
|
}
|
|
|
|
|
|
public void getParentDate(int type,String date) {
|
|
|
Api().getTzJZlist(Config.Token, type,date)
|
|
|
public void getParentDate(int type, String date) {
|
|
|
Api().getTzJZlist(Config.Token, type, date)
|
|
|
.subscribeOn(Schedulers.io())
|
|
|
.observeOn(AndroidSchedulers.mainThread())
|
|
|
.subscribe(new Observer<TzlistJzEntity>() {
|
...
|
...
|
@@ -216,131 +250,147 @@ public class Tz_Rv_Fragment extends BaseFragment { |
|
|
});
|
|
|
}
|
|
|
|
|
|
public static boolean DO_REFRESH = true;
|
|
|
|
|
|
@Override
|
|
|
public void onResume() {
|
|
|
super.onResume();
|
|
|
if (DO_REFRESH) {
|
|
|
setParam(1);
|
|
|
DO_REFRESH=false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 设置参数-请求
|
|
|
*
|
|
|
* @param page 页
|
|
|
*/
|
|
|
private void setParam(int page) {
|
|
|
DebugLog.e("wkk2====" + DO_REFRESH);
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA);
|
|
|
String dateString = simpleDateFormat.format(calendar.getTime());
|
|
|
if (Config.IDENTITY == 0) {//老师
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA);
|
|
|
String dateString = simpleDateFormat.format(calendar.getTime());
|
|
|
if (dateString.equals(tv_time.getText().toString())) {//今天
|
|
|
this.page = page;
|
|
|
getDate(2, "");
|
|
|
} else {
|
|
|
this.page = page;
|
|
|
getDate(2, tv_time.getText().toString());
|
|
|
}
|
|
|
} else {
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA);
|
|
|
String dateString = simpleDateFormat.format(calendar.getTime());
|
|
|
if (dateString.equals(tv_time.getText().toString())) {//今天
|
|
|
getParentDate(2,"");
|
|
|
|
|
|
this.page = page;
|
|
|
getParentDate(2, "");
|
|
|
} else {
|
|
|
this.page = page;
|
|
|
getParentDate(2, tv_time.getText().toString());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
class Jxt_Tz_Adapter extends BaseQuickAdapter<JxttzEntity.DataBeanX.DataBean, BaseViewHolder> {
|
|
|
public Jxt_Tz_Adapter(int layoutResId, @Nullable List<JxttzEntity.DataBeanX.DataBean> data) {
|
|
|
super(layoutResId, data);
|
|
|
}
|
|
|
|
|
|
class Jxt_Tz_Adapter extends BaseQuickAdapter<JxttzEntity.DataBeanX.DataBean, BaseViewHolder> {
|
|
|
public Jxt_Tz_Adapter(int layoutResId, @Nullable List<JxttzEntity.DataBeanX.DataBean> data) {
|
|
|
super(layoutResId, data);
|
|
|
@Override
|
|
|
protected void convert(BaseViewHolder helper, JxttzEntity.DataBeanX.DataBean item) {
|
|
|
TextView leixing_text = helper.itemView.findViewById(R.id.leixing_text);
|
|
|
ImageView leixin_cone = helper.itemView.findViewById(R.id.leixin_cone);
|
|
|
TextView state_text = helper.itemView.findViewById(R.id.state_text);
|
|
|
TextView title = helper.itemView.findViewById(R.id.title);
|
|
|
TextView content_tv = helper.itemView.findViewById(R.id.content_tv);
|
|
|
TextView class_tv = helper.itemView.findViewById(R.id.class_tv);
|
|
|
TextView teacher_tv = helper.itemView.findViewById(R.id.teacher_tv);
|
|
|
TextView date_tv = helper.itemView.findViewById(R.id.date_tv);
|
|
|
TextView state_tv = helper.itemView.findViewById(R.id.state_tv);
|
|
|
TextView yellow_tv = helper.itemView.findViewById(R.id.yellow_tv);
|
|
|
TextView gray_tv = helper.itemView.findViewById(R.id.gray_tv);
|
|
|
TextView massage_num = helper.itemView.findViewById(R.id.massage_num);
|
|
|
LinearLayout ck_lin = helper.itemView.findViewById(R.id.ck_lin);
|
|
|
if (item.getLabel().equals("通知")) {
|
|
|
leixing_text.setText(item.getLabel());
|
|
|
leixin_cone.setImageResource(R.mipmap.icon_worktz2);
|
|
|
leixing_text.setBackgroundResource(R.mipmap.icon_worktz1);
|
|
|
} else if (item.getLabel().equals("喜报")) {
|
|
|
leixing_text.setText(item.getLabel());
|
|
|
leixin_cone.setImageResource(R.mipmap.icon_news2);
|
|
|
leixing_text.setBackgroundResource(R.mipmap.icon_news1);
|
|
|
} else if (item.getLabel().equals("警示")) {
|
|
|
leixing_text.setText(item.getLabel());
|
|
|
leixin_cone.setImageResource(R.mipmap.icon_caution2);
|
|
|
leixing_text.setBackgroundResource(R.mipmap.icon_caution1);
|
|
|
}
|
|
|
title.setText(item.getTitle());
|
|
|
content_tv.setText(item.getContent());
|
|
|
class_tv.setText(item.getClass_name());
|
|
|
teacher_tv.setText(item.getTeacher_name());
|
|
|
date_tv.setText(item.getDate());
|
|
|
yellow_tv.setText(item.getView_num() + "");
|
|
|
gray_tv.setText("/" + item.getTotal_num());
|
|
|
helper.addOnClickListener(R.id.ck_lin);
|
|
|
state_tv.setText(item.getStatus_text());
|
|
|
if (item.getUncomment_num().equals("")) {
|
|
|
massage_num.setVisibility(View.GONE);
|
|
|
} else {
|
|
|
massage_num.setText(item.getUncomment_num() + "");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
protected void convert(BaseViewHolder helper, JxttzEntity.DataBeanX.DataBean item) {
|
|
|
TextView leixing_text = helper.itemView.findViewById(R.id.leixing_text);
|
|
|
ImageView leixin_cone = helper.itemView.findViewById(R.id.leixin_cone);
|
|
|
TextView state_text = helper.itemView.findViewById(R.id.state_text);
|
|
|
TextView title = helper.itemView.findViewById(R.id.title);
|
|
|
TextView content_tv = helper.itemView.findViewById(R.id.content_tv);
|
|
|
TextView class_tv = helper.itemView.findViewById(R.id.class_tv);
|
|
|
TextView teacher_tv = helper.itemView.findViewById(R.id.teacher_tv);
|
|
|
TextView date_tv = helper.itemView.findViewById(R.id.date_tv);
|
|
|
TextView state_tv = helper.itemView.findViewById(R.id.state_tv);
|
|
|
TextView yellow_tv = helper.itemView.findViewById(R.id.yellow_tv);
|
|
|
TextView gray_tv = helper.itemView.findViewById(R.id.gray_tv);
|
|
|
TextView massage_num = helper.itemView.findViewById(R.id.massage_num);
|
|
|
LinearLayout ck_lin = helper.itemView.findViewById(R.id.ck_lin);
|
|
|
if (item.getLabel().equals("通知")){
|
|
|
leixing_text.setText(item.getLabel());
|
|
|
leixin_cone.setImageResource(R.mipmap.icon_worktz2);
|
|
|
leixing_text.setBackgroundResource(R.mipmap.icon_worktz1);
|
|
|
}else if (item.getLabel().equals("喜报")){
|
|
|
leixing_text.setText(item.getLabel());
|
|
|
leixin_cone.setImageResource(R.mipmap.icon_news2);
|
|
|
leixing_text.setBackgroundResource(R.mipmap.icon_news1);
|
|
|
}else if (item.getLabel().equals("警示")){
|
|
|
leixing_text.setText(item.getLabel());
|
|
|
leixin_cone.setImageResource(R.mipmap.icon_caution2);
|
|
|
leixing_text.setBackgroundResource(R.mipmap.icon_caution1);
|
|
|
}
|
|
|
title.setText(item.getTitle());
|
|
|
content_tv.setText(item.getContent());
|
|
|
class_tv.setText(item.getClass_name());
|
|
|
teacher_tv.setText(item.getTeacher_name());
|
|
|
date_tv.setText(item.getDate());
|
|
|
yellow_tv.setText(item.getView_num() + "");
|
|
|
gray_tv.setText("/" + item.getTotal_num());
|
|
|
helper.addOnClickListener(R.id.ck_lin);
|
|
|
state_tv.setText(item.getStatus_text());
|
|
|
if (item.getUncomment_num().equals("")){
|
|
|
massage_num.setVisibility(View.GONE);
|
|
|
}else {
|
|
|
massage_num.setText(item.getUncomment_num()+"");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
class Jxt_Tz_jzAdapter extends BaseQuickAdapter<TzlistJzEntity.DataBeanX.DataBean, BaseViewHolder> {
|
|
|
|
|
|
public Jxt_Tz_jzAdapter(int layoutResId, @Nullable List<TzlistJzEntity.DataBeanX.DataBean> data) {
|
|
|
super(layoutResId, data);
|
|
|
}
|
|
|
class Jxt_Tz_jzAdapter extends BaseQuickAdapter<TzlistJzEntity.DataBeanX.DataBean,BaseViewHolder>{
|
|
|
|
|
|
public Jxt_Tz_jzAdapter(int layoutResId, @Nullable List<TzlistJzEntity.DataBeanX.DataBean> data) {
|
|
|
super(layoutResId, data);
|
|
|
@Override
|
|
|
protected void convert(BaseViewHolder helper, TzlistJzEntity.DataBeanX.DataBean item) {
|
|
|
TextView leixing_text = helper.itemView.findViewById(R.id.leixing_text);
|
|
|
TextView title = helper.itemView.findViewById(R.id.title);
|
|
|
ImageView leixin_cone = helper.itemView.findViewById(R.id.leixin_cone);
|
|
|
TextView content_tv = helper.itemView.findViewById(R.id.content_tv);
|
|
|
TextView class_tv = helper.itemView.findViewById(R.id.class_tv);
|
|
|
TextView teacher_tv = helper.itemView.findViewById(R.id.teacher_tv);
|
|
|
TextView date_tv = helper.itemView.findViewById(R.id.date_tv);
|
|
|
TextView state_tv = helper.itemView.findViewById(R.id.state_tv);
|
|
|
TextView yellow_tv = helper.itemView.findViewById(R.id.yellow_tv);
|
|
|
TextView gray_tv = helper.itemView.findViewById(R.id.gray_tv);
|
|
|
TextView massage_num = helper.itemView.findViewById(R.id.massage_num);
|
|
|
LinearLayout ck_lin = helper.itemView.findViewById(R.id.ck_lin);
|
|
|
if (item.getLabel().equals("通知")) {
|
|
|
leixing_text.setText(item.getLabel());
|
|
|
leixin_cone.setImageResource(R.mipmap.icon_worktz2);
|
|
|
leixing_text.setBackgroundResource(R.mipmap.icon_worktz1);
|
|
|
} else if (item.getLabel().equals("喜报")) {
|
|
|
leixing_text.setText(item.getLabel());
|
|
|
leixin_cone.setImageResource(R.mipmap.icon_news2);
|
|
|
leixing_text.setBackgroundResource(R.mipmap.icon_news1);
|
|
|
} else if (item.getLabel().equals("警示")) {
|
|
|
leixing_text.setText(item.getLabel());
|
|
|
leixin_cone.setImageResource(R.mipmap.icon_caution2);
|
|
|
leixing_text.setBackgroundResource(R.mipmap.icon_caution1);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
protected void convert(BaseViewHolder helper, TzlistJzEntity.DataBeanX.DataBean item) {
|
|
|
TextView leixing_text = helper.itemView.findViewById(R.id.leixing_text);
|
|
|
TextView title = helper.itemView.findViewById(R.id.title);
|
|
|
ImageView leixin_cone = helper.itemView.findViewById(R.id.leixin_cone);
|
|
|
TextView content_tv = helper.itemView.findViewById(R.id.content_tv);
|
|
|
TextView class_tv = helper.itemView.findViewById(R.id.class_tv);
|
|
|
TextView teacher_tv = helper.itemView.findViewById(R.id.teacher_tv);
|
|
|
TextView date_tv = helper.itemView.findViewById(R.id.date_tv);
|
|
|
TextView state_tv = helper.itemView.findViewById(R.id.state_tv);
|
|
|
TextView yellow_tv = helper.itemView.findViewById(R.id.yellow_tv);
|
|
|
TextView gray_tv = helper.itemView.findViewById(R.id.gray_tv);
|
|
|
TextView massage_num = helper.itemView.findViewById(R.id.massage_num);
|
|
|
LinearLayout ck_lin = helper.itemView.findViewById(R.id.ck_lin);
|
|
|
if (item.getLabel().equals("通知")){
|
|
|
leixing_text.setText(item.getLabel());
|
|
|
leixin_cone.setImageResource(R.mipmap.icon_worktz2);
|
|
|
leixing_text.setBackgroundResource(R.mipmap.icon_worktz1);
|
|
|
}else if (item.getLabel().equals("喜报")){
|
|
|
leixing_text.setText(item.getLabel());
|
|
|
leixin_cone.setImageResource(R.mipmap.icon_news2);
|
|
|
leixing_text.setBackgroundResource(R.mipmap.icon_news1);
|
|
|
}else if (item.getLabel().equals("警示")){
|
|
|
leixing_text.setText(item.getLabel());
|
|
|
leixin_cone.setImageResource(R.mipmap.icon_caution2);
|
|
|
leixing_text.setBackgroundResource(R.mipmap.icon_caution1);
|
|
|
}
|
|
|
title.setText(item.getTitle());
|
|
|
content_tv.setText(item.getContent());
|
|
|
class_tv.setText(item.getClass_name());
|
|
|
teacher_tv.setText(item.getTeacher_name());
|
|
|
date_tv.setText(item.getDate());
|
|
|
yellow_tv.setText(item.getView_num() + "");
|
|
|
gray_tv.setText("/" + item.getTotal_num());
|
|
|
yellow_tv.setVisibility(View.GONE);
|
|
|
gray_tv.setVisibility(View.GONE);
|
|
|
helper.addOnClickListener(R.id.ck_lin);
|
|
|
state_tv.setText(item.getStatus_text());
|
|
|
if (item.getStatus()==2){
|
|
|
massage_num.setVisibility(View.GONE);
|
|
|
}else {
|
|
|
massage_num.setText(1+"");
|
|
|
}
|
|
|
title.setText(item.getTitle());
|
|
|
content_tv.setText(item.getContent());
|
|
|
class_tv.setText(item.getClass_name());
|
|
|
teacher_tv.setText(item.getTeacher_name());
|
|
|
date_tv.setText(item.getDate());
|
|
|
yellow_tv.setText(item.getView_num() + "");
|
|
|
gray_tv.setText("/" + item.getTotal_num());
|
|
|
yellow_tv.setVisibility(View.GONE);
|
|
|
gray_tv.setVisibility(View.GONE);
|
|
|
helper.addOnClickListener(R.id.ck_lin);
|
|
|
state_tv.setText(item.getStatus_text());
|
|
|
if (item.getStatus() == 2) {
|
|
|
massage_num.setVisibility(View.GONE);
|
|
|
} else {
|
|
|
massage_num.setText(1 + "");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|