Browse Source

Merge branch 'sheep_develop' of 10.8.230.114:xmy_android/small_sheep_android into sheep_develop

hanjing 7 years ago
parent
commit
f7074a90c5

+ 4 - 8
app/src/main/java/com/sheep/gamegroup/model/util/SheepSubscriber.java

@@ -79,15 +79,10 @@ public abstract class SheepSubscriber<T> implements Observer<T> {
                 //token 过期
                 //token 过期
                 if (throwable.code == 401) {
                 if (throwable.code == 401) {
                     Activity curAct = SheepApp.getInstance().getCurrentActivity();
                     Activity curAct = SheepApp.getInstance().getCurrentActivity();
-                    if (curAct != null) {
-                        if (curAct instanceof LoginAct || UMConfigUtils.isNotNeedAct(curAct)) {//本身就是登录界面 或者可以不用登录就存在的界面,如:支付界面
-                        } else {
-                            SpUtils.saveToken(SheepApp.getInstance(), "");
-                            Jump2View.getInstance().gotoLoginAgain(baseMessage.getMsg());
-                            return;
-                        }
+                    if (curAct instanceof LoginAct || UMConfigUtils.isNotNeedAct(curAct)) {//本身就是登录界面 或者可以不用登录就存在的界面,如:支付界面
                     } else {
                     } else {
-
+                        Jump2View.getInstance().gotoLoginAgain();
+                        return;
                     }
                     }
                 }
                 }
                 //未绑定手机号
                 //未绑定手机号
@@ -96,6 +91,7 @@ public abstract class SheepSubscriber<T> implements Observer<T> {
                     return;
                     return;
                 } else if (baseMessage.getCode() == 1002) {
                 } else if (baseMessage.getCode() == 1002) {
                     Jump2View.getInstance().gotoLoginAgain();
                     Jump2View.getInstance().gotoLoginAgain();
+                    return;
                 }
                 }
 
 
                 if (baseMessage.getCode() == 0)
                 if (baseMessage.getCode() == 0)

+ 8 - 4
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -1501,9 +1501,13 @@ public class Jump2View {
     }
     }
 
 
     public void gotoLoginAgain(String o) {
     public void gotoLoginAgain(String o) {
+        String token = SpUtils.getToken(SheepApp.getInstance());
+        if(TextUtils.isEmpty(token)) {
+            return;
+        }
         SpUtils.saveToken(SheepApp.getInstance(), "");
         SpUtils.saveToken(SheepApp.getInstance(), "");
         DataUtil.getInstance().clearData();
         DataUtil.getInstance().clearData();
-        G.showToast(TextUtils.isEmpty(o) ? "请重新登录" : o);
+        G.showToast(TextUtils.isEmpty(o) ? "登录信息已过期,请重新登录" : o);
         Intent intent = new Intent(SheepApp.getInstance(), ActMain.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         Intent intent = new Intent(SheepApp.getInstance(), ActMain.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         intent.putExtra("INTENT_ACTION", "LOGOUT");
         intent.putExtra("INTENT_ACTION", "LOGOUT");
         SheepApp.getInstance().startActivity(intent);
         SheepApp.getInstance().startActivity(intent);
@@ -2344,11 +2348,11 @@ public class Jump2View {
     /**
     /**
      * 跳转游戏评论详情界面
      * 跳转游戏评论详情界面
      *
      *
-     * @param context
      * @param user_comment_id
      * @param user_comment_id
      */
      */
-    public void goActAppCommentDetail(Context context, int user_comment_id) {
-        context.startActivity(DataUtil.putObject(new Intent(context, ActUserCommentDetail.class), user_comment_id));
+    public void goActAppCommentDetail(int user_comment_id) {
+        Activity activity = SheepApp.getInstance().getCurrentActivity();
+        activity.startActivity(DataUtil.putObject(new Intent(activity, ActUserCommentDetail.class), user_comment_id));
     }
     }
 
 
     /**
     /**

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java

@@ -1306,6 +1306,7 @@ public class ViewUtil {
                 }
                 }
             });
             });
         }
         }
+        dialog.setCancelable(false);
         try {
         try {
             dialog.show();
             dialog.show();
         } catch (Exception e) {
         } catch (Exception e) {

+ 14 - 6
app/src/main/java/com/sheep/gamegroup/util/viewHelper/UserCommentHelper.java

@@ -25,6 +25,7 @@ import com.sheep.jiuyan.samllsheep.utils.G;
  */
  */
 public class UserCommentHelper {
 public class UserCommentHelper {
     protected View rootView;
     protected View rootView;
+    protected boolean goComment = true;//是否 点击评论图标后可以跳转到评论详情界面
 
 
     public UserCommentHelper(int rootViewId) {
     public UserCommentHelper(int rootViewId) {
         this.rootView = LayoutInflater.from(SheepApp.getInstance()).inflate(rootViewId, null);
         this.rootView = LayoutInflater.from(SheepApp.getInstance()).inflate(rootViewId, null);
@@ -36,6 +37,11 @@ public class UserCommentHelper {
         initView();
         initView();
     }
     }
 
 
+    public UserCommentHelper setGoComment(boolean goComment) {
+        this.goComment = goComment;
+        return this;
+    }
+
     public View getRootView() {
     public View getRootView() {
         return rootView;
         return rootView;
     }
     }
@@ -81,12 +87,14 @@ public class UserCommentHelper {
                 Jump2View.getInstance().goActUserAppHome(rootView.getContext(), item.getUser_id());
                 Jump2View.getInstance().goActUserAppHome(rootView.getContext(), item.getUser_id());
             }
             }
         });
         });
-        user_comment_detail_num1.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View view) {
-                Jump2View.getInstance().goActAppCommentDetail(view.getContext(), item.getId());
-            }
-        });
+        if(goComment){
+            user_comment_detail_num1.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View view) {
+                    Jump2View.getInstance().goActAppCommentDetail(item.getId());
+                }
+            });
+        }
         user_comment_detail_num2.setOnClickListener(new View.OnClickListener() {
         user_comment_detail_num2.setOnClickListener(new View.OnClickListener() {
             @Override
             @Override
             public void onClick(View view) {
             public void onClick(View view) {

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/adapter/AdpArticleComment.java

@@ -71,7 +71,7 @@ public class AdpArticleComment extends BaseQuickAdapter<UserComment, BaseViewHol
                 @Override
                 @Override
                 public void onClick(View view) {
                 public void onClick(View view) {
                     //跳转评论详情界面
                     //跳转评论详情界面
-                    Jump2View.getInstance().goActAppCommentDetail(view.getContext(), item.getId());
+                    Jump2View.getInstance().goActAppCommentDetail(item.getId());
                 }
                 }
             });
             });
         }
         }

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/adapter/AdpGcGameAppComment.java

