|
@@ -1,6 +1,7 @@
|
|
|
package com.cooleshow.teacher.ui.message;
|
|
|
|
|
|
import android.os.Bundle;
|
|
|
+import android.text.TextUtils;
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.widget.ImageView;
|
|
@@ -14,9 +15,12 @@ import com.alibaba.android.arouter.facade.annotation.Route;
|
|
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
|
|
import com.chad.library.adapter.base.listener.OnItemClickListener;
|
|
|
import com.chad.library.adapter.base.listener.OnLoadMoreListener;
|
|
|
+import com.cooleshow.base.bean.RouteBean;
|
|
|
import com.cooleshow.base.constanst.Constants;
|
|
|
import com.cooleshow.base.router.RouterPath;
|
|
|
import com.cooleshow.base.ui.activity.BaseMVPActivity;
|
|
|
+import com.cooleshow.base.utils.GsonUtils;
|
|
|
+import com.cooleshow.base.utils.JumpUtils;
|
|
|
import com.cooleshow.teacher.R;
|
|
|
import com.cooleshow.teacher.adapter.MessageBoxAdapter;
|
|
|
import com.cooleshow.teacher.bean.CountOfUnreadBean;
|
|
@@ -24,9 +28,12 @@ import com.cooleshow.teacher.bean.SystemMessageBean;
|
|
|
import com.cooleshow.teacher.contract.MessageBoxContract;
|
|
|
import com.cooleshow.teacher.databinding.ActivityMessageBoxBinding;
|
|
|
import com.cooleshow.teacher.presenter.message.MessageBoxPresenter;
|
|
|
+import com.google.gson.Gson;
|
|
|
import com.scwang.smart.refresh.layout.api.RefreshLayout;
|
|
|
import com.scwang.smart.refresh.layout.listener.OnRefreshListener;
|
|
|
|
|
|
+import org.json.JSONObject;
|
|
|
+
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -47,7 +54,7 @@ public class MessageBoxActivity extends BaseMVPActivity<ActivityMessageBoxBindin
|
|
|
public void onClick(View view) {
|
|
|
switch (view.getId()) {
|
|
|
case R.id.cl_all:
|
|
|
- if (group.equals("")){
|
|
|
+ if (group.equals("")) {
|
|
|
break;
|
|
|
}
|
|
|
group = "";
|
|
@@ -57,7 +64,7 @@ public class MessageBoxActivity extends BaseMVPActivity<ActivityMessageBoxBindin
|
|
|
queryList(true);
|
|
|
break;
|
|
|
case R.id.cl_course:
|
|
|
- if (group.equals("COURSE")){
|
|
|
+ if (group.equals("COURSE")) {
|
|
|
break;
|
|
|
}
|
|
|
group = "COURSE";
|
|
@@ -67,7 +74,7 @@ public class MessageBoxActivity extends BaseMVPActivity<ActivityMessageBoxBindin
|
|
|
queryList(true);
|
|
|
break;
|
|
|
case R.id.cl_system:
|
|
|
- if (group.equals("SYSTEM")){
|
|
|
+ if (group.equals("SYSTEM")) {
|
|
|
break;
|
|
|
}
|
|
|
group = "SYSTEM";
|
|
@@ -131,6 +138,14 @@ public class MessageBoxActivity extends BaseMVPActivity<ActivityMessageBoxBindin
|
|
|
if (item.readStatus == 0) {
|
|
|
presenter.setCurrentRead(item.id);
|
|
|
}
|
|
|
+ if (!TextUtils.isEmpty(item.memo)) {
|
|
|
+ try {
|
|
|
+ RouteBean routeBean = GsonUtils.fromJson(item.memo, RouteBean.class);
|
|
|
+ JumpUtils.jump(routeBean);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|