浏览代码

回到集福袋后尝试刷新

zengjiebin 7 年之前
父节点
当前提交
d4b9f0c9ca

+ 10 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/WebParams.java

@@ -17,6 +17,7 @@ public class WebParams implements Serializable {
     private boolean needJsInteract = true;
     private boolean showTitle = true;
     private boolean forResult = false;
+    private boolean refreshClick = false;
     private int action;
     private String tokenKey = "authorization";
     private String invitationCodeKey = "invitation_code";
@@ -50,6 +51,15 @@ public class WebParams implements Serializable {
         return forResult;
     }
 
+    public boolean isRefreshClick() {
+        return refreshClick;
+    }
+
+    public WebParams setRefreshClick(boolean refreshClick) {
+        this.refreshClick = refreshClick;
+        return this;
+    }
+
     public WebParams setForResult(boolean forResult) {
         this.forResult = forResult;
         return this;

+ 10 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActWebX5.java

@@ -443,6 +443,16 @@ public class ActWebX5 extends BaseActWeb {
         ViewUtil.loadJs(mWebView, js);
     }
 
+    private int onResumeCount = 0;
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if(onResumeCount > 0 && mWebView != null && webParams.isRefreshClick()){
+            loadJs("refreshClick()");
+        }
+        onResumeCount ++;
+    }
+
     @Override
     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
         if (requestCode == FILECHOOSER_RESULTCODE) {