Procházet zdrojové kódy

账号登录修改为切换账号

zengjiebin před 7 roky
rodič
revize
2396d09c11

+ 14 - 14
app/build.gradle

@@ -85,20 +85,20 @@ android {
             buildConfigField "String", "API_DOMAIN", '"app.ss.kfzs.com"'
             signingConfig signingConfigs.config
         }
-        sheeptestjiguang {
-            applicationId "com.sheep.jiuyan.samllsheep.test"
-            manifestPlaceholders = [DUANDUAN_GRAPH    : "sheeptestjiguang",
-                                    DUANDUAN_DATASHARE: "sheeptestjiguang",
-                                    jpush_appkey      : "627ffad0b1cdf701d15e027a",
-                                    umeng_app_key     : "5ab0a1da8f4a9d742900035f"
-            ]
-            buildConfigField "String", "DUANDUAN_DATASHARE", '"sheeptestjiguang"'
-            buildConfigField "String", "DUANDUAN_GRAPH", '"sheeptestjiguang"'
-            buildConfigField "String", "app_name", '"小绵羊测试"'
-            buildConfigField "boolean", "XXTEA_ENCRYPT", 'true'
-            buildConfigField "String", "API_DOMAIN", '"app.ss.kfzs.com"'
-            signingConfig signingConfigs.config
-        }
+//        sheeptestjiguang {
+//            applicationId "com.sheep.jiuyan.samllsheep.test"
+//            manifestPlaceholders = [DUANDUAN_GRAPH    : "sheeptestjiguang",
+//                                    DUANDUAN_DATASHARE: "sheeptestjiguang",
+//                                    jpush_appkey      : "627ffad0b1cdf701d15e027a",
+//                                    umeng_app_key     : "5ab0a1da8f4a9d742900035f"
+//            ]
+//            buildConfigField "String", "DUANDUAN_DATASHARE", '"sheeptestjiguang"'
+//            buildConfigField "String", "DUANDUAN_GRAPH", '"sheeptestjiguang"'
+//            buildConfigField "String", "app_name", '"小绵羊测试"'
+//            buildConfigField "boolean", "XXTEA_ENCRYPT", 'true'
+//            buildConfigField "String", "API_DOMAIN", '"app.ss.kfzs.com"'
+//            signingConfig signingConfigs.config
+//        }
         sheep {
             applicationId "com.sheep.jiuyan.samllsheep"
             manifestPlaceholders = [DUANDUAN_GRAPH    : "sheep",

+ 0 - 4
app/src/main/java/com/sheep/gamegroup/util/CertificationUtil.java

@@ -46,10 +46,6 @@ public class CertificationUtil {
                 SheepApp.getInstance().setGameCode("");
                 SheepApp.getInstance().setGameFlag(false);
                 ActivityManager.getInstance().finishAllActivity();
-                G.showToast(errorMsg);
-                SheepApp.getInstance().quit();
-//                android.os.Process.killProcess(android.os.Process.myPid());
-                System.exit(0);
             }
         }, skip_time);
     }

+ 36 - 1
app/src/main/java/com/sheep/gamegroup/util/TestUtil.java

@@ -1,9 +1,14 @@
 package com.sheep.gamegroup.util;
 
 import android.app.Activity;
+import android.app.Notification;
+import android.app.NotificationChannel;
+import android.app.NotificationManager;
 import android.content.DialogInterface;
 import android.content.Intent;
+import android.os.Build;
 import android.os.Bundle;
+import android.support.v4.app.NotificationCompat;
 import android.support.v4.app.NotificationManagerCompat;
 import android.support.v7.app.AlertDialog;
 import android.text.TextUtils;
@@ -59,6 +64,7 @@ import rx.android.schedulers.AndroidSchedulers;
 import rx.functions.Action1;
 import rx.schedulers.Schedulers;
 
