hanjing лет назад: 6
Родитель
Сommit
a6b436d4b2

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

@@ -259,6 +259,29 @@
             </intent-filter>
         </activity>
         <activity
+            android:name="com.sheep.gamegroup.view.activity.MiddleSchemeSingleAct"
+            android:configChanges="keyboardHidden|screenSize|orientation"
+            android:exported="true"
+            android:hardwareAccelerated="true"
+            android:launchMode="singleInstance"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme"
+            android:windowSoftInputMode="adjustPan|stateHidden">
+            <intent-filter android:autoVerify="true">
+
+                <!-- 协议部分,随便设置 -->
+                <data
+                    android:host="smallsingle.kfzs.com"
+                    android:scheme="sheep" />
+                <!-- 下面这几行也必须得设置 -->
+                <category android:name="android.intent.category.DEFAULT" />
+
+                <action android:name="android.intent.action.VIEW" />
+
+                <category android:name="android.intent.category.BROWSABLE" />
+            </intent-filter>
+        </activity>
+        <activity
             android:name="com.sheep.gamegroup.view.activity.PersonalCenterAct"
             android:screenOrientation="portrait"
             android:theme="@style/AppTheme" />
@@ -461,6 +484,7 @@
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActWebX5"
             android:configChanges="orientation|screenSize"
+            android:exported="true"
             android:screenOrientation="portrait"
             android:theme="@style/AppActionTheme" />
         <activity
@@ -482,6 +506,16 @@
             </intent-filter>
         </activity>
         <activity
+            android:name="com.sheep.gamegroup.view.activity.ActWebX5Single"
+            android:screenOrientation="portrait"
+            android:launchMode="singleInstance"
+            android:theme="@style/AppActionTheme" >
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+        </activity>
+        <activity
             android:name="com.sheep.gamegroup.view.activity.ActImg"
             android:screenOrientation="portrait"
             android:theme="@style/AppActionTheme" />

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/module/login/ReLoginNameAct.java

@@ -53,7 +53,7 @@ public class ReLoginNameAct extends BaseActivity {
             return;
         }
         if (!StringUtils.isUserName(loginNameBox.getText().toString().trim())) {
-            G.shortToast("登录名只能包含英文、数字、._-@符号,长度4-20");
+            G.shortToast("登录名只能包含英文、数字,长度4-20");
             return;
         }
         showProgress();

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/module/login/fragments/BindAccountFgt.java

