...
|
...
|
@@ -2,6 +2,7 @@ package com.yinhebairong.clasmanage.ui.jxt.fragment.Tz; |
|
|
|
|
|
|
|
|
import android.content.Intent;
|
|
|
import android.preference.PreferenceManager;
|
|
|
import android.support.annotation.NonNull;
|
|
|
import android.support.annotation.Nullable;
|
|
|
import android.support.v4.app.Fragment;
|
...
|
...
|
@@ -143,7 +144,11 @@ public class Tz_Rv_Fragment extends BaseFragment { |
|
|
List<TzlistJzEntity.DataBeanX.DataBean> dataBeans = adapter.getData();
|
|
|
Intent tzintent = new Intent(getContext(), TzxqActivity.class);
|
|
|
tzintent.putExtra("TzId", dataBeans.get(position).getId() + "");
|
|
|
startActivityForResult(tzintent, 100);
|
|
|
tzintent.putExtra("position",position);
|
|
|
getActivity().startActivityForResult(tzintent, 101);
|
|
|
// ((TzlistJzEntity.DataBeanX.DataBean) adapter.getData().get(position)).setIs_read(1);
|
|
|
// ((TzlistJzEntity.DataBeanX.DataBean) adapter.getData().get(position)).setStatus_text("已查看");
|
|
|
// adapter.notifyDataSetChanged();
|
|
|
}
|
|
|
});
|
|
|
}
|
...
|
...
|
@@ -237,6 +242,7 @@ public class Tz_Rv_Fragment extends BaseFragment { |
|
|
}
|
|
|
|
|
|
public void getParentDate(int type, String date) {
|
|
|
DebugLog.e("wkk4====" + DO_REFRESH);
|
|
|
Api().getTzJZlist(Config.Token, type, date)
|
|
|
.subscribeOn(Schedulers.io())
|
|
|
.observeOn(AndroidSchedulers.mainThread())
|
...
|
...
|
@@ -252,7 +258,7 @@ public class Tz_Rv_Fragment extends BaseFragment { |
|
|
List<TzlistJzEntity.DataBeanX.DataBean> data = tzlistJzEntity.getData().getData();
|
|
|
if (page == 1 || page == 0) {
|
|
|
dataRv.scrollToPosition(0);
|
|
|
mList.clear();
|
|
|
mjzList.clear();
|
|
|
}
|
|
|
mjzList.addAll(tzlistJzEntity.getData().getData());
|
|
|
page = tzlistJzEntity.getData().getCurrent_page() + 1;
|
...
|
...
|
@@ -276,12 +282,13 @@ public class Tz_Rv_Fragment extends BaseFragment { |
|
|
});
|
|
|
}
|
|
|
|
|
|
public static boolean DO_REFRESH = true;
|
|
|
public static boolean DO_REFRESH = false;
|
|
|
|
|
|
@Override
|
|
|
public void onResume() {
|
|
|
super.onResume();
|
|
|
if (DO_REFRESH) {
|
|
|
DebugLog.e("1wkk2====" + DO_REFRESH);
|
|
|
setParam(1);
|
|
|
DO_REFRESH = false;
|
|
|
}
|
...
|
...
|
@@ -315,6 +322,19 @@ public class Tz_Rv_Fragment extends BaseFragment { |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
|
super.onActivityResult(requestCode, resultCode, data);
|
|
|
if (requestCode == 101) {//成功的查看,要刷新相应位置
|
|
|
if(Config.IDENTITY==1){
|
|
|
int position=data.getIntExtra("position",0);
|
|
|
((TzlistJzEntity.DataBeanX.DataBean) jxt_tz_jzAdapter.getData().get(position)).setIs_read(1);
|
|
|
((TzlistJzEntity.DataBeanX.DataBean) jxt_tz_jzAdapter.getData().get(position)).setStatus_text("已查看");
|
|
|
jxt_tz_jzAdapter.notifyDataSetChanged();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
class Jxt_Tz_Adapter extends BaseQuickAdapter<JxttzEntity.DataBeanX.DataBean, BaseViewHolder> {
|
...
|
...
|
@@ -358,7 +378,7 @@ class Jxt_Tz_Adapter extends BaseQuickAdapter<JxttzEntity.DataBeanX.DataBean, Ba |
|
|
yellow_tv.setText(item.getView_num() + "");
|
|
|
gray_tv.setText("/" + item.getTotal_num());
|
|
|
helper.addOnClickListener(R.id.ck_lin);
|
|
|
state_tv.setText(item.getStatus_text());
|
|
|
state_tv.setText(item.getStatus_text());//已查看 未查看
|
|
|
// if (item.getUncomment_num().equals("")) {
|
|
|
// massage_num.setVisibility(View.GONE);
|
|
|
// } else {
|
...
|
...
|
@@ -426,10 +446,18 @@ class Jxt_Tz_jzAdapter extends BaseQuickAdapter<TzlistJzEntity.DataBeanX.DataBea |
|
|
ll_chakan.setVisibility(View.GONE);
|
|
|
helper.addOnClickListener(R.id.ck_lin);
|
|
|
state_tv.setText(item.getStatus_text());
|
|
|
if (item.getStatus() == 2) {
|
|
|
|
|
|
if (item.getIs_read() == 1) {//已读
|
|
|
massage_num.setVisibility(View.GONE);
|
|
|
} else {
|
|
|
massage_num.setText(1 + "");
|
|
|
massage_num.setVisibility(View.VISIBLE);
|
|
|
massage_num.setText("1");
|
|
|
}
|
|
|
|
|
|
// if (item.getStatus() == 2) {
|
|
|
// massage_num.setVisibility(View.GONE);
|
|
|
// } else {
|
|
|
// massage_num.setText(1 + "");
|
|
|
// }
|
|
|
}
|
|
|
} |
...
|
...
|
|