+import static android.content.Context.NOTIFICATION_SERVICE;
 import static com.sheep.gamegroup.util.CommonUtil.LONG_MAO_APP_PACKAGE_NAME;
 import static com.sheep.gamegroup.util.CommonUtil.LONG_MAO_APP_URI;
 
@@ -217,7 +223,8 @@ public class TestUtil {
      */
     public static void test(final Activity activity) {
         final String[] items = {"复制token","复制打点数据","从jenkins下载小绵羊安装包","龙猫竞猜","龙猫竞猜-scheme",
-                "测试自定义通知栏","测试自定义通知栏2","开启通知栏权限","通知栏权限1","通知栏权限2","通知栏权限8.0","测试支付","测试内部h5", "测试外部h5",
+                "测试通知栏", "测试自定义通知栏","测试自定义通知栏2",
+                "开启通知栏权限","通知栏权限1","通知栏权限2","通知栏权限8.0","测试支付","测试内部h5", "测试外部h5",
                 "会长推广游戏","移动积分兑换","审核中心","检查正版","crc32","loading","progress","查看截图",
                 "复制IMEI","小米游戏","测试可用金额","测试定位信息","测试apk的渠道","幂动科技","游戏搜索",
                 "游戏帐号","游戏代充","尝试开启第三方应用使用情况","测试代理页面","第三方应用使用情况",
@@ -231,6 +238,9 @@ public class TestUtil {
                     @Override
                     public void onClick(DialogInterface dialog, int which) {
                         switch (items[which]) {
+                            case "测试通知栏":
+                                testNotification(activity);
+                                break;
                             case "测试自定义通知栏":
                                 Intent bdIntent = new Intent();
                                 bdIntent.setAction(JPushInterface.ACTION_MESSAGE_RECEIVED);
@@ -496,6 +506,31 @@ public class TestUtil {
                 }).create();
         dialog.show();
     }
+    //测试直接显示通知栏
+    private static void testNotification(Activity activity) {
+        String id = "my_channel_01";
+        String name = activity.getString(R.string.app_name);
+        NotificationManager notificationManager = (NotificationManager) activity.getSystemService(NOTIFICATION_SERVICE);
+        if(notificationManager != null) {
+            Notification notification;
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+                NotificationChannel mChannel = new NotificationChannel(id, name, NotificationManager.IMPORTANCE_HIGH);
+                notificationManager.createNotificationChannel(mChannel);
+                notification = new NotificationCompat.Builder(activity, id)
+                        .setContentTitle("5 new messages")
+                        .setContentText("hahaha")
+                        .setSmallIcon(R.mipmap.ic_launcher).build();
+            } else {
+                NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(activity, id)
+                        .setContentTitle("5 new messages")
+                        .setContentText("hahaha")
+                        .setSmallIcon(R.mipmap.ic_launcher)
+                        .setOngoing(true);
+                notification = notificationBuilder.build();
+            }
+            notificationManager.notify(111123, notification);
+        }
+    }
 
 
     private static void copyUrl(final String name) {

+ 0 - 4
app/src/main/java/com/sheep/gamegroup/view/activity/LoginAct.java

@@ -97,10 +97,6 @@ public class LoginAct extends BaseUMActivity implements LoginContract.View {
     @Override
     public void initView() {
         activity = this;
-        if(!TextUtils.isEmpty(SpUtils.getToken(activity))){
-            Jump2View.getInstance().newTaskTopStartAct(this, SplashAct.class, null);
-            finish();
-        }
         DaggerLoginComponent.builder()
                 .netComponent(SheepApp.getInstance().getNetComponent())
                 .loginModule(new LoginModule(this))

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

@@ -111,7 +111,7 @@
                     android:layout_marginLeft="@dimen/content_padding_30"
                     android:layout_marginTop="@dimen/content_padding_20"
                     android:layout_marginBottom="@dimen/content_padding_5"
-                    android:text="账号登录"
+                    android:text="切换账号"
                     android:textColor="#36A5ED"
                     android:textSize="18sp"
                     app:layout_constraintStart_toStartOf="parent"