Explorar o código

删除游戏详情中的分享

zengjiebin %!s(int64=8) %!d(string=hai) anos
pai
achega
72557f7e94

+ 1 - 0
app/src/main/AndroidManifest.xml

@@ -322,6 +322,7 @@
             android:theme="@android:style/Theme.Translucent.NoTitleBar"
             android:configChanges="orientation|keyboardHidden|screenSize"/>
         <activity android:name="com.sheep.gamegroup.view.activity.CommitWxAct" />
+        <activity android:name="com.sheep.gamegroup.view.activity.ActGuideOnHook" />
 
 
         <!--友盟start-->

+ 3 - 1
app/src/main/java/com/sheep/gamegroup/model/util/SheepSubscriber.java

@@ -46,7 +46,9 @@ public abstract class SheepSubscriber<T> extends Subscriber<T> {
         if(e instanceof Exception){
             //访问获得对应的Exception
             ExceptionHandle.ResponeThrowable throwable = ExceptionHandle.handleException(e);
-            onError(JSONObject.parseObject(throwable.message, BaseMessage.class));
+            BaseMessage baseMessage = JSONObject.parseObject(throwable.message, BaseMessage.class);
+            baseMessage.setCode(throwable.code);
+            onError(baseMessage);
         }else {
             //将Throwable 和 未知错误的status code返回
             onError(new ExceptionHandle.ResponeThrowable(e,ExceptionHandle.ERROR.UNKNOWN));

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

@@ -2,18 +2,18 @@ package com.sheep.gamegroup.util;
 
 import android.content.Context;
 import android.content.Intent;
-import android.os.Bundle;
 
 import com.kfzs.duanduan.ActMain;
+import com.kfzs.duanduan.bean.KFIntentKeys;
 import com.sheep.gamegroup.model.entity.TaskEty;
 import com.sheep.gamegroup.view.activity.AccountAndSecurityAct;
+import com.sheep.gamegroup.view.activity.ActGuideOnHook;
 import com.sheep.gamegroup.view.activity.AskGetMoneyAct;
 import com.sheep.gamegroup.view.activity.AuthenticationAct;
 import com.sheep.gamegroup.view.activity.BindDataAct;
 import com.sheep.gamegroup.view.activity.BindOrChangeWeixinAct;
 import com.sheep.gamegroup.view.activity.CommitWxAct;
 import com.sheep.gamegroup.view.activity.DialogActivity;
-import com.sheep.gamegroup.view.activity.HomePageAct;
 import com.sheep.gamegroup.view.activity.LieMakeMoneyAct;
 import com.sheep.gamegroup.view.activity.LoginAct;
 import com.sheep.gamegroup.view.activity.PersonalCenterAct;
@@ -24,8 +24,6 @@ import com.sheep.gamegroup.view.activity.WithdrawalAct;
 import com.sheep.gamegroup.view.activity.WithdrawalListAct;
 import com.sheep.gamegroup.view.activity.WithdrawalResultAct;
 
-import javax.inject.Inject;
-
 /**
  * Created by ljy on 2018/3/18.
  */
@@ -176,6 +174,19 @@ public class Jump2View {
      * @param context
      * @param o
      */
+    public void goGuideOnHook(Context context, Object o){
+        Intent intent = new Intent(context, ActGuideOnHook.class);
+//        extraUrl = getIntent().getStringExtra(KFIntentKeys.EXTRA_WEBVIEW_URL);
+//        extraTitle = getIntent().getStringExtra(KFIntentKeys.EXTRA_WEBVIEW_TITLE);
+        intent.putExtra(KFIntentKeys.EXTRA_WEBVIEW_URL, "https://qiniu.kuaifazs.com/weixin.html");
+        intent.putExtra(KFIntentKeys.EXTRA_WEBVIEW_TITLE, "挂机引导");
+        context.startActivity(intent);
+    }
+    /**
+     * 跳到提交微信号挂机赚钱界面
+     * @param context
+     * @param o
+     */
     public void goCommitWxView(Context context, Object o){
         Intent intent = new Intent(context, CommitWxAct.class);
         context.startActivity(intent);

+ 110 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActGuideOnHook.java

@@ -0,0 +1,110 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.webkit.WebChromeClient;
+import android.webkit.WebSettings;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
+import android.widget.ImageButton;
+import android.widget.TextView;
+
+import com.kfzs.android.view.widget.SafeWebView;
+import com.kfzs.duanduan.ActMain;
+import com.kfzs.duanduan.BaseCompatActivity;
+import com.kfzs.duanduan.KFZSApp;
+import com.kfzs.duanduan.bean.KFIntentKeys;
+import com.orhanobut.logger.Logger;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+
+import static com.kfzs.duanduan.bean.KFIntentKeys.EXTRA_WEBVIEW_NO_TITLE;
+
+/**
+ * all web view
+ * Created by HooRang on 2017/2/17.
+ */
+public class ActGuideOnHook extends BaseCompatActivity {
+
+    @BindView(R.id.webview)
+    SafeWebView mWebView;
+
+    private String extraUrl;
+    private String extraTitle;
+    private WebSettings webViewSettings;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_webview);
+
+        extraUrl = getIntent().getStringExtra(KFIntentKeys.EXTRA_WEBVIEW_URL);
+        extraTitle = getIntent().getStringExtra(KFIntentKeys.EXTRA_WEBVIEW_TITLE);
+
+        ButterKnife.bind(this);
+        TitleBarUtils
+                .getInstance()
+                .setTitle(this, extraTitle)
+                .setTitleFinish(this);
+
+        webViewSettings = mWebView.getSettings();
+        webViewSettings.setJavaScriptCanOpenWindowsAutomatically(true);
+        mWebView.autoSettingWebViewDefaultByWideViewPort(this, false);
+        if (getIntent().hasExtra(EXTRA_WEBVIEW_NO_TITLE)) {//不显示标题
+            findViewById(R.id.appbar_act_webview).setVisibility(View.GONE);
+        }
+        loadUrl();
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        mWebView.setVisibility(View.GONE);
+        mWebView.removeAllViews();
+        mWebView.destroy();
+    }
+
+    private void loadUrl() {
+        Logger.d("loadUrl: " + extraUrl);
+        mWebView.setWebChromeClient(new WebChromeClient());
+        mWebView.setWebViewClient(new WebViewClient() {
+            @Override
+            public boolean shouldOverrideUrlLoading(WebView view, String url) {
+                try {
+                    view.loadUrl(url);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                return true;
+            }
+        });
+        mWebView.loadUrl(extraUrl);
+    }
+
+    @OnClick({R.id.tv_next})
+    public void onClick(View v) {
+        int resId = v.getId();
+        switch (resId) {
+            case R.id.tv_next:
+                Jump2View.getInstance().goCommitWxView(this, null);
+                break;
+        }
+    }
+
+    @Override
+    public void onBackPressed() {
+        if(mWebView.canGoBack()){
+            mWebView.goBack();
+            return;
+        }
+        this.finish();
+    }
+
+
+}

+ 12 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/LieMakeMoneyAct.java

@@ -73,7 +73,7 @@ public class LieMakeMoneyAct extends BaseActivity implements LieMakeMoneyContrac
         recyclerview.setLayoutManager(new LinearLayoutManager(activity));
         lieMakeMoneyAdp = new LieMakeMoneyAdp(this);
         lieMakeMoneyAdp.add(RecyleObj.make(RecyleType.START_ON_HOOK, null));
-        lieMakeMoneyAdp.add(RecyleObj.make(RecyleType.PROMPT_ON_HOOK, false));//true代表有数据,false代表无数据
+        lieMakeMoneyAdp.add(RecyleObj.make(RecyleType.PROMPT_ON_HOOK, null));
         recyclerview.setAdapter(lieMakeMoneyAdp);
     }
 
@@ -102,6 +102,16 @@ public class LieMakeMoneyAct extends BaseActivity implements LieMakeMoneyContrac
         });
     }
 
