Просмотр исходного кода

Merge branch 'sheep_develop' of 10.8.230.114:xmy_android/small_sheep_android into sheep_develop

hanjing лет назад: 7
Родитель
Сommit
b29f865cce

+ 63 - 25
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -18,7 +18,6 @@ import android.util.TypedValue;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.ViewTreeObserver;
-import android.webkit.DownloadListener;
 import android.webkit.WebView;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
@@ -1014,9 +1013,11 @@ public class CommonUtil {
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(observer);
     }
+
     /**
      * 微信支付
      * apk签名:c69316882eada62ae560c31076740400
+     *
      * @param payInfo
      */
     public void wxpay(IWXAPI api, final JSONObject payInfo) {
@@ -1725,7 +1726,7 @@ public class CommonUtil {
                     int fillCount = Math.min(5, count);//一屏的个数
 
                     int tabWidth = tabLayout.getWidth();
-                    if(tabWidth == 0){
+                    if (tabWidth == 0) {
                         tabWidth = G.WIDTH;
                     }
                     for (int i = 0; i < count; i++) {
@@ -2299,9 +2300,10 @@ public class CommonUtil {
      *
      * @param i -1:不限制 否者限制tag 个数
      */
-    public void paintLineaLayout( GameEntity gameEntity, LinearLayout ll_game_tag, int i, int color, int drawable) {
-        paintLineaLayout(gameEntity.getApp(),ll_game_tag, i, color, drawable);
+    public void paintLineaLayout(GameEntity gameEntity, LinearLayout ll_game_tag, int i, int color, int drawable) {
+        paintLineaLayout(gameEntity.getApp(), ll_game_tag, i, color, drawable);
     }
+
     /**
      * tag 标签绘制
      * R.drawable.shape_blue_stroke_rectangle_no_lb
@@ -2309,7 +2311,7 @@ public class CommonUtil {
      * @param i -1:不限制 否者限制tag 个数
      */
     public void paintLineaLayout(Applications app, LinearLayout ll_game_tag, int i, int color, int drawable) {
-        if(app == null){
+        if (app == null) {
             ll_game_tag.removeAllViews();
             return;
         }
@@ -2371,7 +2373,7 @@ public class CommonUtil {
                 }
             } else {
                 releaseEty.getDownloadHelper().updateDownloadTaskView(showSimpleText, taskEty, detail_task_tv_center, o -> {
-                    if(o instanceof Integer){//下载游戏时判断是否领取了任务
+                    if (o instanceof Integer) {//下载游戏时判断是否领取了任务
                         CommonUtil.getInstance().receiveAward(gameEntity, new Action1<Integer>() {
                             @Override
                             public void call(Integer integer) {
@@ -2554,24 +2556,18 @@ public class CommonUtil {
 
     //使webView支持下载文件
     public void setDownloadListener(final Context context, WebView webView) {
-        webView.setDownloadListener(new DownloadListener() {
-            @Override
-            public void onDownloadStart(final String url, String userAgent, String contentDisposition, String mimeType, long contentLength) {
-                LogUtil.println("setDownloadListener", "setDownloadListener", "onDownloadStart", url, userAgent, contentDisposition, mimeType);
-                showDownloadDialog(context, url);
-            }
+        webView.setDownloadListener((url, userAgent, contentDisposition, mimeType, contentLength) -> {
+            LogUtil.println("setDownloadListener", "setDownloadListener", "onDownloadStart", url, userAgent, contentDisposition, mimeType);
+            showDownloadDialog(context, url);
         });
     }
 
     //使webView支持下载文件
     public void setDownloadListener(final Activity activity, com.tencent.smtt.sdk.WebView webView) {
-        webView.setDownloadListener(new com.tencent.smtt.sdk.DownloadListener() {
-            @Override
-            public void onDownloadStart(final String url, String userAgent, String contentDisposition, String mimeType, long contentLength) {
-                LogUtil.println("setDownloadListener", "setDownloadListener", "onDownloadStart", url, userAgent, contentDisposition, mimeType);
-                showDownloadDialog(activity, url);
+        webView.setDownloadListener((url, userAgent, contentDisposition, mimeType, contentLength) -> {
+            LogUtil.println("setDownloadListener", "setDownloadListener", "onDownloadStart", url, userAgent, contentDisposition, mimeType);
+            showDownloadDialog(activity, url);
 
-            }
         });
     }
 
@@ -2582,14 +2578,56 @@ public class CommonUtil {
         final boolean exists = saveFile.exists();
         ViewUtil.showMsgDialog(context, new DialogConfig().setTitle("下载提示")
                 .setMsg((exists ? "是否重新下载文件:" : "是否下载文件:") + saveFile.getAbsolutePath()).setBtnLeftText("取消下载").setBtnRightText("确认下载")
-                .setBtnRightOnClickListener(new View.OnClickListener() {
-                    @Override
-                    public void onClick(View view) {
-                        if (exists && saveFile.delete()) {
-                            LogUtil.println("setDownloadListener", "setDownloadListener", "onDownloadStart", url, saveFile.getAbsolutePath(), "成功删除原来的文件");
-                        }
-                        DownloadService.sysDownload(context, url, fileName, "来自小绵羊的下载:" + fileName, fileName, "系统开始下载apk");
+                .setBtnRightOnClickListener(view -> {
+                    if (exists && saveFile.delete()) {
+                        LogUtil.println("setDownloadListener", "setDownloadListener", "onDownloadStart", url, saveFile.getAbsolutePath(), "成功删除原来的文件");
                     }
+                    DownloadService.sysDownload(context, url, fileName, "来自小绵羊的下载:" + fileName, fileName, "系统开始下载apk");
                 }));
     }
+
+    //检查粘贴板
+    public void checkCopyText() {
+        boolean enableCheckCopyText = DataUtil.getAsBoolean(Config.KEY_ENABLE_CHECK_COPY_TEXT, Config.dvbEnableCheckCopyText());
+        if(!enableCheckCopyText){
+            LogUtil.println("checkCopyText", "closed");
+            return;
+        }
+        CharSequence text = StringUtils.getCopyText();
+        String used = DataUtil.getAsString(Config.KEY_USED_COPY_TEXT, null);
+        LogUtil.println("checkCopyText", "\ntext\t", text, "\nused\t", used);
+        if (!TextUtils.isEmpty(text) && !TextUtils.equals(text.toString(), used)) {//内容不为空时或者与上次记录的内容不相同时
+            String textString = text.toString();
+            View.OnClickListener closeListener = view -> DataUtil.putAsString(Config.KEY_USED_COPY_TEXT, textString);
+            DialogConfig dialogConfig = new DialogConfig().setTitle("小绵羊提示").setBtnCloseOnClickListener(closeListener);
+            if (textString.startsWith("http://") || textString.startsWith("https://")) {//如果是链接,直接跳转外部浏览器
+                dialogConfig.setMsg("已经复制如下内容:\n" + textString + "\n,是否访问该链接?")
+                        .setBtnLeftText("仅一次").setBtnLeftOnClickListener(view -> {
+                    closeListener.onClick(view);
+                    Jump2View.getInstance().goWeb(SheepApp.getInstance().getCurrentActivity(), textString);
+                })
+                        .setBtnRightText("确定").setBtnRightOnClickListener(view -> Jump2View.getInstance().goWeb(SheepApp.getInstance().getCurrentActivity(), textString));
+                ViewUtil.showMsgDialog(SheepApp.getInstance().getCurrentActivity(), dialogConfig);
+            } else if (textString.contains("://")) {
+                dialogConfig.setMsg("已经复制如下内容:\n" + textString + "\n,是否尝试跳转?")
+                        .setBtnLeftText("仅一次").setBtnLeftOnClickListener(view -> {
+                    closeListener.onClick(view);
+                    Jump2View.getInstance().tryGotoDeepLink(textString);
+                })
+                        .setBtnRightText("确定").setBtnRightOnClickListener(view -> Jump2View.getInstance().tryGotoDeepLink(textString));
+                ViewUtil.showMsgDialog(SheepApp.getInstance().getCurrentActivity(), dialogConfig);
+            } else if(TestUtil.isDev()) {
+                TestUtil.testFunction(SheepApp.getInstance().getCurrentActivity(), textString);
+//            } else {
+//                String msg = textString.length() > 100 ? textString.substring(0, 100) + "..." : textString;
+//                dialogConfig.setMsg("已经复制如下内容:\n" + msg + "\n,是否查看详情?")
+//                        .setBtnLeftText("仅一次").setBtnLeftOnClickListener(view -> {
+//                    closeListener.onClick(view);
+//                    Jump2View.getInstance().goLoadH5(SheepApp.getInstance().getCurrentActivity(), "来自粘贴板", textString);
+//                })
+//                        .setBtnRightText("确定").setBtnRightOnClickListener(view -> Jump2View.getInstance().goLoadH5(SheepApp.getInstance().getCurrentActivity(), "来自粘贴板", textString));
+//                ViewUtil.showMsgDialog(SheepApp.getInstance().getCurrentActivity(), dialogConfig);
+            }
+        }
+    }
 }

+ 5 - 0
app/src/main/java/com/sheep/gamegroup/util/DataUtil.java

@@ -325,6 +325,11 @@ public class DataUtil {
     public static void putAsBoolean(String key, boolean value) {
         aCache.put(key, Boolean.toString(value));
     }
+    public static boolean toggleAsBoolean(String key, boolean defaultValue) {
+        boolean value = !getAsBoolean(key, defaultValue);
+        putAsBoolean(key, value);
+        return value;
+    }
 
 
     private Map<String, Object> objectMap = new HashMap<>();

+ 4 - 1
app/src/main/java/com/sheep/gamegroup/util/StringUtils.java

@@ -34,10 +34,13 @@ public class StringUtils {
      * @param text
      */
     public static boolean CopyText(String text) {
+        return CopyText("sheep text copy", text);
+    }
+    public static boolean CopyText(String label, String text) {
         ClipboardManager clipboardManager = (ClipboardManager) SheepApp.getInstance().getSystemService(Context.CLIPBOARD_SERVICE);
         if (clipboardManager != null && !TextUtils.isEmpty(text)) {
             //创建ClipData对象
-            ClipData clipData = ClipData.newPlainText("sheep text copy", text);
+            ClipData clipData = ClipData.newPlainText(label, text);
             //添加ClipData对象到剪切板中
             clipboardManager.setPrimaryClip(clipData);
             return true;

+ 352 - 369
app/src/main/java/com/sheep/gamegroup/util/TestUtil.java

@@ -276,378 +276,361 @@ public class TestUtil {
                 "浦发银行信用卡测试", "测试游戏模块", "打卡成功提示", "定向货币详情", "进入绑定身份认证界面时的提示", "提交身份认证时的提示", "检查标签",
                 "友盟分享", "了解小绵羊", "提现成功"};
         AlertDialog dialog = new AlertDialog.Builder(activity).setTitle("请选择测试项目")
-                .setItems(items, new DialogInterface.OnClickListener() {
-
-                    @Override
-                    public void onClick(DialogInterface dialog, int which) {
-                        switch (items[which]) {
-                            case "测试升级对话框":
-                                Version version = new Version();
-                                version.setMd5_address("123456");
-                                version.setVersion_name(BuildConfig.VERSION_NAME);
-                                version.setUpdate_content("更新内容(测试):\n1.修复bug;\n2.优化界面;\n3.添加宠物模块");
-                                SysAppUtil.showUpgradeByVersion(version, null);
-                                break;
-                            case "少数民族姓名":
-                                G.showToast(Boolean.toString(StringUtils.isChineseName("麦麦提·阿尤甫")));
-                                break;
-                            case "开启皮肤":
-                                SkinUtil.isUserPlugin = true;
-                                break;
-                            case "不开启皮肤":
-                                SkinUtil.isUserPlugin = false;
-                                break;
-                            case "我的游戏":
-                                Jump2View.getInstance().goActMyGameList(activity);
-                                break;
-                            case "优惠券弹窗":
-                                ReceiveCouponsCheckResq receiveCouponsCheckResq = new ReceiveCouponsCheckResq();
-                                receiveCouponsCheckResq.setAmount(6.0f);
-                                ViewUtil.showYfShopAd(activity, receiveCouponsCheckResq);
-                                break;
-                            case "填写收件地址弹窗":
-                                ViewUtil.showYfShopAsk(activity, "继续邀请", activity.getString(R.string.yf_shop_ask_tip, "987654311"), dialog1 -> Jump2View.getInstance().goActInvitation(activity));
-                                break;
-                            case "朗读文字":
-                                testReadText("小绵羊666", 20);
-                                break;
-                            case "测试插件":
-                                testPlugin(activity);
-                                break;
-                            case "测试bitmap":
-                                testBitmap();
-                                break;
-                            case "剪切视频":
-                                testCutVideo(activity);
-                                break;
-                            case "足迹":
-                                Jump2View.getInstance().goActFootPrint();
-                                break;
-                            case "我的关注":
-                                Jump2View.getInstance().goActMyFocus();
-                                break;
-                            case "测试联通卡":
-                                Jump2View.getInstance().goActOverrideJsWeb(activity, items[which], "http://10.8.210.236:5000/#/", "http://10.8.210.236:5000/chart.js");
-                                break;
-                            case "测试联通卡2":
-                                Jump2View.getInstance().goActOverrideJsWeb(activity, items[which], "http://10.8.210.236:5000/#/", "http://10.8.220.248/shared//html/test.js");
-                                break;
-                            case "测试孔剑秋faq正式服":
-                                Jump2View.getInstance().goWeb(activity, " http://10.8.210.236:8080/#/faq", items[which]);
-                                break;
-                            case "测试签名1":
-                                LogUtil.println("测试签名", ApkUtils.getApkSignMd5StrByPackageName("com.realicing.android.upgrade.sheep", null));
-                                break;
-                            case "测试签名2":
-                                testApkSign2();
-                                break;
-                            case "跳转QQ1":
-                                QQUtil.skip1(activity, "532588232");
-                                break;
-                            case "跳转QQ2":
-                                QQUtil.skip2(activity, "532588232");
-                                break;
-                            case "跳转QQ3":
-                                QQUtil.skip3(activity, "532588232");
-                                break;
-                            case "跳转白白QQ":
-                                QQUtil.skip3(activity, "2441310002");
-                                break;
-                            case "测试表情包":
-                                testExpression(activity);
-                                break;
-                            case "测试通知栏":
-                                testNotification(activity);
-                                break;
-                            case "测试自定义通知栏":
-                                Intent bdIntent = new Intent();
-                                bdIntent.setAction(JPushInterface.ACTION_MESSAGE_RECEIVED);
-                                Bundle bundle = new Bundle();
-                                bundle.putString(JPushInterface.EXTRA_MESSAGE, "测试" + JPushInterface.EXTRA_MESSAGE);
-                                Map<String, Object> map = new HashMap<>();
-                                map.put("title", "测试title");
-                                map.put("msg", "测试msgggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg");
-                                map.put("type", 71);
-                                map.put("url", "www.baidu.com");
-                                bundle.putString(JPushInterface.EXTRA_EXTRA, JSON.toJSONString(map));
-                                bdIntent.putExtras(bundle);
-                                activity.sendBroadcast(bdIntent);
-                                break;
-                            case "测试自定义通知栏2":
-                                Intent bdIntent2 = new Intent();
-                                bdIntent2.setAction(JPushInterface.ACTION_MESSAGE_RECEIVED);
-                                Bundle bundle2 = new Bundle();
-                                bundle2.putString(JPushInterface.EXTRA_MESSAGE, "测试" + JPushInterface.EXTRA_MESSAGE);
-                                Map<String, Object> map2 = new HashMap<>();
-                                map2.put("title", "测试title");
-                                map2.put("type", 71);
-                                map2.put("url", "www.baidu.com");
-                                bundle2.putString(JPushInterface.EXTRA_EXTRA, JSON.toJSONString(map2));
-                                bdIntent2.putExtras(bundle2);
-                                activity.sendBroadcast(bdIntent2);
-                                break;
-                            case "有米科技":
-                                Jump2View.getInstance().goYm(activity);
-                                break;
-                            case "手机型号测试":
-                                G.showToast(Build.BRAND);
-                                break;
-                            case "开启通知栏权限":
-                                NotificationsUtils.goToNotificationSetting(activity);
-                                break;
-                            case "开启通知栏权限0":
-                                NotificationsUtils.goToNotificationSetting0(activity);
-                                break;
-                            case "开启通知栏权限1":
-                                NotificationsUtils.goToNotificationSetting1(activity);
-                                break;
-                            case "开启通知栏权限2":
-                                NotificationsUtils.goToNotificationSetting2(activity);
-                                break;
-                            case "开启通知栏权限3":
-                                NotificationsUtils.goToNotificationSetting3(activity);
-                                break;
-                            case "通知栏权限1":
-                                G.showToast("" + NotificationManagerCompat.from(activity).areNotificationsEnabled());
-                                break;
-                            case "通知栏权限2":
-                                G.showToast("" + NotificationsUtils.isNotificationEnabled(activity));
-                                break;
-                            case "通知栏权限8.0":
-                                G.showToast("" + NotificationsUtils.isEnableV26(activity));
-                                break;
-                            case "测试支付":
-                                Jump2View.getInstance().goActPay(activity, "6460393611589586944", SpUtils.getToken(activity));
-                                break;
-                            case "测试内部h5":
-                                Jump2View.getInstance().goWeb(activity, "www.17xmy.com/", "小绵羊官网");
-                                break;
-                            case "测试外部h5":
-                                Jump2View.getInstance().goWeb(activity, "www.17xmy.com/");
-                                break;
-                            case "龙猫竞猜":
-                                try {
-                                    PackageUtil.startApp(SheepApp.getInstance(), Config.LONG_MAO_APP_PACKAGE_NAME);
-                                } catch (Exception e) {
-                                    G.showToast(e.getMessage());
-                                }
-                                break;
-                            case "龙猫竞猜-scheme":
-                                try {
-                                    Intent intent = Intent.parseUri(Config.LONG_MAO_APP_URI, Intent.URI_INTENT_SCHEME);
-                                    intent.setComponent(null);
-                                    activity.startActivity(intent);
-                                } catch (Exception e) {
-                                    G.showToast(e.getMessage());
-                                }
-                                break;
-                            case "会长推广游戏":
-                                new DialogGameOrTaskOrGift(activity, "1106204266").showDialog();
-                                break;
-                            case "移动积分兑换":
-                                Jump2View.getInstance().goActExchangeCMCC(activity);
-                                break;
-                            case "从jenkins下载小绵羊安装包":
-                                downloadApkFromJenkins(activity);
-                                break;
-                            case "审核中心":
-                                Jump2View.getInstance().goAuditTastList(activity, null);
-                                break;
-                            case "检查正版":
-                                PngUtil.isKfzsSheepApp();
-                                break;
-                            case "crc32":
-                                activity.startActivity(new Intent(activity, ActSheepPngList.class));
-                                break;
-                            case "loading":
-                                DialogLoading.showDialog(activity);
-                                break;
-                            case "progress":
-                                DialogProgress.showDialog(activity);
-                                break;
-                            case "查看截图":
-                                File root = DataUtil.getScreenShotsDir();
-                                if (!root.exists() || root.listFiles().length <= 0) {
-                                    G.showToast("暂无截图");
-                                } else {
-                                    File dir = DataUtil.getScreenShotsDir().listFiles()[0];
-                                    if (dir.exists()) {
-                                        G.showToast("截图个数为:" + dir.list().length);
-                                    } else {
-                                        G.showToast("截图目录不存在");
-                                    }
-                                    if (dir.list().length > 0) {
-                                        Jump2View.getInstance().selectImgFiles(activity, 7, dir.listFiles());
-                                    }
-                                }
-                                break;
-                            case "小米游戏":
-                                Jump2View.getInstance().goXiaomiGameList(activity, null);
-                                break;
-                            case "测试定位信息":
-                                String jsonString = LocationUtils.getInstance().getLocationJSONObject().toJSONString();
-                                G.showToast(jsonString);
-                                StringUtils.CopyText(jsonString);
-                                break;
-                            case "测试apk的渠道":
-                                Intent intent = new Intent(activity, ActSheepApkList.class);
-                                activity.startActivity(intent);
-                                break;
-                            case "测试可用金额":
-                                CommonUtil.getInstance()
-                                        .getVoucherAndRatio(activity, 115 + "", new Action1<BaseMessage>() {
-                                            @Override
-                                            public void call(BaseMessage baseMessage) {
+                .setItems(items, (dialog1, which) -> testFunction(activity, items[which])).create();
+        dialog.show();
+    }
 
-                                            }
-                                        });
-                                break;
-                            case "幂动科技":
-                                Jump2View.getInstance().goMiDong(activity, "http://10.8.210.172:8081/#/?authorization=123123");
-                                break;
-                            case "游戏帐号":
-                                Jump2View.getInstance().goGameAccount(activity, "http://10.8.210.172:8081/#/?authorization=123123");
-                                break;
-                            case "游戏代充":
-                                Jump2View.getInstance().goGameRecharge(activity, "http://10.8.210.172:8081/#/?authorization=123123");
-                                break;
-                            case "复制打点数据":
-                                UMConfigUtils.copyDaDianData();
-                                break;
-                            case "游戏搜索":
-                                Jump2View.getInstance().goGameSearch(activity, null);
-                                break;
-                            case "测试代理页面":
-                                CommonUtil.getInstance().initUrlConfigByNet("agenturl", new Action1<String>() {
-                                    @Override
-                                    public void call(String url) {
-                                        Jump2View.getInstance().goWeb(activity, url, "代理服务");
-                                    }
-                                });
-                                break;
-                            case "尝试开启第三方应用使用情况":
-                                AppUsageManager.getInstance().tryOpenLookAppUsageStatsPermission(false);
-                                break;
-                            case "第三方应用使用情况":
-                                AppUsageManager.getInstance().println();
-                                break;
-                            case "开启第三方应用使用情况":
-                                AppUsageManager.getInstance().openLookAppUsageStatsPermission();
-                                break;
-                            case "h5跳转":
-                                Jump2View.getInstance().goXianWanWeb(activity, null);
-                                break;
-                            case "新手对话框":
-                                DialogNewbieTaskList.tryShowDialog(activity);
-                                break;
-                            case "md5":
-                                String md5 = SysAppUtil.getConnectAdrressFileMD5();
-                                StringUtils.CopyText(md5);
-                                G.showToast(md5);
-                                break;
-                            case "空间不足提示框":
-                                DialogStorageLow.showDialog(null);
-                                break;
-                            case "显示已经安装应用列表":
-                                showHasInstallApkList(activity);
-                                break;
-                            case "添加token":
-                                CharSequence text = StringUtils.getCopyText();
-                                if(text != null) {
-                                    SpUtils.saveToken(activity, text.toString());
-                                    addUser(text.toString());
-                                }
-                                break;
-                            case "复制token":
-                                StringUtils.CopyText(SpUtils.getToken(activity));
-                                break;
-                            case "复制IMEI":
-                                StringUtils.CopyText(new DeviceUtils(activity).getIMEI());
-                                G.showToast(TimeUtil.newInstance().getDayBegin() + "|" + TimeUtil.newInstance().big2Today("2018-07-27", TimeUtil.FORMAT_DD_LINE));
-                                break;
-                            case "复制faq地址":
-                                copyUrl("faqurl");
-                                break;
-                            case "复制代理地址":
-                                copyUrl("agenturl");
-                                break;
-                            case "复制世界杯地址":
-                                copyUrl("world_cup_url");
-                                break;
-                            case "任务游戏列表":
-                                Jump2View.getInstance().goGameMakeMoney(activity, 0);
-                                break;
-                            case "世界杯活动":
-                                Jump2View.getInstance().goWeb(activity, SheepApp.getInstance().getConnectAddress().getWorldCupUrl(), "测试世界杯活动");
-                                break;
-                            case "交通银行信用卡测试":
-                                CreditCard creditCard = new CreditCard();
-                                creditCard.setCardName(items[which]);
-                                creditCard.setName("交通银行信用卡");
+    public static void testFunction(Activity activity, String item) {
+        if(activity == null){
+            return;
+        }
+        switch (item) {
+            case "测试升级对话框":
+                Version version = new Version();
+                version.setMd5_address("123456");
+                version.setVersion_name(BuildConfig.VERSION_NAME);
+                version.setUpdate_content("更新内容(测试):\n1.修复bug;\n2.优化界面;\n3.添加宠物模块");
+                SysAppUtil.showUpgradeByVersion(version, null);
+                break;
+            case "少数民族姓名":
+                G.showToast(Boolean.toString(StringUtils.isChineseName("麦麦提·阿尤甫")));
+                break;
+            case "开启皮肤":
+                SkinUtil.isUserPlugin = true;
+                break;
+            case "不开启皮肤":
+                SkinUtil.isUserPlugin = false;
+                break;
+            case "我的游戏":
+                Jump2View.getInstance().goActMyGameList(activity);
+                break;
+            case "优惠券弹窗":
+                ReceiveCouponsCheckResq receiveCouponsCheckResq = new ReceiveCouponsCheckResq();
+                receiveCouponsCheckResq.setAmount(6.0f);
+                ViewUtil.showYfShopAd(activity, receiveCouponsCheckResq);
+                break;
+            case "填写收件地址弹窗":
+                ViewUtil.showYfShopAsk(activity, "继续邀请", activity.getString(R.string.yf_shop_ask_tip, "987654311"), dialog1 -> Jump2View.getInstance().goActInvitation(activity));
+                break;
+            case "朗读文字":
+                testReadText("小绵羊666", 20);
+                break;
+            case "测试插件":
+                testPlugin(activity);
+                break;
+            case "测试bitmap":
+                testBitmap();
+                break;
+            case "剪切视频":
+                testCutVideo(activity);
+                break;
+            case "足迹":
+                Jump2View.getInstance().goActFootPrint();
+                break;
+            case "我的关注":
+                Jump2View.getInstance().goActMyFocus();
+                break;
+            case "测试联通卡":
+                Jump2View.getInstance().goActOverrideJsWeb(activity, item, "http://10.8.210.236:5000/#/", "http://10.8.210.236:5000/chart.js");
+                break;
+            case "测试联通卡2":
+                Jump2View.getInstance().goActOverrideJsWeb(activity, item, "http://10.8.210.236:5000/#/", "http://10.8.220.248/shared//html/test.js");
+                break;
+            case "测试孔剑秋faq正式服":
+                Jump2View.getInstance().goWeb(activity, " http://10.8.210.236:8080/#/faq", item);
+                break;
+            case "测试签名1":
+                LogUtil.println("测试签名", ApkUtils.getApkSignMd5StrByPackageName("com.realicing.android.upgrade.sheep", null));
+                break;
+            case "测试签名2":
+                testApkSign2();
+                break;
+            case "跳转QQ1":
+                QQUtil.skip1(activity, "532588232");
+                break;
+            case "跳转QQ2":
+                QQUtil.skip2(activity, "532588232");
+                break;
+            case "跳转QQ3":
+                QQUtil.skip3(activity, "532588232");
+                break;
+            case "跳转白白QQ":
+                QQUtil.skip3(activity, "2441310002");
+                break;
+            case "测试表情包":
+                testExpression(activity);
+                break;
+            case "测试通知栏":
+                testNotification(activity);
+                break;
+            case "测试自定义通知栏":
+                Intent bdIntent = new Intent();
+                bdIntent.setAction(JPushInterface.ACTION_MESSAGE_RECEIVED);
+                Bundle bundle = new Bundle();
+                bundle.putString(JPushInterface.EXTRA_MESSAGE, "测试" + JPushInterface.EXTRA_MESSAGE);
+                Map<String, Object> map = new HashMap<>();
+                map.put("title", "测试title");
+                map.put("msg", "测试msgggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg");
+                map.put("type", 71);
+                map.put("url", "www.baidu.com");
+                bundle.putString(JPushInterface.EXTRA_EXTRA, JSON.toJSONString(map));
+                bdIntent.putExtras(bundle);
+                activity.sendBroadcast(bdIntent);
+                break;
+            case "测试自定义通知栏2":
+                Intent bdIntent2 = new Intent();
+                bdIntent2.setAction(JPushInterface.ACTION_MESSAGE_RECEIVED);
+                Bundle bundle2 = new Bundle();
+                bundle2.putString(JPushInterface.EXTRA_MESSAGE, "测试" + JPushInterface.EXTRA_MESSAGE);
+                Map<String, Object> map2 = new HashMap<>();
+                map2.put("title", "测试title");
+                map2.put("type", 71);
+                map2.put("url", "www.baidu.com");
+                bundle2.putString(JPushInterface.EXTRA_EXTRA, JSON.toJSONString(map2));
+                bdIntent2.putExtras(bundle2);
+                activity.sendBroadcast(bdIntent2);
+                break;
+            case "有米科技":
+                Jump2View.getInstance().goYm(activity);
+                break;
+            case "手机型号测试":
+                G.showToast(Build.BRAND);
+                break;
+            case "开启通知栏权限":
+                NotificationsUtils.goToNotificationSetting(activity);
+                break;
+            case "开启通知栏权限0":
+                NotificationsUtils.goToNotificationSetting0(activity);
+                break;
+            case "开启通知栏权限1":
+                NotificationsUtils.goToNotificationSetting1(activity);
+                break;
+            case "开启通知栏权限2":
+                NotificationsUtils.goToNotificationSetting2(activity);
+                break;
+            case "开启通知栏权限3":
+                NotificationsUtils.goToNotificationSetting3(activity);
+                break;
+            case "通知栏权限1":
+                G.showToast("" + NotificationManagerCompat.from(activity).areNotificationsEnabled());
+                break;
+            case "通知栏权限2":
+                G.showToast("" + NotificationsUtils.isNotificationEnabled(activity));
+                break;
+            case "通知栏权限8.0":
+                G.showToast("" + NotificationsUtils.isEnableV26(activity));
+                break;
+            case "测试支付":
+                Jump2View.getInstance().goActPay(activity, "6460393611589586944", SpUtils.getToken(activity));
+                break;
+            case "测试内部h5":
+                Jump2View.getInstance().goWeb(activity, "www.17xmy.com/", "小绵羊官网");
+                break;
+            case "测试外部h5":
+                Jump2View.getInstance().goWeb(activity, "www.17xmy.com/");
+                break;
+            case "龙猫竞猜":
+                try {
+                    PackageUtil.startApp(SheepApp.getInstance(), Config.LONG_MAO_APP_PACKAGE_NAME);
+                } catch (Exception e) {
+                    G.showToast(e.getMessage());
+                }
+                break;
+            case "龙猫竞猜-scheme":
+                try {
+                    Intent intent = Intent.parseUri(Config.LONG_MAO_APP_URI, Intent.URI_INTENT_SCHEME);
+                    intent.setComponent(null);
+                    activity.startActivity(intent);
+                } catch (Exception e) {
+                    G.showToast(e.getMessage());
+                }
+                break;
+            case "会长推广游戏":
+                new DialogGameOrTaskOrGift(activity, "1106204266").showDialog();
+                break;
+            case "移动积分兑换":
+                Jump2View.getInstance().goActExchangeCMCC(activity);
+                break;
+            case "从jenkins下载小绵羊安装包":
+                downloadApkFromJenkins(activity);
+                break;
+            case "审核中心":
+                Jump2View.getInstance().goAuditTastList(activity, null);
+                break;
+            case "检查正版":
+                PngUtil.isKfzsSheepApp();
+                break;
+            case "crc32":
+                activity.startActivity(new Intent(activity, ActSheepPngList.class));
+                break;
+            case "loading":
+                DialogLoading.showDialog(activity);
+                break;
+            case "progress":
+                DialogProgress.showDialog(activity);
+                break;
+            case "查看截图":
+                File root = DataUtil.getScreenShotsDir();
+                if (!root.exists() || root.listFiles().length <= 0) {
+                    G.showToast("暂无截图");
+                } else {
+                    File dir = DataUtil.getScreenShotsDir().listFiles()[0];
+                    if (dir.exists()) {
+                        G.showToast("截图个数为:" + dir.list().length);
+                    } else {
+                        G.showToast("截图目录不存在");
+                    }
+                    if (dir.list().length > 0) {
+                        Jump2View.getInstance().selectImgFiles(activity, 7, dir.listFiles());
+                    }
+                }
+                break;
+            case "小米游戏":
+                Jump2View.getInstance().goXiaomiGameList(activity, null);
+                break;
+            case "测试定位信息":
+                String jsonString = LocationUtils.getInstance().getLocationJSONObject().toJSONString();
+                G.showToast(jsonString);
+                StringUtils.CopyText(jsonString);
+                break;
+            case "测试apk的渠道":
+                Intent intent = new Intent(activity, ActSheepApkList.class);
+                activity.startActivity(intent);
+                break;
+            case "测试可用金额":
+                CommonUtil.getInstance()
+                        .getVoucherAndRatio(activity, 115 + "", baseMessage -> {
+
+                        });
+                break;
+            case "幂动科技":
+                Jump2View.getInstance().goMiDong(activity, "http://10.8.210.172:8081/#/?authorization=123123");
+                break;
+            case "游戏帐号":
+                Jump2View.getInstance().goGameAccount(activity, "http://10.8.210.172:8081/#/?authorization=123123");
+                break;
+            case "游戏代充":
+                Jump2View.getInstance().goGameRecharge(activity, "http://10.8.210.172:8081/#/?authorization=123123");
+                break;
+            case "复制打点数据":
+                UMConfigUtils.copyDaDianData();
+                break;
+            case "游戏搜索":
+                Jump2View.getInstance().goGameSearch(activity, null);
+                break;
+            case "测试代理页面":
+                CommonUtil.getInstance().initUrlConfigByNet("agenturl", url -> Jump2View.getInstance().goWeb(activity, url, "代理服务"));
+                break;
+            case "尝试开启第三方应用使用情况":
+                AppUsageManager.getInstance().tryOpenLookAppUsageStatsPermission(false);
+                break;
+            case "第三方应用使用情况":
+                AppUsageManager.getInstance().println();
+                break;
+            case "开启第三方应用使用情况":
+                AppUsageManager.getInstance().openLookAppUsageStatsPermission();
+                break;
+            case "h5跳转":
+                Jump2View.getInstance().goXianWanWeb(activity, null);
+                break;
+            case "新手对话框":
+                DialogNewbieTaskList.tryShowDialog(activity);
+                break;
+            case "md5":
+                String md5 = SysAppUtil.getConnectAdrressFileMD5();
+                StringUtils.CopyText(md5);
+                G.showToast(md5);
+                break;
+            case "空间不足提示框":
+                DialogStorageLow.showDialog(null);
+                break;
+            case "显示已经安装应用列表":
+                showHasInstallApkList(activity);
+                break;
+            case "添加token":
+                CharSequence text = StringUtils.getCopyText();
+                if(text != null) {
+                    SpUtils.saveToken(activity, text.toString());
+                    addUser(text.toString());
+                }
+                break;
+            case "复制token":
+                StringUtils.CopyText(SpUtils.getToken(activity));
+                break;
+            case "复制IMEI":
+                StringUtils.CopyText(new DeviceUtils(activity).getIMEI());
+                G.showToast(TimeUtil.newInstance().getDayBegin() + "|" + TimeUtil.newInstance().big2Today("2018-07-27", TimeUtil.FORMAT_DD_LINE));
+                break;
+            case "复制faq地址":
+                copyUrl("faqurl");
+                break;
+            case "复制代理地址":
+                copyUrl("agenturl");
+                break;
+            case "复制世界杯地址":
+                copyUrl("world_cup_url");
+                break;
+            case "任务游戏列表":
+                Jump2View.getInstance().goGameMakeMoney(activity, 0);
+                break;
+            case "世界杯活动":
+                Jump2View.getInstance().goWeb(activity, SheepApp.getInstance().getConnectAddress().getWorldCupUrl(), "测试世界杯活动");
+                break;
+            case "交通银行信用卡测试":
+                CreditCard creditCard = new CreditCard();
+                creditCard.setCardName(item);
+                creditCard.setName("交通银行信用卡");
 //                                creditCard.setLoadUrl("http://mobi.yixiaozhao.jiyuonline.com/bank/10");
-                                creditCard.setLoadUrl("https://creditcardapp.bankcomm.com/applynew/front/apply/campus/index.html?trackCode=A021316596752");
-                                creditCard.setScriptUrl("http://10.8.210.172:8095/BCM_Insert.js");
-                                Jump2View.getInstance().goCreditCardWeb(activity, creditCard);
-                                break;
-                            case "测试游戏模块":
-                                Jump2View.getInstance().goMainGame(activity);
-                                break;
-                            case "打卡成功提示":
-                                ViewUtil.showMsgDialog(activity, new DialogConfig().setTitle("恭喜您").setMsg("打卡成功,活动结束后平分奖励会直接发放到个人账户中")
-                                        .setBtnLeftText("好的").setBtnRightText("查看战绩")
-                                        .setBtnRightOnClickListener(new View.OnClickListener() {
-                                            @Override
-                                            public void onClick(View view) {
-                                                Jump2View.getInstance().goSignRecordAct(activity, null);
-                                            }
-                                        }));
-                                break;
-                            case "检查标签":
-                                Jump2View.getInstance().checkLabel(activity, null);
-                                break;
-                            case "定向货币详情":
-                                ViewUtil.showOrienteeringDetails(activity);
-                                break;
-                            case "进入绑定身份认证界面时的提示":
-                                ViewUtil.showMsgDialog(activity, new DialogConfig().setTitle("温馨提示")
-                                        .setMsg("根据国家相关法律规定,为保障线上交易活动的安全,参与互联网大额提现等资金活动时需要进行实名认证。\n完成实名认证后,再次提现将不需要进行验证。")
-                                        .setMsgGravity(Gravity.START).setMsgIndent(2).setBtnLeftText("确定"));
-                                break;
-                            case "提交身份认证时的提示":
-                                ViewUtil.showMsgDialog(activity, new DialogConfig().setTitle("重要提示").setMsgMore(String.format(Locale.CHINA, "你已执行%d次实名认证操作", 0))
-                                        .setMsg("实名认证首次免费。请务必确认您所提交的认证信息真实有效。若因信息填写错误造成认证失败。再次申请认证时需扣除您0.5绵羊币/次作为认证费用,请务必谨慎填写认证信息。")
-                                        .setMsgColor("0.5绵羊币/次", "#FF0000")
-                                        .setMsgIndent(2)
-                                        .setMsgGravity(Gravity.START)
-                                        .setBtnLeftText("返回修改").setBtnRightText("确认提交")
-                                        .setBtnRightOnClickListener(new View.OnClickListener() {
-                                            @Override
-                                            public void onClick(View view) {
-                                                G.showToast("下一步提交");
-                                            }
-                                        }));
-                                break;
-                            case "浦发银行信用卡测试":
-                                CreditCard creditCard1 = new CreditCard();
-                                creditCard1.setCardName(items[which]);
-                                creditCard1.setName("浦发银行信用卡");
-                                creditCard1.setLoadUrl("https://ecentre.spdbccc.com.cn/creditcard/indexActivity.htm?data=P754372&itemcode=2017000032");
-                                creditCard1.setScriptUrl("http://10.8.210.172:8095/SPDB_Insert.js");
-                                Jump2View.getInstance().goCreditCardWeb(activity, creditCard1);
-                                break;
-                            case "友盟分享":
-                                TestUtil.getInstance().testUmen(activity);
-                            case "了解小绵羊":
-                                Jump2View.getInstance().goUnderstandSheep(activity, null);
-                                break;
-                            case "提现成功":
-                                Jump2View.getInstance().goWithdrawalResultview(activity, 1000);
-                                break;
+                creditCard.setLoadUrl("https://creditcardapp.bankcomm.com/applynew/front/apply/campus/index.html?trackCode=A021316596752");
+                creditCard.setScriptUrl("http://10.8.210.172:8095/BCM_Insert.js");
+                Jump2View.getInstance().goCreditCardWeb(activity, creditCard);
+                break;
+            case "测试游戏模块":
+                Jump2View.getInstance().goMainGame(activity);
+                break;
+            case "打卡成功提示":
+                ViewUtil.showMsgDialog(activity, new DialogConfig().setTitle("恭喜您").setMsg("打卡成功,活动结束后平分奖励会直接发放到个人账户中")
+                        .setBtnLeftText("好的").setBtnRightText("查看战绩")
+                        .setBtnRightOnClickListener(view -> Jump2View.getInstance().goSignRecordAct(activity, null)));
+                break;
+            case "检查标签":
+                Jump2View.getInstance().checkLabel(activity, null);
+                break;
+            case "定向货币详情":
+                ViewUtil.showOrienteeringDetails(activity);
+                break;
+            case "进入绑定身份认证界面时的提示":
+                ViewUtil.showMsgDialog(activity, new DialogConfig().setTitle("温馨提示")
+                        .setMsg("根据国家相关法律规定,为保障线上交易活动的安全,参与互联网大额提现等资金活动时需要进行实名认证。\n完成实名认证后,再次提现将不需要进行验证。")
+                        .setMsgGravity(Gravity.START).setMsgIndent(2).setBtnLeftText("确定"));
+                break;
+            case "提交身份认证时的提示":
+                ViewUtil.showMsgDialog(activity, new DialogConfig().setTitle("重要提示").setMsgMore(String.format(Locale.CHINA, "你已执行%d次实名认证操作", 0))
+                        .setMsg("实名认证首次免费。请务必确认您所提交的认证信息真实有效。若因信息填写错误造成认证失败。再次申请认证时需扣除您0.5绵羊币/次作为认证费用,请务必谨慎填写认证信息。")
+                        .setMsgColor("0.5绵羊币/次", "#FF0000")
+                        .setMsgIndent(2)
+                        .setMsgGravity(Gravity.START)
+                        .setBtnLeftText("返回修改").setBtnRightText("确认提交")
+                        .setBtnRightOnClickListener(view -> G.showToast("下一步提交")));
+                break;
+            case "浦发银行信用卡测试":
+                CreditCard creditCard1 = new CreditCard();
+                creditCard1.setCardName(item);
+                creditCard1.setName("浦发银行信用卡");
+                creditCard1.setLoadUrl("https://ecentre.spdbccc.com.cn/creditcard/indexActivity.htm?data=P754372&itemcode=2017000032");
+                creditCard1.setScriptUrl("http://10.8.210.172:8095/SPDB_Insert.js");
+                Jump2View.getInstance().goCreditCardWeb(activity, creditCard1);
+                break;
+            case "友盟分享":
+                TestUtil.getInstance().testUmen(activity);
+            case "了解小绵羊":
+                Jump2View.getInstance().goUnderstandSheep(activity, null);
+                break;
+            case "提现成功":
+                Jump2View.getInstance().goWithdrawalResultview(activity, 1000);
+                break;
 
-                        }
-                    }
-                }).create();
-        dialog.show();
+        }
     }
 
     private static void testReadText(String msg, float pitch) {

+ 14 - 35
app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java

@@ -4,8 +4,6 @@ import android.app.ActionBar;
 import android.app.Activity;
 import android.app.Dialog;
 import android.app.ProgressDialog;
-import android.content.ClipData;
-import android.content.ClipboardManager;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
@@ -84,7 +82,6 @@ import com.sheep.gamegroup.model.entity.RobTask;
 import com.sheep.gamegroup.model.entity.TaskEty;
 import com.sheep.gamegroup.model.entity.WebParams;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
-import com.sheep.gamegroup.module.game.fragment.FgtMyGameList;
 import com.sheep.gamegroup.module.skin.util.SkinUtil;
 import com.sheep.gamegroup.module.yf_shop.model.ReceiveCouponsCheckResq;
 import com.sheep.gamegroup.module.yf_shop.model.ReceiveCouponsResp;
@@ -505,41 +502,22 @@ public class ViewUtil {
         }
         popupWindow.setOnDismissListener(new PopDismissListener(mActivity));
         tvTitle.setText("兑换");
-        tvGetRedPackage.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                if (TextUtils.isEmpty(edInvitationCode.getText())) {
-                    G.showToast("邀请码不能为空!");
-                } else {
-                    fgtPersonalCenter.getRedPackage(edInvitationCode.getText().toString(), popupWindow);
-                    popupWindow.dismiss();
-                }
-            }
-        });
-        edInvitationCode.setOnLongClickListener(new View.OnLongClickListener() {
-            @Override
-            public boolean onLongClick(View view) {
-                // 获取系统剪贴板
-                ClipboardManager clipboard = (ClipboardManager) mActivity.getSystemService(Context.CLIPBOARD_SERVICE);
-                // 获取剪贴板的剪贴数据集
-                ClipData clipData = clipboard.getPrimaryClip();
-
-                if (clipData != null && clipData.getItemCount() > 0) {
-                    // 从数据集中获取(粘贴)第一条文本数据
-                    CharSequence codetext = clipData.getItemAt(0).getText();
-                    if (!TextUtils.isEmpty(codetext)) {
-                        edInvitationCode.setText(codetext);
-                    }
-                }
-                return false;
+        tvGetRedPackage.setOnClickListener(v -> {
+            if (TextUtils.isEmpty(edInvitationCode.getText())) {
+                G.showToast("邀请码不能为空!");
+            } else {
+                fgtPersonalCenter.getRedPackage(edInvitationCode.getText().toString(), popupWindow);
+                popupWindow.dismiss();
             }
         });
-        ivClose.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View view) {
-                popupWindow.dismiss();
+        edInvitationCode.setOnLongClickListener(view1 -> {
+            CharSequence text = StringUtils.getCopyText();
+            if(!TextUtils.isEmpty(text)){
+                edInvitationCode.setText(text);
             }
+            return false;
         });
+        ivClose.setOnClickListener(view12 -> popupWindow.dismiss());
 
     }
 
@@ -1123,7 +1101,8 @@ public class ViewUtil {
         return showMsgDialog(context, new DialogConfig().setMsg(msg).setTitle(title).setFinish(isFinish).setBtnLeftText("知道了"));
     }
 
-    public static AlertDialog showMsgDialog(Context mContext, final DialogConfig dialogConfig) {
+    public static AlertDialog showMsgDialog(Context context, final DialogConfig dialogConfig) {
+        Context mContext = context == null ? SheepApp.getInstance() : context;
         String title = dialogConfig.getTitle();
         String msg = dialogConfig.getMsg();
         String msgMore = dialogConfig.getMsgMore();

+ 9 - 10
app/src/main/java/com/sheep/gamegroup/view/activity/ActMain.java

@@ -232,11 +232,15 @@ public class ActMain extends BaseActYmPermissionCheck {
             FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
             Fragment cFragment = getSupportFragmentManager().findFragmentByTag("fragment_" + position);
             Fragment lFragment = getSupportFragmentManager().findFragmentByTag("fragment_" + lastPosition);
-            transaction.hide(lFragment);
-            transaction.show(cFragment);
+            if(lFragment != null)
+                transaction.hide(lFragment);
+            if(cFragment != null)
+                transaction.show(cFragment);
             transaction.commitAllowingStateLoss();
-            lFragment.setUserVisibleHint(false);
-            cFragment.setUserVisibleHint(true);
+            if(lFragment != null)
+                lFragment.setUserVisibleHint(false);
+            if(cFragment != null)
+                cFragment.setUserVisibleHint(true);
         }
         changeVisible(lastPosition, position);
         lastPosition = position;
@@ -337,12 +341,7 @@ public class ActMain extends BaseActYmPermissionCheck {
             }
         } else {
             if (onResumeCount == 0 && !TestUtil.isDev()) {
-                SysAppUtil.showVersionInfo(this, SpUtils.getIgnoreMd5(), new Action1<Integer>() {
-                    @Override
-                    public void call(Integer integer) {
-                        Jump2View.getInstance().tryShowHalfScreenAd(ActMain.this, getContainer());
-                    }
-                });
+                SysAppUtil.showVersionInfo(this, SpUtils.getIgnoreMd5(), integer -> Jump2View.getInstance().tryShowHalfScreenAd(ActMain.this, getContainer()));
             }
         }
         onResumeCount++;

+ 25 - 14
app/src/main/java/com/sheep/gamegroup/view/activity/ActSetting.java

@@ -15,6 +15,7 @@ import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.SysAppUtil;
 import com.sheep.gamegroup.util.ViewUtil;
+import com.sheep.jiuyan.samllsheep.Config;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
@@ -57,9 +58,10 @@ public class ActSetting extends BaseActivity {
     @Override
     public void initData() {
         initCacheSize();
+        initCopyState();
     }
 
-    @OnClick({R.id.change_password_layout, R.id.abourt_us_layout, R.id.clear_layout, R.id.tv_submit, R.id.change_layout})
+    @OnClick({R.id.change_password_layout, R.id.abourt_us_layout, R.id.clear_layout, R.id.tv_submit, R.id.copy_text_layout, R.id.change_layout})
     public void onClick(View view) {
         switch (view.getId()) {
             case R.id.change_password_layout:
@@ -71,21 +73,25 @@ public class ActSetting extends BaseActivity {
             case R.id.change_layout://新功能介绍
                 Jump2View.getInstance().goVersionChange(activity, ApkUtils.getCurrentPkgVersionName(SheepApp.getInstance()));
                 break;
+            case R.id.copy_text_layout://粘贴板助手
+                boolean opened = DataUtil.toggleAsBoolean(Config.KEY_ENABLE_CHECK_COPY_TEXT, Config.dvbEnableCheckCopyText());
+                initCopyState();
+                if(opened){
+                    ViewUtil.showMsgDialog(activity, getString(R.string.copy_assistant_tip));
+                }
+                break;
             case R.id.clear_layout://清除缓存
                 ViewUtil.showMsgDialog(activity, new DialogConfig().setTitle("清除缓存").setMsg("所有本地的缓存都会被清理").setBtnRightText("取消")
-                        .setBtnLeftText("确定").setBtnLeftOnClickListener(new View.OnClickListener() {
-                            @Override
-                            public void onClick(View view) {
-                                USER_CLEAN_SURE.onEvent();
-                                SysAppUtil.clearCache(new AbsObserver<Object>() {
-                                    @Override
-                                    public void onNext(Object o) {
-                                        DataUtil.putAsInt(DataKey.KEY_ORDER, 1);
-                                        G.showToast("清理缓存完成");
-                                        initCacheSize();
-                                    }
-                                });
-                            }
+                        .setBtnLeftText("确定").setBtnLeftOnClickListener(view1 -> {
+                            USER_CLEAN_SURE.onEvent();
+                            SysAppUtil.clearCache(new AbsObserver<Object>() {
+                                @Override
+                                public void onNext(Object o) {
+                                    DataUtil.putAsInt(DataKey.KEY_ORDER, 1);
+                                    G.showToast("清理缓存完成");
+                                    initCacheSize();
+                                }
+                            });
                         }));
                 USER_CLEAN.onEvent();
                 break;
@@ -102,5 +108,10 @@ public class ActSetting extends BaseActivity {
         String size = SysAppUtil.getAppCacheSize();
         clear_item_tv.setText(TextUtils.isEmpty(size) || TextUtils.equals("0K", size) ? "无需清理" : size);
     }
+    @BindView(R.id.copy_text_tv)
+    TextView copy_text_tv;
+    private void initCopyState() {
+        copy_text_tv.setText(DataUtil.getAsBoolean(Config.KEY_ENABLE_CHECK_COPY_TEXT, Config.dvbEnableCheckCopyText()) ? R.string.opened : R.string.closed);
+    }
 
 }

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtPersonalCenter.java

@@ -265,7 +265,7 @@ public class FgtPersonalCenter extends BaseFragment {
         moduleList.setLayoutManager(manager);
         AdpHomeList<UserCenterModule> adapter = new AdpHomeList<>(userCenterModuleList);
         adapter.bindToRecyclerView(moduleList);
-        adapter.setOnItemChildClickListener((adapter1, view, position) -> CommonUtil.getInstance().goNative(SheepApp.getInstance().getCurrentActivity(), ListUtil.getItem(userCenterModuleList, position), "个人中心"));
+        adapter.setOnItemClickListener((adapter1, view, position) -> CommonUtil.getInstance().goNative(SheepApp.getInstance().getCurrentActivity(), ListUtil.getItem(userCenterModuleList, position), "个人中心"));
     }
 
     //通过缓存数据初始化用户中心模块列表

+ 15 - 36
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSmallSheep.java

@@ -3,8 +3,6 @@ package com.sheep.gamegroup.view.fragment;
 import android.annotation.SuppressLint;
 import android.app.ActionBar;
 import android.app.Activity;
-import android.content.ClipData;
-import android.content.ClipboardManager;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
@@ -44,7 +42,6 @@ import com.alibaba.fastjson.JSONArray;
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
 import com.bumptech.glide.request.RequestOptions;
-import com.chad.library.adapter.base.BaseQuickAdapter;
 import com.kfzs.duanduan.utils.NumberFormatUtils;
 import com.scwang.smartrefresh.layout.SmartRefreshLayout;
 import com.scwang.smartrefresh.layout.api.RefreshLayout;
@@ -83,6 +80,7 @@ import com.sheep.gamegroup.util.GlideImageLoader;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.RefreshUtil;
+import com.sheep.gamegroup.util.StringUtils;
 import com.sheep.gamegroup.util.SysAppUtil;
 import com.sheep.gamegroup.util.TestUtil;
 import com.sheep.gamegroup.util.UMConfigUtils;
@@ -280,41 +278,22 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
         }
         popupWindow.setOnDismissListener(new ViewUtil.PopDismissListener(mActivity));
         tvTitle.setText("邀请码领取,金额更大");
-        tvGetRedPackage.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                if (TextUtils.isEmpty(edInvitationCode.getText())) {
-                    G.showToast("邀请码不能为空!");
-                } else {
-                    fgtSmallSheep.getRedPackage(edInvitationCode.getText().toString(), popupWindow);
-                    popupWindow.dismiss();
-                }
-            }
-        });
-        edInvitationCode.setOnLongClickListener(new View.OnLongClickListener() {
-            @Override
-            public boolean onLongClick(View view) {
-                // 获取系统剪贴板
-                ClipboardManager clipboard = (ClipboardManager) mActivity.getSystemService(Context.CLIPBOARD_SERVICE);
-                // 获取剪贴板的剪贴数据集
-                ClipData clipData = clipboard.getPrimaryClip();
-
-                if (clipData != null && clipData.getItemCount() > 0) {
-                    // 从数据集中获取(粘贴)第一条文本数据
-                    CharSequence codetext = clipData.getItemAt(0).getText();
-                    if (!TextUtils.isEmpty(codetext)) {
-                        edInvitationCode.setText(codetext);
-                    }
-                }
-                return false;
+        tvGetRedPackage.setOnClickListener(v -> {
+            if (TextUtils.isEmpty(edInvitationCode.getText())) {
+                G.showToast("邀请码不能为空!");
+            } else {
+                fgtSmallSheep.getRedPackage(edInvitationCode.getText().toString(), popupWindow);
+                popupWindow.dismiss();
             }
         });
-        ivClose.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View view) {
-                popupWindow.dismiss();
+        edInvitationCode.setOnLongClickListener(view1 -> {
+            CharSequence text = StringUtils.getCopyText();
+            if(!TextUtils.isEmpty(text)){
+                edInvitationCode.setText(text);
             }
+            return false;
         });
+        ivClose.setOnClickListener(view12 -> popupWindow.dismiss());
     }
 
     @OnClick(R.id.to_search_but)
@@ -1513,7 +1492,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
      * 新手任务
      */
     private void addNewTask() {
-        boolean isNewYear = SkinUtil.getSkinByTime() == Plugin.skin_new_year;
+        boolean isNewYear = SkinUtil.isLoadNewYearSkin();
         if(isNewYear) {//新年皮肤,加载网络图片
             int max = 11;
             int i = 0;
@@ -1544,7 +1523,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
     }
 
     private void setValueList(boolean flag) {
-        boolean isNewYear = SkinUtil.getSkinByTime() == Plugin.skin_new_year;
+        boolean isNewYear = SkinUtil.isLoadNewYearSkin();
         homeListList.clear();
         for (int i = 0; i < homeListEntitys.size(); i++) {
             if (flag) {

+ 14 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/Config.java

@@ -1,5 +1,8 @@
 package com.sheep.jiuyan.samllsheep;
 
+import com.sheep.gamegroup.model.entity.UserEntity;
+import com.sheep.gamegroup.util.DataUtil;
+
 /**
  * Created by kemllor on 2017/12/14.
  */
@@ -50,4 +53,15 @@ public class Config {
 
     //微信支付app_id
     public static final String WX_PAY_APP_ID = "wx427e8e74e8dd27a6";
+
+
+    //缓存数据的key
+    public static final String KEY_ENABLE_CHECK_COPY_TEXT = "enable_check_copy_text";//是否开启粘贴板助手的key boolean
+    public static final String KEY_USED_COPY_TEXT = "used_copy_text";//忽略的复制内容的key String
+
+    //默认值
+    public static boolean dvbEnableCheckCopyText(){//游戏用户默认开启检查粘贴板
+        UserEntity userEntity = DataUtil.getInstance().getUserEntity();
+        return userEntity != null && userEntity.isGameUser();
+    }
 }

+ 4 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/SheepApp.java

@@ -31,6 +31,7 @@ import com.sheep.gamegroup.usage.AppUsageManager;
 import com.sheep.gamegroup.util.AppUtil;
 import com.sheep.gamegroup.util.CertificationUtil;
 import com.sheep.gamegroup.util.ChannelContent;
+import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.ConfigUtil;
 import com.sheep.gamegroup.util.ConnectAddress;
 import com.sheep.gamegroup.util.DataKey;
@@ -475,6 +476,9 @@ public class SheepApp extends MultiDexApplication {
                     Jump2View.getInstance().startShotScreenFloat(activity, false);
                 }
             }
+            if (mActivityCount == 1) { // 应用回到前台
+                CommonUtil.getInstance().checkCopyText();
+            }
         }
 
         @Override

+ 16 - 0
app/src/main/res/layout/act_setting.xml

@@ -57,6 +57,22 @@
         </LinearLayout>
 
         <View style="@style/style_item_line" />
+        <LinearLayout
+            android:id="@+id/copy_text_layout"
+            style="@style/style_item_container">
+
+            <TextView
+                style="@style/style_item_label"
+                android:text="@string/copy_assistant" />
+
+            <TextView
+                android:id="@+id/copy_text_tv"
+                style="@style/style_item_end"
+                android:text="@string/opened" />
+
+        </LinearLayout>
+
+        <View style="@style/style_item_line" />
 
         <LinearLayout
             android:id="@+id/clear_layout"

+ 4 - 4
app/src/main/res/values/dd_styles.xml

@@ -340,7 +340,7 @@
 
     <style name="style_item_line">
         <item name="android:layout_width">match_parent</item>
-        <item name="android:layout_height">1px</item>
+        <item name="android:layout_height">1dp</item>
         <item name="android:layout_marginEnd">@dimen/content_padding</item>
         <item name="android:layout_marginStart">@dimen/content_padding</item>
         <item name="android:background">@color/white_bg_line</item>
@@ -348,14 +348,14 @@
 
     <style name="style_item_line_3_0">
         <item name="android:layout_width">match_parent</item>
-        <item name="android:layout_height">1px</item>
+        <item name="android:layout_height">1dp</item>
         <item name="android:layout_marginStart">20dp</item>
         <item name="android:background">@color/white_bg_line</item>
     </style>
 
     <style name="style_item_line_new">
         <item name="android:layout_width">match_parent</item>
-        <item name="android:layout_height">1px</item>
+        <item name="android:layout_height">1dp</item>
         <item name="android:layout_marginEnd">@dimen/content_padding</item>
         <item name="android:layout_marginStart">@dimen/content_padding_left_new</item>
         <item name="android:background">@color/white_bg_line</item>
@@ -363,7 +363,7 @@
 
     <style name="style_item_line_full">
         <item name="android:layout_width">match_parent</item>
-        <item name="android:layout_height">1px</item>
+        <item name="android:layout_height">1dp</item>
         <item name="android:background">@color/white_bg_line</item>
     </style>
 

+ 5 - 1
app/src/main/res/values/strings.xml

@@ -216,5 +216,9 @@
 
     <!-- WXPayEntryActivity -->
     <string name="pay_result_tip">这个界面用于显示第三方app通过微信支付的结果</string>
-    <string name="pay_result_callback_msg" formatted="false">微信支付结果:%s</string>
+
+    <string name="copy_assistant">启动检查粘贴板</string>
+    <string name="copy_assistant_tip">如果您是游戏玩家,恭喜您,通过复制链接,然后回到小绵羊,可以实现快速进入游戏,快去尝试吧!</string>
+    <string name="opened">已开启</string>
+    <string name="closed">已关闭</string>
 </resources>

+ 2 - 2
gradle.properties

@@ -17,8 +17,8 @@
 # org.gradle.parallel=true
 #android.injected.build.model.only.versioned = 3
 
-VERSION_NAME=3.4.9
-VERSION_CODE=3004009
+VERSION_NAME=3.4.10
+VERSION_CODE=3004010
 ANDROID_COMPILE_SDK_VERSION=28
 ANDROID_MIN_SDK_VERSION=18
 ANDORID_TARGET_SDK_VERSION=28