zengjiebin лет назад: 7
Родитель
Сommit
4a1cc38199

+ 0 - 10
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -2749,9 +2749,6 @@ public class Jump2View {
         return true;
     }
 
-
-    //忽略 添加有范商城快捷入口
-    public static final String KEY_IGNORE_ADD_YOU_FAN_LAUNCHER = "ignore_add_you_fan_launcher";
     /**
      * 小绵羊3.4.7新增 -- 跳转商城优惠购物界面
      *
@@ -2759,13 +2756,6 @@ public class Jump2View {
      */
     public void gotoYfShop(Activity activity) {
         CommonUtil.getInstance().initUrlConfigByNet(Config.KEY_YF_SHOP_URL, url -> {
-            boolean isIgnore = DataUtil.getAsBoolean(KEY_IGNORE_ADD_YOU_FAN_LAUNCHER, false);
-            if(!isIgnore && !CommonUtil.getInstance().hasYouFanLauncher()) {//未忽略并且没有添加有范商品入口
-                ActionUtil.getInstance().addNextAction(ActWebX5.class.getSimpleName(), new DialogConfig().setTitle("温馨提示")
-                        .setMsg("亲,喜欢的话,就添加一个商城的桌面快捷入口吧!")
-                        .setBtnLeftText("否").setBtnLeftOnClickListener(view -> DataUtil.putAsBoolean(KEY_IGNORE_ADD_YOU_FAN_LAUNCHER, true))
-                        .setBtnRightText("是").setBtnRightOnClickListener(view -> CommonUtil.getInstance().addYouFanLauncher()));
-            }
             if (TextUtils.isEmpty(url))
                 url = SheepApp.getInstance().getConnectAddress().getYfShotHomeSheep();
             goWeb(activity, new WebParams(url, Config.YF_SHOP_NAME).tokenFirstUpperCase());

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

@@ -73,13 +73,13 @@ import com.sheep.gamegroup.dateview.DateUtil;
 import com.sheep.gamegroup.model.entity.Advertising;
 import com.sheep.gamegroup.model.entity.Applications;
 import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.CommendTask;
 import com.sheep.gamegroup.model.entity.Container;
 import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.GameAccountEntity;
 import com.sheep.gamegroup.model.entity.GiftBagApp;
 import com.sheep.gamegroup.model.entity.Lp;
 import com.sheep.gamegroup.model.entity.PayEntity;
-import com.sheep.gamegroup.model.entity.CommendTask;
 import com.sheep.gamegroup.model.entity.TaskEty;
 import com.sheep.gamegroup.model.entity.WebParams;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
@@ -1330,8 +1330,6 @@ public class ViewUtil {
                         ViewGroup.LayoutParams msgLayoutParams = dialog_msg.getLayoutParams();
                         if (msgLayoutParams instanceof LinearLayout.LayoutParams) {
                             ((LinearLayout.LayoutParams) msgLayoutParams).bottomMargin *= -2;
-                        } else if (BuildConfig.DEBUG) {
-                            G.showToast("这里的bottomMargin显得多了,需要干掉");
                         }
                         dialog_msg.setLayoutParams(msgLayoutParams);
                     }

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

@@ -19,9 +19,11 @@ import android.view.animation.AnimationUtils;
 import android.widget.ImageView;
 import android.widget.ProgressBar;
 
+import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.WebParams;
 import com.sheep.gamegroup.module.webview.util.WebResourceRequestAdapter;
 import com.sheep.gamegroup.module.webview.util.WebResourceResponseAdapter;
+import com.sheep.gamegroup.util.ActionUtil;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.Constant;
 import com.sheep.gamegroup.util.DataUtil;
@@ -119,6 +121,21 @@ public class ActWebX5 extends BaseActWeb {
     public void initWebParams() {
         Intent intent = getIntent();
         webParams = (WebParams) intent.getSerializableExtra(WebParams.class.getSimpleName());
+        checkWebParams(webParams);
+    }
+
+    //忽略 添加有范商城快捷入口
+    public static final String KEY_IGNORE_ADD_YOU_FAN_LAUNCHER = "ignore_add_you_fan_launcher";
+    private void checkWebParams(WebParams webParams) {
+        if(webParams.getUrl().startsWith(Config.YF_SHOP_HOME_SHEEP.split("\\?")[0]) || webParams.getUrl().startsWith(Config.YF_SHOP_HOME_SHEEP_TEST.split("\\?")[0])) {//检测是否是有范商城地址
+            boolean isIgnore = DataUtil.getAsBoolean(KEY_IGNORE_ADD_YOU_FAN_LAUNCHER, false);
+            if (!isIgnore && !CommonUtil.getInstance().hasYouFanLauncher()) {//未忽略并且没有添加有范商品入口
+                ViewUtil.showMsgDialog(this, new DialogConfig().setTitle("温馨提示")
+                        .setMsg("亲,喜欢的话,就添加一个商城的桌面快捷入口吧!")
+                        .setBtnLeftText("否").setBtnLeftOnClickListener(view -> DataUtil.putAsBoolean(KEY_IGNORE_ADD_YOU_FAN_LAUNCHER, true))
+                        .setBtnRightText("是").setBtnRightOnClickListener(view -> CommonUtil.getInstance().addYouFanLauncher()));
+            }
+        }
     }
 
     //初始化js代码数据