@@ -62,7 +62,7 @@ public class AdpGcGameAppComment extends BaseQuickAdapter<UserComment, BaseViewH
             @Override
             @Override
             public void onClick(View view) {
             public void onClick(View view) {
                 //跳转游戏评论详情界面
                 //跳转游戏评论详情界面
-                Jump2View.getInstance().goActAppCommentDetail(view.getContext(), item.getId());
+                Jump2View.getInstance().goActAppCommentDetail(item.getId());
             }
             }
         });
         });
         game_app_comment_user_avatar.setOnClickListener(new View.OnClickListener() {
         game_app_comment_user_avatar.setOnClickListener(new View.OnClickListener() {

+ 1 - 4
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtUserCommentDetail.java

@@ -3,8 +3,6 @@ package com.sheep.gamegroup.view.fragment;
 import android.content.DialogInterface;
 import android.content.DialogInterface;
 import android.support.annotation.NonNull;
 import android.support.annotation.NonNull;
 import android.support.v7.widget.RecyclerView;
 import android.support.v7.widget.RecyclerView;
-import android.text.TextUtils;
-import android.view.KeyEvent;
 import android.view.LayoutInflater;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View;
 import android.widget.EditText;
 import android.widget.EditText;
@@ -25,7 +23,6 @@ import com.sheep.gamegroup.model.entity.UserCommentReply;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.ApiJSONUtil;
 import com.sheep.gamegroup.util.ApiJSONUtil;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.Jump2View;
-import com.sheep.gamegroup.util.KeyEventUtil;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.RefreshUtil;
 import com.sheep.gamegroup.util.RefreshUtil;
 import com.sheep.gamegroup.util.TestUtil;
 import com.sheep.gamegroup.util.TestUtil;
@@ -169,7 +166,7 @@ public class FgtUserCommentDetail extends BaseListFragment3<UserCommentReply> im
 
 
     //初始化headerView
     //初始化headerView
     private void initHeaderView() {
     private void initHeaderView() {
-        headerViewHelper = new UserCommentHelper(R.layout.header_user_comment_detail);
+        headerViewHelper = new UserCommentHelper(R.layout.header_user_comment_detail).setGoComment(false);
         total_count_tv = headerViewHelper.getRootView().findViewById(R.id.total_count_tv);
         total_count_tv = headerViewHelper.getRootView().findViewById(R.id.total_count_tv);
         user_comment_detail_game_ll = headerViewHelper.getRootView().findViewById(R.id.user_comment_detail_game_ll);
         user_comment_detail_game_ll = headerViewHelper.getRootView().findViewById(R.id.user_comment_detail_game_ll);
         user_comment_detail_line1 = headerViewHelper.getRootView().findViewById(R.id.user_comment_detail_line1);
         user_comment_detail_line1 = headerViewHelper.getRootView().findViewById(R.id.user_comment_detail_line1);