hanjing 6 年 前
コミット
45b95b6d8d

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

@@ -311,7 +311,7 @@
         <activity
             android:name="com.sheep.gamegroup.module.pay.activity.ActPayPassword"
             android:launchMode="singleTask"
-            android:screenOrientation="portrait"
+            android:screenOrientation="behind"
             android:theme="@style/AppThemeTransparent" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActBindMobileRegister"

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/module/webview/fragment/FgtWeb.java

@@ -172,9 +172,9 @@ public class FgtWeb extends BaseFgtWeb {
     }
 
     public static void initWebViewSettings(WebView webView) {
-//        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
-//            WebView.setWebContentsDebuggingEnabled(true);
-//        }
+        if (BuildConfig.DEBUG && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+            WebView.setWebContentsDebuggingEnabled(true);
+        }
         webView.setClickable(true);
         WebSettings webSetting = webView.getSettings();
         webSetting.setJavaScriptEnabled(true);

+ 3 - 1
app/src/main/java/com/sheep/gamegroup/module/webview/fragment/FgtWebX5.java

@@ -160,7 +160,9 @@ public class FgtWebX5 extends BaseFgtWebX5 {
     }
 
     public static void initWebViewSettings(WebView webView) {
-//        WebView.setWebContentsDebuggingEnabled(true);
+        if(BuildConfig.DEBUG) {
+            WebView.setWebContentsDebuggingEnabled(true);
+        }
         webView.setClickable(true);
         WebSettings webSetting = webView.getSettings();
         webSetting.setJavaScriptEnabled(true);

+ 19 - 1
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -738,7 +738,7 @@ public class CommonUtil {
     }
 
     public void getUserInfo(boolean force, Action1<UserEntity> callback) {
-        if(!force && DataUtil.getInstance().getUserEntity()!=null){
+        if (!force && DataUtil.getInstance().getUserEntity() != null) {
             callback.call(DataUtil.getInstance().getUserEntity());
             return;
         }
@@ -2830,6 +2830,24 @@ public class CommonUtil {
         }
     }
 
+    public void goGameDetailByPackageId(String packageId) {
+        SheepApp.getInstance().getNetComponent().getApiService().getAppId(packageId)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        Applications applications = baseMessage.getData(Applications.class);
+                        Jump2View.getInstance().goPlayGameDetail(applications.getId());
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        G.showToast(baseMessage);
+                    }
+                });
+    }
+
     //检查是否是小绵羊分享页面,如果是且获取到了game_id,返回true并调用接口获取对应的applications,然后尝试显示游戏对话框,提示用户是否查看游戏详情
     private boolean checkShouYouShare(View.OnClickListener closeListener, String url) {
         if (url.contains("/shou_you_share/index.html")) {

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

@@ -397,7 +397,7 @@ public class Jump2View {
      * @param object
      */
     public void goHomePageView(final Activity context, Object object) {
-        final Intent intent = new Intent(context, ActMain.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
+        final Intent intent = new Intent(context, ActTest.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
         if (object instanceof String) {
             //统计用户登录信息
             UMConfigUtils.onProfileSignIn();
@@ -1046,7 +1046,7 @@ public class Jump2View {
     public void goH5Game(Context context, String url) {
         WebParams wp = new WebParams(url, "游戏");
         wp.setNeedJsInteract(true);
-        wp.setJsUrl(Config.SMALL_STATION_URL + Config.STATION_SMALL_SHEEP_H5GAME + "/bridge.js");
+//        wp.setJsUrl(Config.SMALL_STATION_URL + Config.STATION_SMALL_SHEEP_H5GAME + "/bridge.js");
         Jump2View.getInstance().goWeb(context, wp, true);
     }
 
@@ -2915,11 +2915,10 @@ public class Jump2View {
     public void goPlayGameDetail(int id, boolean isAutoDownload) {
         GAME_PLAY_GAME_DETAIL.onEvent();
         if (id > 0) {
-            Activity activity = SheepApp.getInstance().getCurrentActivity();
-            Intent intent = new Intent(activity, ActGameGroupOrGameDetail.class);
+            Intent intent = new Intent(SheepApp.getInstance(), ActGameGroupOrGameDetail.class);
             intent.putExtra("id", id);
             intent.putExtra(AUTO_DOWNLOAD, isAutoDownload);
-            goPlayGameDetailAndCheckWelfare(activity, intent, id);
+            goPlayGameDetailAndCheckWelfare(SheepApp.getInstance(), intent, id);
         } else {
             G.showToast(R.string.please_contact_customer_service);
         }
@@ -2928,7 +2927,7 @@ public class Jump2View {
     /**
      * 小绵羊3.4.10新增 -- 游戏组游戏详情 界面
      */
-    public void goPlayGameDetailAndCheckWelfare(Activity activity, Intent intent, int appId) {
+    public void goPlayGameDetailAndCheckWelfare(Context context, Intent intent, int appId) {
         SheepApp.getInstance().getNetComponent().getApiService().getAppWelfareAndMoneyReward(1, DataUtil.PER_PAGE, appId)
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
@@ -2938,13 +2937,13 @@ public class Jump2View {
                         List<Release_task> list = baseMessage.getDataList(Release_task.class);
                         boolean hasWelfare = !ListUtil.isEmpty(list);
                         intent.putExtra(KEY_HAS_WELFARE, hasWelfare);
-                        activity.startActivity(intent);
+                        context.startActivity(intent);
                     }
 
                     @Override
                     public void onError(BaseMessage baseMessage) {
                         intent.putExtra(KEY_HAS_WELFARE, false);
-                        activity.startActivity(intent);
+                        context.startActivity(intent);
                     }
                 });
     }

+ 6 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/MiddleSchemeAct.java

@@ -61,6 +61,7 @@ public class MiddleSchemeAct extends Activity {
                 if (uri != null) {
                     if (SheepApp.getInstance().mActivityCount == 0
                             && !"game_coupon".equals(uri.getQueryParameter("type"))
+                            && !"game_detail".equals(uri.getQueryParameter("type"))
                             && !"discountrecharge".equals(uri.getQueryParameter("type"))) {
                         ActionUtil.getInstance().addNextAction("scheme", uri);
                         tryGoSplashAct(SheepApp.getInstance(), uri);
@@ -85,7 +86,8 @@ public class MiddleSchemeAct extends Activity {
         //尝试解密数据
         String json = uri.getQueryParameter("data");
         if (!type.equals("h5game")
-                && !type.equals("discountrecharge")) {
+                && !type.equals("discountrecharge")
+                && !type.equals("game_detail")) {
             json = BaseMessageConverter.decrypt(json);
         }
         switch (type) {
@@ -104,6 +106,9 @@ public class MiddleSchemeAct extends Activity {
             case "wfa"://跳转原生福利专区
                 Jump2View.getInstance().toActWelfareSpecialArea();
                 break;
+            case "game_detail"://跳转游戏
+                CommonUtil.getInstance().goGameDetailByPackageId(json);
+                break;
             case "game_coupon":
                 Jump2View.getInstance().goWeb(
                         context,