+    private boolean isFirst = true;
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if(!isFirst){
+            initData();
+        }
+        isFirst = false;
+    }
+
     @Override
     public void initData() {
         if(presenter == null){
@@ -134,7 +144,7 @@ public class LieMakeMoneyAct extends BaseActivity implements LieMakeMoneyContrac
                     break;
             }
         }
-        lieMakeMoneyAdp.add(RecyleObj.make(RecyleType.PROMPT_ON_HOOK, true));//true代表有数据,false代表无数据
+        lieMakeMoneyAdp.add(RecyleObj.make(RecyleType.PROMPT_ON_HOOK, list));
         lieMakeMoneyAdp.notifyDataSetChanged();
     }
 

+ 10 - 3
app/src/main/java/com/sheep/gamegroup/view/adapter/LieMakeMoneyAdp.java

@@ -142,12 +142,12 @@ public class LieMakeMoneyAdp extends AdbCommonRecycler<RecyleObj> {
     private void bindStartOnHook(ViewHolder holder) {
         ImageView imageView = holder.getView(R.id.start_on_hook_iv, ImageView.class);
         imageView.setOnClickListener(view -> {
-            Jump2View.getInstance().goCommitWxView(this.context, null);
+            Jump2View.getInstance().goGuideOnHook(this.context, null);
         });
     }
-    private void bindPromptOnHook(ViewHolder holder, boolean hasData) {
+    private void bindPromptOnHook(ViewHolder holder,  List<WXOnHookAccount> list) {
         View ll = holder.getView(R.id.lie_make_operation_ll);
-        ll.setVisibility(hasData ? View.VISIBLE : View.GONE);
+        ll.setVisibility(list != null ? View.VISIBLE : View.GONE);
         ll.findViewById(R.id.account_abnormal_tv).setOnClickListener(view -> {
 //            // 点击账号异常,弹出账号异常对话框
 //            G.showToast("该功能正在建设中");
@@ -156,6 +156,13 @@ public class LieMakeMoneyAdp extends AdbCommonRecycler<RecyleObj> {
             else if(BuildConfig.DEBUG)
                 G.showToast("传入的context不是activity,无法弹出对话框");
         });
+        ll.findViewById(R.id.customer_service_name_tv).setOnClickListener(view -> {
+//            // 点击联系客服
+            if(list != null && !list.isEmpty())
+                G.showToast("请联系客服:"+list.get(0).getCustomer_service());
+            else if(BuildConfig.DEBUG)
+                G.showToast("传入的context不是activity,无法弹出对话框");
+        });
     }
 
 }

+ 2 - 1
app/src/main/res/layout/activity_game_details_parent.xml

@@ -140,7 +140,8 @@
                             android:layout_height="match_parent"
                             android:padding="@dimen/about_text_margin_10"
                             android:scaleType="centerInside"
-                            android:src="@drawable/share2" />
+                            android:src="@drawable/share2"
+                            android:visibility="gone"/>
                     </LinearLayout>
                 </android.support.v7.widget.Toolbar>
             </android.support.design.widget.CollapsingToolbarLayout>

+ 30 - 0
app/src/main/res/layout/activity_guide_on_hook.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:orientation="vertical"
+    android:background="@color/white_F9F9F9">
+
+    <include
+        layout="@layout/title"/>
+    <com.kfzs.android.view.widget.SafeWebView
+        android:id="@+id/webview"
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_weight="1"
+        android:layout_margin="@dimen/content_padding_10"
+        android:padding="@dimen/content_padding_10"
+        app:layout_behavior="@string/appbar_scrolling_view_behavior"
+        android:background="@drawable/x_shap_shadow_bg_rectgangle_white"/>
+    <TextView
+        android:id="@+id/tv_next"
+        android:layout_width="match_parent"
+        android:layout_height="40dp"
+        android:background="@drawable/sp_bg_gradient_rectangle_yellow"
+        android:gravity="center"
+        android:layout_margin="@dimen/content_padding_10"
+        android:text="下一步"
+        android:textColor="#010101"
+        android:textSize="@dimen/text_size_15" />
+</LinearLayout>

+ 1 - 0
app/src/main/res/layout/lie_make_money_operation_item.xml

@@ -19,6 +19,7 @@
         android:textColor="@color/white"
         android:text="账号异常"/>
     <TextView
+        android:id="@+id/customer_service_name_tv"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginTop="15dp"