@@ -125,7 +125,7 @@ public class BindAccountFgt extends BaseFragment {
             return false;
         }
         if (!StringUtils.isUserName(username)) {
-            G.shortToast("用户名只能包含英文、数字、._-@符号,长度4-20");
+            G.shortToast("用户名只能包含英文、数字,长度4-20");
             return false;
         }
         if (!StringUtils.isPassword(password)) {

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/module/login/fragments/SignInFgt.java

@@ -149,7 +149,7 @@ public class SignInFgt extends AbsLoginFgt {
             return false;
         }
         if (!StringUtils.isUserName(username)) {
-            G.shortToast("用户名只能包含英文、数字、._-@符号,长度4-20");
+            G.shortToast("用户名只能包含英文、数字,长度4-20");
             return false;
         }
         if (!StringUtils.isPassword(password)) {

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/module/login/fragments/SignUpFgt.java

@@ -289,7 +289,7 @@ public class SignUpFgt extends BaseFragment {
             return false;
         }
         if (!StringUtils.isUserName(username)) {
-            G.shortToast("用户名只能包含英文、数字、._-@符号,且至少包含一个字母,长度4-20");
+            G.shortToast("用户名只能包含英文、数字,且至少包含一个字母,长度4-20");
             return false;
         }
         if (!StringUtils.containLetter(username)) {

+ 39 - 2
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -133,6 +133,7 @@ import com.sheep.gamegroup.view.activity.ActUserNoviceGuidance;
 import com.sheep.gamegroup.view.activity.ActVideoComment;
 import com.sheep.gamegroup.view.activity.ActVideoDetail;
 import com.sheep.gamegroup.view.activity.ActWebX5;
+import com.sheep.gamegroup.view.activity.ActWebX5Single;
 import com.sheep.gamegroup.view.activity.ActXianWanWeb;
 import com.sheep.gamegroup.view.activity.ActXiaomiGame;
 import com.sheep.gamegroup.view.activity.AskGetMoneyAct;
@@ -1017,6 +1018,42 @@ public class Jump2View {
         }
     }
 
+    public void goWebSingle(Context context, WebParams webParams, boolean needNewTask) {
+        String url = webParams.checkShowTitle().getUrl();
+        if (TextUtils.isEmpty(url)) {
+            G.showToast(R.string.service_data_error);
+            return;
+        }
+        //检查url是否是http开头并添加
+        if (!url.startsWith("http")) {
+            if (url.contains("://")) {
+                if (tryGotoDeepLink(url)) {
+                    return;
+                }
+            } else {
+                url = "http://" + url;
+            }
+        }
+        webParams.setUrl(url);
+        if (StringUtils.isImageUrl(url)) {
+            showImg(context, webParams);
+            return;
+        } else if (StringUtils.isVideoUrl(url)) {
+            goActPlayVideo(url, webParams.getTitle());
+            return;
+        }
+        Intent intent = new Intent(context, ActWebX5Single.class);
+        intent.putExtra(WebParams.class.getSimpleName(), webParams);
+        if (needNewTask) {
+            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+        }
+        if (webParams.isForResult()) {
+            ((Activity) context).startActivityForResult(intent, webParams.getAction());
+        } else {
+            context.startActivity(intent);
+        }
+    }
+
     /**
      * 跳到web页面
      *
@@ -2965,13 +3002,13 @@ public class Jump2View {
     public void gotoGameVipRecharge(int discountId, String packageName, String token) {
         String url = Config.getUrlByPath(Config.PATH_DIRECTIONAL_RECHARGE + "/" + discountId, "packagename", packageName, "authorization", token, "ssnocache", "1");
         WebParams webParams = new WebParams(url, "抢购优惠").setShowTitle(false);
-        Jump2View.getInstance().goWeb(SheepApp.getInstance(), webParams, true);
+        Jump2View.getInstance().goWebSingle(SheepApp.getInstance(), webParams, true);
     }
 
     public void gotoGameGoldCoins(String token) {
         String url = Config.getUrlByPath(Config.PATH_DIRECTIONAL_MAKEGOLD, "authorization", token, "ssnocache", "1");
         WebParams webParams = new WebParams(url, "金丹传说").setShowTitle(false);
-        Jump2View.getInstance().goWeb(SheepApp.getInstance(), webParams, true);
+        Jump2View.getInstance().goWebSingle(SheepApp.getInstance(), webParams, true);
     }
 
     /**

+ 15 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/ActWebX5Single.java

@@ -0,0 +1,15 @@
+package com.sheep.gamegroup.view.activity;
+
+
+import com.sheep.gamegroup.model.entity.WebParams;
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.jiuyan.samllsheep.Config;
+
+/**
+ * Created by realicing on 2019/3/20.
+ * realicing@sina.com
+ * 随便打h5
+ */
+public class ActWebX5Single extends ActWebX5 {
+
+}

+ 11 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/MiddleSchemeSingleAct.java

@@ -0,0 +1,11 @@
+package com.sheep.gamegroup.view.activity;
+
+
+/**
+ * Created by realicing on 2019/3/20.
+ * realicing@sina.com
+ * 随便打h5
+ */
+public class MiddleSchemeSingleAct extends MiddleSchemeAct {
+
+}

+ 1 - 1
app/src/main/res/layout/fragment_sign_up.xml

@@ -16,7 +16,7 @@
             android:id="@+id/user_name_box"
             style="@style/login_edit_style_name"
             android:maxLength="20"
-            android:hint="输入用户名(如邮箱地址、常用英文等唯一标识)" />
+            android:hint="输入用户名(如常用英文等唯一标识)" />
 
         <View style="@style/login_separetor_line_style" />