|
|
@@ -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代码数据
|