Kaynağa Gözat

face detect & newbie guide

billyyoyo 6 yıl önce
ebeveyn
işleme
0400d7c07c
76 değiştirilmiş dosya ile 1475 ekleme ve 97 silme
  1. 3 1
      app/build.gradle
  2. BIN
      app/libs/face-sdk-release.aar
  3. BIN
      app/libs/newbie-guide-2.4.0.1.aar
  4. 14 0
      app/src/main/AndroidManifest.xml
  5. 2 0
      app/src/main/assets/idl-license.face-android
  6. 42 0
      app/src/main/java/cn/finalteam/rxgalleryfinal/utils/CameraUtil.java
  7. 1 0
      app/src/main/java/com/sheep/gamegroup/event/EventTypes.java
  8. 15 15
      app/src/main/java/com/sheep/gamegroup/greendao/download/DaoMaster.java
  9. 62 62
      app/src/main/java/com/sheep/gamegroup/greendao/download/DaoSession.java
  10. 10 1
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  11. 102 0
      app/src/main/java/com/sheep/gamegroup/model/entity/QRCode.java
  12. 36 0
      app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtGameCenter.java
  13. 305 0
      app/src/main/java/com/sheep/gamegroup/module/guide/NewbieGuideHelper.java
  14. 8 0
      app/src/main/java/com/sheep/gamegroup/module/home/fragment/FgtHome.java
  15. 24 0
      app/src/main/java/com/sheep/gamegroup/module/home/fragment/FgtMainHeader.java
  16. 13 4
      app/src/main/java/com/sheep/gamegroup/module/login/LoginAct.java
  17. 142 0
      app/src/main/java/com/sheep/gamegroup/module/qrcode/FaceWithQRActivity.java
  18. 144 0
      app/src/main/java/com/sheep/gamegroup/module/qrcode/QRCodeActivity.java
  19. 66 0
      app/src/main/java/com/sheep/gamegroup/module/qrcode/QRCodeCaptureHelper.java
  20. 18 4
      app/src/main/java/com/sheep/gamegroup/util/CertificationUtil.java
  21. 3 0
      app/src/main/java/com/sheep/gamegroup/util/Constant.java
  22. 15 0
      app/src/main/java/com/sheep/gamegroup/util/Jump2View.java
  23. 4 0
      app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java
  24. 1 1
      app/src/main/java/com/sheep/gamegroup/view/activity/ActBindMobileRegister.java
  25. 58 7
      app/src/main/java/com/sheep/gamegroup/view/activity/ActMain.java
  26. 14 2
      app/src/main/java/com/sheep/gamegroup/view/activity/GameCertificationActivity.java
  27. 30 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtPersonalCenter.java
  28. 12 0
      app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSmallSheep.java
  29. 3 0
      app/src/main/java/com/sheep/jiuyan/samllsheep/Config.java
  30. 13 0
      app/src/main/java/com/sheep/jiuyan/samllsheep/SheepApp.java
  31. 19 0
      app/src/main/res/layout/act_qrcode.xml
  32. 10 0
      app/src/main/res/layout/fgt_main_header.xml
  33. 1 0
      app/src/main/res/layout/fgt_personalcenter_layout.xml
  34. 20 0
      app/src/main/res/layout/newbie_guide_1.xml
  35. 29 0
      app/src/main/res/layout/newbie_guide_10.xml
  36. 12 0
      app/src/main/res/layout/newbie_guide_2_1.xml
  37. 20 0
      app/src/main/res/layout/newbie_guide_2_2.xml
  38. 12 0
      app/src/main/res/layout/newbie_guide_2_3.xml
  39. 20 0
      app/src/main/res/layout/newbie_guide_3_1.xml
  40. 14 0
      app/src/main/res/layout/newbie_guide_3_2.xml
  41. 20 0
      app/src/main/res/layout/newbie_guide_4.xml
  42. 20 0
      app/src/main/res/layout/newbie_guide_5.xml
  43. 22 0
      app/src/main/res/layout/newbie_guide_6.xml
  44. 24 0
      app/src/main/res/layout/newbie_guide_7.xml
  45. 13 0
      app/src/main/res/layout/newbie_guide_8_1.xml
  46. 13 0
      app/src/main/res/layout/newbie_guide_8_2.xml
  47. 15 0
      app/src/main/res/layout/newbie_guide_8_3.xml
  48. 29 0
      app/src/main/res/layout/newbie_guide_9.xml
  49. BIN
      app/src/main/res/mipmap-xxhdpi/scan.png
  50. BIN
      app/src/main/res/mipmap/guide_10_1.png
  51. BIN
      app/src/main/res/mipmap/guide_10_2.png
  52. BIN
      app/src/main/res/mipmap/guide_10_3.png
  53. BIN
      app/src/main/res/mipmap/guide_1_1.png
  54. BIN
      app/src/main/res/mipmap/guide_1_2.png
  55. BIN
      app/src/main/res/mipmap/guide_2_1.png
  56. BIN
      app/src/main/res/mipmap/guide_2_2.png
  57. BIN
      app/src/main/res/mipmap/guide_2_3.png
  58. BIN
      app/src/main/res/mipmap/guide_2_4.png
  59. BIN
      app/src/main/res/mipmap/guide_3_1.png
  60. BIN
      app/src/main/res/mipmap/guide_3_2.png
  61. BIN
      app/src/main/res/mipmap/guide_3_3.png
  62. BIN
      app/src/main/res/mipmap/guide_4_1.png
  63. BIN
      app/src/main/res/mipmap/guide_4_2.png
  64. BIN
      app/src/main/res/mipmap/guide_5_1.png
  65. BIN
      app/src/main/res/mipmap/guide_5_2.png
  66. BIN
      app/src/main/res/mipmap/guide_6_1.png
  67. BIN
      app/src/main/res/mipmap/guide_6_2.png
  68. BIN
      app/src/main/res/mipmap/guide_7_1.png
  69. BIN
      app/src/main/res/mipmap/guide_7_2.png
  70. BIN
      app/src/main/res/mipmap/guide_8_1.png
  71. BIN
      app/src/main/res/mipmap/guide_8_2.png
  72. BIN
      app/src/main/res/mipmap/guide_8_3.png
  73. BIN
      app/src/main/res/mipmap/guide_9_1.png
  74. BIN
      app/src/main/res/mipmap/guide_9_2.png
  75. BIN
      app/src/main/res/mipmap/guide_9_3.png
  76. 2 0
      app/src/main/res/values/key_strings.xml

+ 3 - 1
app/build.gradle

@@ -192,7 +192,7 @@ dependencies {
         exclude group: 'com.android.support', module: 'support-v4'
     }
 
-    //    implementation 'com.github.huburt-Hu:NewbieGuide:v1.2.0'
+    implementation(name: 'newbie-guide-2.4.0.1', ext: 'aar')
     debugImplementation 'com.android.support:multidex:1.0.1'
 
     //不要修改这里,相信我
@@ -441,6 +441,8 @@ dependencies {
     implementation 'com.github.ly-android:PermissionUtils:1.0.3'
     implementation files('libs/ipaynow_base_2.1.9_api1.0.0.jar')
     implementation files('libs/ipaynow_wechatpay_v2.0.5.jar')
+
+    implementation(name: 'face-sdk-release', ext: 'aar')
 }
 
 static def releaseTime() {

BIN
app/libs/face-sdk-release.aar


BIN
app/libs/newbie-guide-2.4.0.1.aar


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

@@ -862,6 +862,20 @@
             android:screenOrientation="behind"
             android:theme="@style/AppActionTheme" />
         <activity
+            android:name="com.sheep.gamegroup.module.qrcode.FaceWithQRActivity"
+            android:configChanges="orientation|screenSize"
+            android:exported="true"
+            android:launchMode="singleInstance"
+            android:screenOrientation="behind"
+            android:theme="@style/AppActionTheme" />
+        <activity
+            android:name="com.sheep.gamegroup.module.qrcode.QRCodeActivity"
+            android:configChanges="orientation|screenSize"
+            android:exported="true"
+            android:launchMode="singleInstance"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppActionTheme" />
+        <activity
             android:name="com.sheep.gamegroup.view.activity.GameCertificationActivity"
             android:exported="true"
             android:screenOrientation="behind"

Dosya farkı çok büyük olduğundan ihmal edildi
+ 2 - 0
app/src/main/assets/idl-license.face-android


+ 42 - 0
app/src/main/java/cn/finalteam/rxgalleryfinal/utils/CameraUtil.java

@@ -5,6 +5,7 @@ import android.app.Activity;
 import android.content.ContentValues;
 import android.content.Intent;
 import android.content.pm.PackageManager;
+import android.hardware.Camera;
 import android.net.Uri;
 import android.os.Build;
 import android.provider.MediaStore;
@@ -100,4 +101,45 @@ public class CameraUtil {
     public static final String VIDEO_STORE_FILE_NAME = "VIDEO_%s.mp4";
     public static final int TAKE_IMAGE_REQUEST_CODE = 1001;
     public static final int TAKE_VIDEO_REQUEST_CODE = 1002;
+
+    private static boolean checkCameraFacing(final int facing) {
+        final int cameraCount = Camera.getNumberOfCameras();
+        Camera.CameraInfo info = new Camera.CameraInfo();
+        for (int i = 0; i < cameraCount; i++) {
+            Camera.getCameraInfo(i, info);
+            if (facing == info.facing) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public static boolean hasCamera() {
+        return hasBackFacingCamera() || hasFrontFacingCamera();
+    }
+
+    public static boolean hasBackFacingCamera() {
+        final int CAMERA_FACING_BACK = 0;
+        return checkCameraFacing(CAMERA_FACING_BACK);
+    }
+
+    public static boolean hasFrontFacingCamera() {
+        final int CAMERA_FACING_BACK = 1;
+        return checkCameraFacing(CAMERA_FACING_BACK);
+    }
+
+    public static boolean isCameraCanUse() {
+        boolean canUse = true;
+        Camera mCamera = null;
+        try {
+            mCamera = Camera.open();
+        } catch (Exception e) {
+            canUse = false;
+        }
+        if (canUse) {
+            mCamera.release();
+            mCamera = null;
+        }
+        return canUse;
+    }
 }

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/event/EventTypes.java

@@ -29,6 +29,7 @@ public enum EventTypes {
     REFRESH_DATA_SIGN,//签到对话框
 
     GUIDE_NEXT,//引导页面下一步操作
+    GUIDE_NEXT_NEXT,//引导页面下一步操作
     DELETE_GAME_ACCOUNT_REFRESH,//游戏删除账号,刷新界面
     GENERATION_ACCOUNT_REFRESH,//游戏代充,刷新界面
     DOWNLOAD_START,//下载开始

+ 15 - 15
app/src/main/java/com/sheep/gamegroup/greendao/download/DaoMaster.java

@@ -21,26 +21,26 @@ public class DaoMaster extends AbstractDaoMaster {
 
     /** Creates underlying database table using DAOs. */
     public static void createAllTables(Database db, boolean ifNotExists) {
-        ProcessRecordDao.createTable(db, ifNotExists);
-        AppdownloadBeanDao.createTable(db, ifNotExists);
         SdkLoginUserDao.createTable(db, ifNotExists);
-        ScreenShotRecordDao.createTable(db, ifNotExists);
         AcceptTaskRecordDao.createTable(db, ifNotExists);
-        AccountDao.createTable(db, ifNotExists);
-        SearchRecordDao.createTable(db, ifNotExists);
+        AppdownloadBeanDao.createTable(db, ifNotExists);
         DownLoadInfoDao.createTable(db, ifNotExists);
+        SearchRecordDao.createTable(db, ifNotExists);
+        ProcessRecordDao.createTable(db, ifNotExists);
+        AccountDao.createTable(db, ifNotExists);
+        ScreenShotRecordDao.createTable(db, ifNotExists);
     }
 
     /** Drops underlying database table using DAOs. */
     public static void dropAllTables(Database db, boolean ifExists) {
-        ProcessRecordDao.dropTable(db, ifExists);
-        AppdownloadBeanDao.dropTable(db, ifExists);
         SdkLoginUserDao.dropTable(db, ifExists);
-        ScreenShotRecordDao.dropTable(db, ifExists);
         AcceptTaskRecordDao.dropTable(db, ifExists);
-        AccountDao.dropTable(db, ifExists);
-        SearchRecordDao.dropTable(db, ifExists);
+        AppdownloadBeanDao.dropTable(db, ifExists);
         DownLoadInfoDao.dropTable(db, ifExists);
+        SearchRecordDao.dropTable(db, ifExists);
+        ProcessRecordDao.dropTable(db, ifExists);
+        AccountDao.dropTable(db, ifExists);
+        ScreenShotRecordDao.dropTable(db, ifExists);
     }
 
     /**
@@ -59,14 +59,14 @@ public class DaoMaster extends AbstractDaoMaster {
 
     public DaoMaster(Database db) {
         super(db, SCHEMA_VERSION);
-        registerDaoClass(ProcessRecordDao.class);
-        registerDaoClass(AppdownloadBeanDao.class);
         registerDaoClass(SdkLoginUserDao.class);
-        registerDaoClass(ScreenShotRecordDao.class);
         registerDaoClass(AcceptTaskRecordDao.class);
-        registerDaoClass(AccountDao.class);
-        registerDaoClass(SearchRecordDao.class);
+        registerDaoClass(AppdownloadBeanDao.class);
         registerDaoClass(DownLoadInfoDao.class);
+        registerDaoClass(SearchRecordDao.class);
+        registerDaoClass(ProcessRecordDao.class);
+        registerDaoClass(AccountDao.class);
+        registerDaoClass(ScreenShotRecordDao.class);
     }
 
     public DaoSession newSession() {

+ 62 - 62
app/src/main/java/com/sheep/gamegroup/greendao/download/DaoSession.java

@@ -8,23 +8,23 @@ import org.greenrobot.greendao.database.Database;
 import org.greenrobot.greendao.identityscope.IdentityScopeType;
 import org.greenrobot.greendao.internal.DaoConfig;
 
-import com.sheep.gamegroup.greendao.download.ProcessRecord;
-import com.sheep.gamegroup.greendao.download.AppdownloadBean;
 import com.sheep.gamegroup.greendao.download.SdkLoginUser;
-import com.sheep.gamegroup.greendao.download.ScreenShotRecord;
 import com.sheep.gamegroup.greendao.download.AcceptTaskRecord;
-import com.sheep.gamegroup.greendao.download.Account;
-import com.sheep.gamegroup.greendao.download.SearchRecord;
+import com.sheep.gamegroup.greendao.download.AppdownloadBean;
 import com.sheep.gamegroup.greendao.download.DownLoadInfo;
+import com.sheep.gamegroup.greendao.download.SearchRecord;
+import com.sheep.gamegroup.greendao.download.ProcessRecord;
+import com.sheep.gamegroup.greendao.download.Account;
+import com.sheep.gamegroup.greendao.download.ScreenShotRecord;
 
-import com.sheep.gamegroup.greendao.download.ProcessRecordDao;
-import com.sheep.gamegroup.greendao.download.AppdownloadBeanDao;
 import com.sheep.gamegroup.greendao.download.SdkLoginUserDao;
-import com.sheep.gamegroup.greendao.download.ScreenShotRecordDao;
 import com.sheep.gamegroup.greendao.download.AcceptTaskRecordDao;
-import com.sheep.gamegroup.greendao.download.AccountDao;
-import com.sheep.gamegroup.greendao.download.SearchRecordDao;
+import com.sheep.gamegroup.greendao.download.AppdownloadBeanDao;
 import com.sheep.gamegroup.greendao.download.DownLoadInfoDao;
+import com.sheep.gamegroup.greendao.download.SearchRecordDao;
+import com.sheep.gamegroup.greendao.download.ProcessRecordDao;
+import com.sheep.gamegroup.greendao.download.AccountDao;
+import com.sheep.gamegroup.greendao.download.ScreenShotRecordDao;
 
 // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
 
@@ -35,112 +35,112 @@ import com.sheep.gamegroup.greendao.download.DownLoadInfoDao;
  */
 public class DaoSession extends AbstractDaoSession {
 
-    private final DaoConfig processRecordDaoConfig;
-    private final DaoConfig appdownloadBeanDaoConfig;
     private final DaoConfig sdkLoginUserDaoConfig;
-    private final DaoConfig screenShotRecordDaoConfig;
     private final DaoConfig acceptTaskRecordDaoConfig;
-    private final DaoConfig accountDaoConfig;
-    private final DaoConfig searchRecordDaoConfig;
+    private final DaoConfig appdownloadBeanDaoConfig;
     private final DaoConfig downLoadInfoDaoConfig;
+    private final DaoConfig searchRecordDaoConfig;
+    private final DaoConfig processRecordDaoConfig;
+    private final DaoConfig accountDaoConfig;
+    private final DaoConfig screenShotRecordDaoConfig;
 
-    private final ProcessRecordDao processRecordDao;
-    private final AppdownloadBeanDao appdownloadBeanDao;
     private final SdkLoginUserDao sdkLoginUserDao;
-    private final ScreenShotRecordDao screenShotRecordDao;
     private final AcceptTaskRecordDao acceptTaskRecordDao;
-    private final AccountDao accountDao;
-    private final SearchRecordDao searchRecordDao;
+    private final AppdownloadBeanDao appdownloadBeanDao;
     private final DownLoadInfoDao downLoadInfoDao;
+    private final SearchRecordDao searchRecordDao;
+    private final ProcessRecordDao processRecordDao;
+    private final AccountDao accountDao;
+    private final ScreenShotRecordDao screenShotRecordDao;
 
     public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
             daoConfigMap) {
         super(db);
 
-        processRecordDaoConfig = daoConfigMap.get(ProcessRecordDao.class).clone();
-        processRecordDaoConfig.initIdentityScope(type);
-
-        appdownloadBeanDaoConfig = daoConfigMap.get(AppdownloadBeanDao.class).clone();
-        appdownloadBeanDaoConfig.initIdentityScope(type);
-
         sdkLoginUserDaoConfig = daoConfigMap.get(SdkLoginUserDao.class).clone();
         sdkLoginUserDaoConfig.initIdentityScope(type);
 
-        screenShotRecordDaoConfig = daoConfigMap.get(ScreenShotRecordDao.class).clone();
-        screenShotRecordDaoConfig.initIdentityScope(type);
-
         acceptTaskRecordDaoConfig = daoConfigMap.get(AcceptTaskRecordDao.class).clone();
         acceptTaskRecordDaoConfig.initIdentityScope(type);
 
-        accountDaoConfig = daoConfigMap.get(AccountDao.class).clone();
-        accountDaoConfig.initIdentityScope(type);
+        appdownloadBeanDaoConfig = daoConfigMap.get(AppdownloadBeanDao.class).clone();
+        appdownloadBeanDaoConfig.initIdentityScope(type);
+
+        downLoadInfoDaoConfig = daoConfigMap.get(DownLoadInfoDao.class).clone();
+        downLoadInfoDaoConfig.initIdentityScope(type);
 
         searchRecordDaoConfig = daoConfigMap.get(SearchRecordDao.class).clone();
         searchRecordDaoConfig.initIdentityScope(type);
 
-        downLoadInfoDaoConfig = daoConfigMap.get(DownLoadInfoDao.class).clone();
-        downLoadInfoDaoConfig.initIdentityScope(type);
+        processRecordDaoConfig = daoConfigMap.get(ProcessRecordDao.class).clone();
+        processRecordDaoConfig.initIdentityScope(type);
+
+        accountDaoConfig = daoConfigMap.get(AccountDao.class).clone();
+        accountDaoConfig.initIdentityScope(type);
+
+        screenShotRecordDaoConfig = daoConfigMap.get(ScreenShotRecordDao.class).clone();
+        screenShotRecordDaoConfig.initIdentityScope(type);
 
-        processRecordDao = new ProcessRecordDao(processRecordDaoConfig, this);
-        appdownloadBeanDao = new AppdownloadBeanDao(appdownloadBeanDaoConfig, this);
         sdkLoginUserDao = new SdkLoginUserDao(sdkLoginUserDaoConfig, this);
-        screenShotRecordDao = new ScreenShotRecordDao(screenShotRecordDaoConfig, this);
         acceptTaskRecordDao = new AcceptTaskRecordDao(acceptTaskRecordDaoConfig, this);
-        accountDao = new AccountDao(accountDaoConfig, this);
-        searchRecordDao = new SearchRecordDao(searchRecordDaoConfig, this);
+        appdownloadBeanDao = new AppdownloadBeanDao(appdownloadBeanDaoConfig, this);
         downLoadInfoDao = new DownLoadInfoDao(downLoadInfoDaoConfig, this);
+        searchRecordDao = new SearchRecordDao(searchRecordDaoConfig, this);
+        processRecordDao = new ProcessRecordDao(processRecordDaoConfig, this);
+        accountDao = new AccountDao(accountDaoConfig, this);
+        screenShotRecordDao = new ScreenShotRecordDao(screenShotRecordDaoConfig, this);
 
-        registerDao(ProcessRecord.class, processRecordDao);
-        registerDao(AppdownloadBean.class, appdownloadBeanDao);
         registerDao(SdkLoginUser.class, sdkLoginUserDao);
-        registerDao(ScreenShotRecord.class, screenShotRecordDao);
         registerDao(AcceptTaskRecord.class, acceptTaskRecordDao);
-        registerDao(Account.class, accountDao);
-        registerDao(SearchRecord.class, searchRecordDao);
+        registerDao(AppdownloadBean.class, appdownloadBeanDao);
         registerDao(DownLoadInfo.class, downLoadInfoDao);
+        registerDao(SearchRecord.class, searchRecordDao);
+        registerDao(ProcessRecord.class, processRecordDao);
+        registerDao(Account.class, accountDao);
+        registerDao(ScreenShotRecord.class, screenShotRecordDao);
     }
     
     public void clear() {
-        processRecordDaoConfig.clearIdentityScope();
-        appdownloadBeanDaoConfig.clearIdentityScope();
         sdkLoginUserDaoConfig.clearIdentityScope();
-        screenShotRecordDaoConfig.clearIdentityScope();
         acceptTaskRecordDaoConfig.clearIdentityScope();
-        accountDaoConfig.clearIdentityScope();
-        searchRecordDaoConfig.clearIdentityScope();
+        appdownloadBeanDaoConfig.clearIdentityScope();
         downLoadInfoDaoConfig.clearIdentityScope();
+        searchRecordDaoConfig.clearIdentityScope();
+        processRecordDaoConfig.clearIdentityScope();
+        accountDaoConfig.clearIdentityScope();
+        screenShotRecordDaoConfig.clearIdentityScope();
     }
 
-    public ProcessRecordDao getProcessRecordDao() {
-        return processRecordDao;
+    public SdkLoginUserDao getSdkLoginUserDao() {
+        return sdkLoginUserDao;
+    }
+
+    public AcceptTaskRecordDao getAcceptTaskRecordDao() {
+        return acceptTaskRecordDao;
     }
 
     public AppdownloadBeanDao getAppdownloadBeanDao() {
         return appdownloadBeanDao;
     }
 
-    public SdkLoginUserDao getSdkLoginUserDao() {
-        return sdkLoginUserDao;
+    public DownLoadInfoDao getDownLoadInfoDao() {
+        return downLoadInfoDao;
     }
 
-    public ScreenShotRecordDao getScreenShotRecordDao() {
-        return screenShotRecordDao;
+    public SearchRecordDao getSearchRecordDao() {
+        return searchRecordDao;
     }
 
-    public AcceptTaskRecordDao getAcceptTaskRecordDao() {
-        return acceptTaskRecordDao;
+    public ProcessRecordDao getProcessRecordDao() {
+        return processRecordDao;
     }
 
     public AccountDao getAccountDao() {
         return accountDao;
     }
 
-    public SearchRecordDao getSearchRecordDao() {
-        return searchRecordDao;
-    }
-
-    public DownLoadInfoDao getDownLoadInfoDao() {
-        return downLoadInfoDao;
+    public ScreenShotRecordDao getScreenShotRecordDao() {
+        return screenShotRecordDao;
     }
 
 }

+ 10 - 1
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -1595,7 +1595,7 @@ public interface ApiService {
      * @return
      */
     @GET("app/sdk/{game_key}")
-    Observable<BaseMessage> verificationAuth(@Header("Authorization") String token, @Path("game_key") String game_key);
+    Observable<BaseMessage> verificationAuth(@Header("Authorization") String token, @Path("game_key") String game_key, @Query("game_id") String game_id, @Query("face_url") String face);
 
     /**
      * 绵羊币支付订单查询接口
@@ -1950,4 +1950,13 @@ public interface ApiService {
     @POST("app/h5game/record")
     Observable<BaseMessage> recordH5GameAction(@Body JSONObject jsonObject);
 
+    @POST("app/sdk/qr_code")
+    Observable<BaseMessage> createQRCodeAction(@Header("Authorization") String token, @Body JSONObject json);
+
+    @GET("app/sdk/qr_code/{code}")
+    Observable<BaseMessage> getQRCodeInfo(@Header("Authorization") String token, @Path("code") String code);
+
+    @PUT("app/sdk/qr_code")
+    Observable<BaseMessage> submitQRCodeResult(@Header("Authorization") String token, @Body JSONObject json);
+
 }

+ 102 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/QRCode.java

@@ -0,0 +1,102 @@
+package com.sheep.gamegroup.model.entity;
+
+public class QRCode {
+
+    private int id;
+    //二维码扫描的结果
+    private String action_content;
+    private int bind_user;
+    private String code;
+    //需要执行的扫码后续功能
+    private String content;
+    private long expire_time;
+    private String ip;
+    private String qr_url;
+    private int relation_id;
+    private int status;
+
+
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public String getAction_content() {
+        return action_content;
+    }
+
+    public void setAction_content(String action_content) {
+        this.action_content = action_content;
+    }
+
+    public int getBind_user() {
+        return bind_user;
+    }
+
+    public void setBind_user(int bind_user) {
+        this.bind_user = bind_user;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public long getExpire_time() {
+        return expire_time;
+    }
+
+    public void setExpire_time(long expire_time) {
+        this.expire_time = expire_time;
+    }
+
+    public String getIp() {
+        return ip;
+    }
+
+    public void setIp(String ip) {
+        this.ip = ip;
+    }
+
+    public String getQr_url() {
+        return qr_url;
+    }
+
+    public void setQr_url(String qr_url) {
+        this.qr_url = qr_url;
+    }
+
+    public int getRelation_id() {
+        return relation_id;
+    }
+
+    public void setRelation_id(int relation_id) {
+        this.relation_id = relation_id;
+    }
+
+    public int getStatus() {
+        return status;
+    }
+
+    public void setStatus(int status) {
+        this.status = status;
+    }
+
+    public boolean isExpired() {
+        return System.currentTimeMillis() > expire_time * 1000;
+    }
+}

+ 36 - 0
app/src/main/java/com/sheep/gamegroup/module/game/fragment/FgtGameCenter.java

@@ -1,6 +1,8 @@
 package com.sheep.gamegroup.module.game.fragment;
 
 import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
 import android.support.design.widget.TabLayout;
 import android.support.v4.app.Fragment;
 import android.support.v4.view.ViewPager;
@@ -10,9 +12,11 @@ import android.view.View;
 import android.widget.Button;
 import android.widget.ImageView;
 
+import com.sheep.gamegroup.event.BigEvent;
 import com.sheep.gamegroup.event.WebViewEvent;
 import com.sheep.gamegroup.model.entity.ArticleTag;
 import com.sheep.gamegroup.model.entity.WebParams;
+import com.sheep.gamegroup.module.guide.NewbieGuideHelper;
 import com.sheep.gamegroup.module.webview.fragment.FgtWeb;
 import com.sheep.gamegroup.module.webview.fragment.FgtWebX5;
 import com.sheep.gamegroup.util.CommonUtil;
@@ -32,6 +36,8 @@ import com.snail.antifake.jni.EmulatorDetectUtil;
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
 
+import java.lang.ref.WeakReference;
+
 import butterknife.BindView;
 import butterknife.OnClick;
 
@@ -42,6 +48,11 @@ import butterknife.OnClick;
  */
 public class FgtGameCenter extends BaseFragment {
 
+    private final static int WHAT_TRY_SWITCH_MAIN_TAB = 0;
+    private final static int WHAT_TRY_SHOW_NEWBIE_GUIDE = 1;
+
+    public static WeakReference<TabLayout> gameRef;
+
     private Fragment gameMallFgt;
 
     @BindView(R.id.indicator)
@@ -53,6 +64,10 @@ public class FgtGameCenter extends BaseFragment {
     @BindView(R.id.fgt_gc_hb_500_yuan_iv)
     ImageView fgt_gc_hb_500_yuan_iv;
 
+    public static View getTab(int i){
+        return gameRef.get().getTabAt(i).view;
+    }
+
     @Override
     public void onCreate(Bundle bundle) {
         super.onCreate(bundle);
@@ -73,6 +88,7 @@ public class FgtGameCenter extends BaseFragment {
     @Override
     public void onViewCreated() {
         initView();
+        gameRef = new WeakReference<>(indicator);
     }
 
     private void initView() {
@@ -151,4 +167,24 @@ public class FgtGameCenter extends BaseFragment {
         }
     }
 
+    @Subscribe
+    public void onEventMainThread(BigEvent event) {
+        switch (event.getEventTypes()) {
+            case GUIDE_NEXT_NEXT:
+                mHandler.sendEmptyMessage(WHAT_TRY_SWITCH_MAIN_TAB);
+                mHandler.sendEmptyMessageDelayed(WHAT_TRY_SHOW_NEWBIE_GUIDE, 300);
+                break;
+        }
+    }
+
+    private Handler mHandler = new Handler() {
+        public void handleMessage(Message msg) {
+            if (msg.what == WHAT_TRY_SWITCH_MAIN_TAB) {
+                ((ActMain)getActivity()).switchFragment(2);
+            } else if(msg.what == WHAT_TRY_SHOW_NEWBIE_GUIDE) {
+                new NewbieGuideHelper(getActivity()).show(NewbieGuideHelper.GUIDE_GAME);
+            }
+        }
+    };
+
 }

+ 305 - 0
app/src/main/java/com/sheep/gamegroup/module/guide/NewbieGuideHelper.java

@@ -0,0 +1,305 @@
+package com.sheep.gamegroup.module.guide;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.DashPathEffect;
+import android.graphics.Paint;
+import android.graphics.RectF;
+import android.support.constraint.solver.widgets.Rectangle;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.animation.AlphaAnimation;
+import android.view.animation.Animation;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.app.hubert.guide.NewbieGuide;
+import com.app.hubert.guide.core.Builder;
+import com.app.hubert.guide.core.Controller;
+import com.app.hubert.guide.listener.OnGuideChangedListener;
+import com.app.hubert.guide.listener.OnHighlightDrewListener;
+import com.app.hubert.guide.listener.OnLayoutInflatedListener;
+import com.app.hubert.guide.listener.OnPageChangedListener;
+import com.app.hubert.guide.model.GuidePage;
+import com.app.hubert.guide.model.HighLight;
+import com.app.hubert.guide.model.HighlightOptions;
+import com.app.hubert.guide.model.RelativeGuide;
+import com.kfzs.duanduan.cardview.ScreenUtil;
+import com.sheep.gamegroup.event.BigEvent;
+import com.sheep.gamegroup.greendao.DDProviderHelper;
+import com.sheep.gamegroup.module.game.fragment.FgtGameCenter;
+import com.sheep.gamegroup.module.home.fragment.FgtHome;
+import com.sheep.gamegroup.module.home.fragment.FgtMainHeader;
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.view.activity.ActMain;
+import com.sheep.gamegroup.view.fragment.FgtPersonalCenter;
+import com.sheep.gamegroup.view.fragment.FgtSmallSheep;
+import com.sheep.jiuyan.samllsheep.R;
+
+import org.greenrobot.eventbus.EventBus;
+import org.xutils.common.util.LogUtil;
+
+import java.util.Arrays;
+import java.util.List;
+
+import static com.sheep.gamegroup.event.EventTypes.GUIDE_NEXT_NEXT;
+
+public class NewbieGuideHelper {
+
+    private final static String TAG = "NewbieGuide";
+
+    public final static int GUIDE_HOME = 0;
+    public final static int GUIDE_GAME = 1;
+    public final static int GUIDE_USER = 2;
+    public final static int GUIDE_FAQ = 3;
+
+    private Activity mActivity;
+    private Animation enterAnimation;
+    private Animation exitAnimation;
+
+    public NewbieGuideHelper(Activity mActivity) {
+        this.mActivity = mActivity;
+        enterAnimation = new AlphaAnimation(0f, 1f);
+        enterAnimation.setDuration(300);
+        enterAnimation.setFillAfter(true);
+
+        exitAnimation = new AlphaAnimation(1f, 0f);
+        exitAnimation.setDuration(300);
+        exitAnimation.setFillAfter(true);
+    }
+
+    public void show(int type) {
+        String label = DataUtil.getInstance().getUserId()+ "_page_" + type;
+        if (isShowed(label)) return;
+        showed(label);
+        List<GuidePage> pages = null;
+        if (type == GUIDE_HOME) {
+            pages = Arrays.asList(getPage1(), getPage2(), getPage3(), getPage4());
+        } else if (type == GUIDE_USER) {
+            pages = Arrays.asList(getPage5(), getPage6());
+        } else if (type == GUIDE_FAQ) {
+            pages = Arrays.asList(getPage7());
+        } else if (type == GUIDE_GAME) {
+            pages = Arrays.asList(getPage8(), getPage9(), getPage10());
+        } else {
+            return;
+        }
+        Builder builder = NewbieGuide.with(mActivity)
+                .setLabel(label)//设置引导层标示区分不同引导层,必传!否则报错
+                .setOnGuideChangedListener(new OnGuideChangedListener() {
+                    @Override
+                    public void onShowed(Controller controller) {
+                        LogUtil.i(TAG + " onShowed: ");
+                        //引导层显示
+                    }
+
+                    @Override
+                    public void onRemoved(Controller controller) {
+                        Log.e(TAG, "NewbieGuide  onRemoved: ");
+                        if (type == GUIDE_HOME) {
+                            Jump2View.getInstance().goPersonnalCenterView(mActivity, null);
+                        } else if (type == GUIDE_USER) {
+                            FgtPersonalCenter.scrollToBottom(mActivity);
+                        } else if (type == GUIDE_FAQ) {
+                            EventBus.getDefault().post(new BigEvent(GUIDE_NEXT_NEXT));
+                            mActivity.finish();
+                        } else if (type == GUIDE_GAME) {
+
+                        }
+                    }
+                })
+                .setOnPageChangedListener(new OnPageChangedListener() {
+
+                    @Override
+                    public void onPageChanged(int page) {
+                        //引导页切换,page为当前页位置,从0开始
+                    }
+                })
+                .alwaysShow(true);//是否每次都显示引导层,默认false,只显示一次
+        for (GuidePage page : pages) {
+            builder.addGuidePage(page);
+        }
+        builder.show();
+    }
+
+    private GuidePage getPage1() {
+        RelativeGuide relativeGuide = new RelativeGuide(R.layout.newbie_guide_1, Gravity.RIGHT, 0) {
+            @Override
+            protected void offsetMargin(MarginInfo marginInfo, ViewGroup viewGroup, View view) {
+                marginInfo.leftMargin -= ScreenUtil.dip2px(mActivity, 30);
+                marginInfo.topMargin += ScreenUtil.dip2px(mActivity, 20);
+            }
+        };
+        return GuidePage.newInstance()//创建一个实例
+                .addHighLightWithOptions(ActMain.tabBtn1.get(), HighLight.Shape.CIRCLE, new HighlightOptions.Builder().useMaxSize(false).build())
+                .addHighLightWithOptions(FgtSmallSheep.listRef.get(), HighLight.Shape.OVAL, new HighlightOptions.Builder().setRelativeGuide(relativeGuide).useMaxSize(false).setOffsetWidth(0.25f).setOffsetHeight(0.5f).build())
+                .setEnterAnimation(enterAnimation)//进入动画
+                .setExitAnimation(exitAnimation);//退出动画
+    }
+
+    private GuidePage getPage2() {
+        RelativeGuide relativeGuide1 = new RelativeGuide(R.layout.newbie_guide_2_1, Gravity.RIGHT, 0) {
+            @Override
+            protected void offsetMargin(MarginInfo marginInfo, ViewGroup viewGroup, View view) {
+                marginInfo.leftMargin -= ScreenUtil.dip2px(mActivity, 70);
+                marginInfo.topMargin -= ScreenUtil.dip2px(mActivity, 40);
+            }
+        };
+        RelativeGuide relativeGuide2 = new RelativeGuide(R.layout.newbie_guide_2_2, Gravity.LEFT, 0) {
+            @Override
+            protected void offsetMargin(MarginInfo marginInfo, ViewGroup viewGroup, View view) {
+                marginInfo.rightMargin -= ScreenUtil.dip2px(mActivity, 40);
+            }
+        };
+        RelativeGuide relativeGuide3 = new RelativeGuide(R.layout.newbie_guide_2_3, Gravity.TOP, 0) {
+            @Override
+            protected void offsetMargin(MarginInfo marginInfo, ViewGroup viewGroup, View view) {
+                marginInfo.bottomMargin -= ScreenUtil.dip2px(mActivity, 8);
+                marginInfo.leftMargin += ScreenUtil.dip2px(mActivity, 50);
+            }
+        };
+        return GuidePage.newInstance()//创建一个实例
+                .addHighLightWithOptions(ActMain.tabBtn1.get(), HighLight.Shape.CIRCLE, new HighlightOptions.Builder().setRelativeGuide(relativeGuide3).useMaxSize(false).build())
+                .addHighLightWithOptions(FgtMainHeader.msgRef.get(), HighLight.Shape.CIRCLE, new HighlightOptions.Builder().setRelativeGuide(relativeGuide2).useMaxSize(true).build())
+                .addHighLightWithOptions(FgtHome.newsRef.get(), HighLight.Shape.OVAL, new HighlightOptions.Builder().setRelativeGuide(relativeGuide1).useMaxSize(false).setOffsetLeft(0.2f).setOffsetWidth(0.6f).build())
+                .setEnterAnimation(enterAnimation)//进入动画
+                .setExitAnimation(exitAnimation);//退出动画;
+    }
+
+    private GuidePage getPage3() {
+        RelativeGuide relativeGuide = new RelativeGuide(R.layout.newbie_guide_3_1, Gravity.RIGHT, 0) {
+            @Override
+            protected void offsetMargin(MarginInfo marginInfo, ViewGroup viewGroup, View view) {
+                marginInfo.leftMargin -= ScreenUtil.dip2px(mActivity, 50);
+                marginInfo.topMargin -= ScreenUtil.dip2px(mActivity, 4);
+            }
+        };
+        return GuidePage.newInstance()//创建一个实例
+                .addHighLightWithOptions(ActMain.tabBtn1.get(), HighLight.Shape.CIRCLE, new HighlightOptions.Builder().useMaxSize(false).build())
+                .addHighLightWithOptions(FgtMainHeader.faceRef.get(), HighLight.Shape.CIRCLE, new HighlightOptions.Builder().setRelativeGuide(relativeGuide).useMaxSize(true).build())
+                .setLayoutRes(R.layout.newbie_guide_3_2)
+                .setEnterAnimation(enterAnimation)//进入动画
+                .setExitAnimation(exitAnimation);//退出动画
+    }
+
+    private GuidePage getPage4() {
+        RelativeGuide relativeGuide = new RelativeGuide(R.layout.newbie_guide_4, Gravity.LEFT, 0) {
+            @Override
+            protected void offsetMargin(MarginInfo marginInfo, ViewGroup viewGroup, View view) {
+                marginInfo.rightMargin -= ScreenUtil.dip2px(mActivity, 20);
+                marginInfo.topMargin += ScreenUtil.dip2px(mActivity, 10);
+            }
+        };
+        int round = ScreenUtil.dip2px(mActivity, 20);
+        return GuidePage.newInstance()//创建一个实例
+                .addHighLightWithOptions(ActMain.tabBtn1.get(), HighLight.Shape.CIRCLE, new HighlightOptions.Builder().useMaxSize(false).build())
+                .addHighLightWithOptions(FgtHome.meetRef.get(), HighLight.Shape.ROUND_RECTANGLE, round, 0, new HighlightOptions.Builder().setRelativeGuide(relativeGuide).build())
+                .setEnterAnimation(enterAnimation)//进入动画
+                .setExitAnimation(exitAnimation);//退出动画
+    }
+
+    private GuidePage getPage5() {
+        RelativeGuide relativeGuide = new RelativeGuide(R.layout.newbie_guide_5, Gravity.BOTTOM, 0) {
+            @Override
+            protected void offsetMargin(MarginInfo marginInfo, ViewGroup viewGroup, View view) {
+            }
+        };
+        return GuidePage.newInstance()//创建一个实例
+                .addHighLightWithOptions(FgtPersonalCenter.myMoneyRef.get(), HighLight.Shape.RECTANGLE, new HighlightOptions.Builder().setRelativeGuide(relativeGuide).build())
+                .setEnterAnimation(enterAnimation)//进入动画
+                .setExitAnimation(exitAnimation);//退出动画
+    }
+
+    private GuidePage getPage6() {
+        RelativeGuide relativeGuide = new RelativeGuide(R.layout.newbie_guide_6, Gravity.TOP, 0) {
+            @Override
+            protected void offsetMargin(MarginInfo marginInfo, ViewGroup viewGroup, View view) {
+                marginInfo.bottomMargin -= ScreenUtil.dip2px(mActivity, 100);
+            }
+        };
+        return GuidePage.newInstance()//创建一个实例
+                .addHighLightWithOptions(FgtPersonalCenter.accountDetailRef.get(), HighLight.Shape.RECTANGLE, new HighlightOptions.Builder().setRelativeGuide(relativeGuide).build())
+                .setEnterAnimation(enterAnimation)//进入动画
+                .setExitAnimation(exitAnimation);//退出动画
+    }
+
+    private GuidePage getPage7() {
+        RelativeGuide relativeGuide = new RelativeGuide(R.layout.newbie_guide_7, Gravity.TOP, 0);
+        return GuidePage.newInstance()//创建一个实例
+                .addHighLightWithOptions(FgtPersonalCenter.fagRef.get(), HighLight.Shape.RECTANGLE, new HighlightOptions.Builder().setRelativeGuide(relativeGuide).build())
+                .setEnterAnimation(enterAnimation)//进入动画
+                .setExitAnimation(exitAnimation);//退出动画
+    }
+
+    private GuidePage getPage8() {
+        RelativeGuide relativeGuide1 = new RelativeGuide(R.layout.newbie_guide_8_1, Gravity.BOTTOM, 0) {
+            @Override
+            protected void offsetMargin(MarginInfo marginInfo, ViewGroup viewGroup, View view) {
+                marginInfo.topMargin -= ScreenUtil.dip2px(mActivity, 40);
+            }
+        };
+        RelativeGuide relativeGuide2 = new RelativeGuide(R.layout.newbie_guide_8_2, Gravity.BOTTOM, 0) {
+            @Override
+            protected void offsetMargin(MarginInfo marginInfo, ViewGroup viewGroup, View view) {
+                marginInfo.leftMargin -= ScreenUtil.dip2px(mActivity, 43);
+                marginInfo.topMargin -= ScreenUtil.dip2px(mActivity, 36);
+            }
+        };
+        return GuidePage.newInstance()//创建一个实例
+                .addHighLightWithOptions(ActMain.tabBtn2.get(), HighLight.Shape.CIRCLE, new HighlightOptions.Builder().useMaxSize(false).build())
+                .addHighLightWithOptions(FgtMainHeader.downloadRef.get(), HighLight.Shape.CIRCLE, new HighlightOptions.Builder().setRelativeGuide(relativeGuide2).build())
+                .addHighLightWithOptions(FgtGameCenter.getTab(0), HighLight.Shape.OVAL, new HighlightOptions.Builder().setRelativeGuide(relativeGuide1).build())
+                .setLayoutRes(R.layout.newbie_guide_8_3)
+                .setEnterAnimation(enterAnimation)//进入动画
+                .setExitAnimation(exitAnimation);//退出动画
+    }
+
+    private GuidePage getPage9() {
+        RelativeGuide relativeGuide = new RelativeGuide(R.layout.newbie_guide_9, Gravity.BOTTOM, 0) {
+            @Override
+            protected void offsetMargin(MarginInfo marginInfo, ViewGroup viewGroup, View view) {
+                marginInfo.topMargin -= ScreenUtil.dip2px(mActivity, 40);
+                marginInfo.leftMargin -= ScreenUtil.dip2px(mActivity, 50);
+            }
+        };
+        return GuidePage.newInstance()//创建一个实例
+                .addHighLightWithOptions(ActMain.tabBtn2.get(), HighLight.Shape.CIRCLE, new HighlightOptions.Builder().useMaxSize(false).build())
+                .addHighLightWithOptions(FgtGameCenter.getTab(1), HighLight.Shape.OVAL, new HighlightOptions.Builder().setRelativeGuide(relativeGuide).build())
+                .setEnterAnimation(enterAnimation)//进入动画
+                .setExitAnimation(exitAnimation);//退出动画
+    }
+
+    private GuidePage getPage10() {
+        RelativeGuide relativeGuide = new RelativeGuide(R.layout.newbie_guide_10, Gravity.LEFT, 0) {
+            @Override
+            protected void offsetMargin(MarginInfo marginInfo, ViewGroup viewGroup, View view) {
+                marginInfo.topMargin -= ScreenUtil.dip2px(mActivity, 50);
+                marginInfo.rightMargin -= ScreenUtil.dip2px(mActivity, 80);
+            }
+        };
+        return GuidePage.newInstance()//创建一个实例
+                .addHighLightWithOptions(ActMain.tabBtn2.get(), HighLight.Shape.CIRCLE, new HighlightOptions.Builder().useMaxSize(false).build())
+                .addHighLightWithOptions(FgtGameCenter.getTab(3), HighLight.Shape.OVAL, new HighlightOptions.Builder().setRelativeGuide(relativeGuide).build())
+                .setEnterAnimation(enterAnimation)//进入动画
+                .setExitAnimation(exitAnimation);//退出动画
+    }
+
+    private boolean isShowed(String page) {
+        SharedPreferences sp = mActivity.getSharedPreferences("newbie_guide", Context.MODE_PRIVATE);
+        return sp.getBoolean(page, false);
+    }
+
+    private void showed(String page) {
+        SharedPreferences sp = mActivity.getSharedPreferences("newbie_guide", Context.MODE_PRIVATE);
+        SharedPreferences.Editor editor = sp.edit();
+        editor.putBoolean("page", true);
+        editor.commit();
+    }
+
+}

+ 8 - 0
app/src/main/java/com/sheep/gamegroup/module/home/fragment/FgtHome.java

@@ -35,6 +35,7 @@ import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
 
+import java.lang.ref.WeakReference;
 import java.util.Locale;
 
 import butterknife.BindView;
@@ -46,6 +47,9 @@ import rx.functions.Action1;
 
 public class FgtHome extends BaseFragment {
 
+    public static WeakReference<View> newsRef;
+    public static WeakReference<View> meetRef;
+
     @BindView(R.id.tip_news)
     View tip_news;
     @BindView(R.id.tv_recommend)
@@ -58,6 +62,8 @@ public class FgtHome extends BaseFragment {
     View line_news;
     @BindView(R.id.meet_btn)
     View meet_btn;
+    @BindView(R.id.news_btn)
+    View news_btn;
 
     private UserEntity user;
 
@@ -90,6 +96,8 @@ public class FgtHome extends BaseFragment {
 
     @Override
     public void onViewCreated() {
+        newsRef = new WeakReference<>(news_btn);
+        meetRef = new WeakReference<>(meet_btn);
     }
 
     @Override

+ 24 - 0
app/src/main/java/com/sheep/gamegroup/module/home/fragment/FgtMainHeader.java

@@ -17,6 +17,7 @@ import com.sheep.gamegroup.model.entity.MessageUnReadEntity;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.Constant;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.GlideImageLoader;
 import com.sheep.gamegroup.util.Jump2View;
@@ -32,20 +33,27 @@ import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.base.BaseFragment;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 import com.sheep.gamegroup.util.DownloadUtil;
+import com.uuzuche.lib_zxing.activity.CaptureActivity;
 
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
 
+import java.lang.ref.WeakReference;
 import java.util.List;
 import java.util.Locale;
 
 import butterknife.BindView;
 import butterknife.OnClick;
+import cn.finalteam.rxgalleryfinal.utils.CameraUtil;
 import io.reactivex.android.schedulers.AndroidSchedulers;
 import io.reactivex.schedulers.Schedulers;
 
 public class FgtMainHeader extends BaseFragment {
 
+    public static WeakReference<View> faceRef;
+    public static WeakReference<View> downloadRef;
+    public static WeakReference<View> msgRef;
+
     @BindView(R.id.iv_user_face)
     ImageView iv_user_face;
     @BindView(R.id.tv_nickname)
@@ -62,6 +70,10 @@ public class FgtMainHeader extends BaseFragment {
     View v_red_dot;
     @BindView(R.id.show_hide_pwd_btn)
     ImageView show_hide_pwd_btn;
+    @BindView(R.id.iv_msg)
+    View iv_msg;
+    @BindView(R.id.iv_download)
+    View iv_download;
 
     private UserEntity user;
 
@@ -99,6 +111,9 @@ public class FgtMainHeader extends BaseFragment {
     public void onViewCreated() {
         getUnReadMessageCounts();
         ViewUtil.setVisibility(v_red_dot, SpUtils.isVoucherFirst());
+        faceRef = new WeakReference<>(iv_user_face);
+        downloadRef = new WeakReference<>(iv_download);
+        msgRef = new WeakReference<>(iv_msg);
     }
 
     @Override
@@ -160,6 +175,13 @@ public class FgtMainHeader extends BaseFragment {
         Jump2View.getInstance().goActSearch(getActivity());
     }
 
+    @OnClick(R.id.iv_scan)
+    public void onScanQR(){
+        if (!CameraUtil.checkCameraPermission(getActivity())) return;
+        Intent intent = new Intent(getActivity(), CaptureActivity.class);
+        getActivity().startActivityForResult(intent, Constant.INTENT_CAPTURE_QRCODE);
+    }
+
     /**
      * 获取是否有未读消息并更新图标
      */
@@ -232,4 +254,6 @@ public class FgtMainHeader extends BaseFragment {
         ViewUtil.setVisibility(v_red_dot, DataUtil.getAsBoolean(KEY_HAS_APPOINT_TASK, false));
     }
 
+
+
 }

+ 13 - 4
app/src/main/java/com/sheep/gamegroup/module/login/LoginAct.java

@@ -30,6 +30,7 @@ import com.sheep.gamegroup.module.login.fragments.WelcomeFgt;
 import com.sheep.gamegroup.util.ApiJSONUtil;
 import com.sheep.gamegroup.util.CertificationUtil;
 import com.sheep.gamegroup.util.ChannelContent;
+import com.sheep.gamegroup.util.Constant;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.FastJsonUtils;
 import com.sheep.gamegroup.util.Jump2View;
@@ -228,7 +229,7 @@ public class LoginAct extends BaseUMActivity implements LoginController {
 //            showProgress();
             Jump2View.getInstance().checkOrGoHomePage(this);
         } else {
-            CertificationUtil.newInstance().authCertificationCode(this, entity.getToken());
+            CertificationUtil.newInstance().authCertificationCode(this, entity.getToken(), null);
         }
     }
 
@@ -285,9 +286,17 @@ public class LoginAct extends BaseUMActivity implements LoginController {
     }
 
     @Override
-    public void onActivityResult(int requestCode, int resultCode, Intent intent) {
-        super.onActivityResult(requestCode, resultCode, intent);
-        getLastFragment().onActivityResult(requestCode, resultCode, intent);
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (requestCode == Constant.INTENT_DETECT_FACE) {
+            if (resultCode == RESULT_OK && data != null) {
+                String token = data.getStringExtra("token");
+                String face = data.getStringExtra("face");
+                CertificationUtil.newInstance().authCertificationCode(this, token, face);
+            }
+        } else {
+            getLastFragment().onActivityResult(requestCode, resultCode, data);
+        }
     }
 
     private void setFirstStartup() {

+ 142 - 0
app/src/main/java/com/sheep/gamegroup/module/qrcode/FaceWithQRActivity.java

@@ -0,0 +1,142 @@
+package com.sheep.gamegroup.module.qrcode;
+
+import android.Manifest;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.support.v4.app.ActivityCompat;
+import android.support.v4.content.ContextCompat;
+import android.text.TextUtils;
+import android.widget.Toast;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baidu.idl.face.platform.FaceSDKManager;
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.util.Constant;
+import com.sheep.gamegroup.util.upfile.UpFileListener;
+import com.sheep.gamegroup.util.upfile.UpFileUtils;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import cn.finalteam.rxgalleryfinal.utils.CameraUtil;
+
+//当设备不支持相机时 跳转到二维码界面
+//无论是二维码的结果还是人脸识别的结果返回  都返回的face的imageUrl
+//参数区分1.活体检测 2.人脸识别
+public class FaceWithQRActivity extends BaseActivity {
+
+    private int type;
+
+    private String token;
+
+    //透传参数
+    private String extra;
+
+    private boolean useQR = false;
+
+    @Override
+    protected int getLayoutId() {
+        return 0;
+    }
+
+    @Override
+    public void initView() {
+
+    }
+
+    @Override
+    public void onCreate(Bundle bundle) {
+        super.onCreate(bundle);
+        type = getIntent().getIntExtra("type", 0);
+        token = getIntent().getStringExtra("token");
+        extra = getIntent().getStringExtra("extra");
+        useQR = getIntent().getBooleanExtra("useQR", false);
+        if (CameraUtil.checkCameraPermission(this)) {
+            dispatch();
+        }
+    }
+
+    @Override
+    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
+        if (CameraUtil.checkCameraPermission(this)) {
+            dispatch();
+        }
+    }
+
+    private void dispatch() {
+        if (CameraUtil.hasCamera()) {
+//        if (!useQR) {
+            if (type == Constant.INTENT_DETECT_LIVENESS) {
+                FaceSDKManager.getInstance().goLivenessCheck(this, FaceSDKManager.NEED_FILEPATH);
+            } else {
+                FaceSDKManager.getInstance().goFaceDetect(this, FaceSDKManager.NEED_FILEPATH);
+            }
+        } else {
+            Intent intent = new Intent(this, QRCodeActivity.class);
+            if(type == Constant.INTENT_DETECT_LIVENESS){
+                intent.putExtra("req", "sheep://liveness");
+            }else{
+                intent.putExtra("req", "sheep://facedetect");
+            }
+            intent.putExtra("token", token);
+            intent.putExtra("extra", "");
+            startActivityForResult(intent, Constant.INTENT_QRCODE_DATA);
+        }
+    }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (resultCode == RESULT_OK && data != null) {
+            if (requestCode == Constant.INTENT_QRCODE_DATA) {
+                returnResult(data.getStringExtra("result"));
+            } else if (requestCode == Constant.INTENT_DETECT_LIVENESS) {
+                uploadFace(data.getStringExtra("bestPath"));
+            } else if (requestCode == Constant.INTENT_DETECT_FACE) {
+                uploadFace(data.getStringExtra("bestPath"));
+            } else {
+                finish();
+            }
+        } else {
+            finish();
+        }
+    }
+
+    private void uploadFace(String facePath) {
+        UpFileUtils.upImage(new File(facePath), new UpFileListener() {
+            @Override
+            public void Success(String msg, int index) {
+                JSONObject json = JSONObject.parseObject(msg);
+                JSONObject data = json.getJSONObject("data");
+                returnResult(data.getString("url"));
+            }
+
+            @Override
+            public void Progress(String progress, int index) {
+
+            }
+
+            @Override
+            public void Failure(String err) {
+                Toast.makeText(FaceWithQRActivity.this, "网络故障", Toast.LENGTH_SHORT).show();
+                finish();
+            }
+        });
+    }
+
+    private void returnResult(String faceUrl) {
+        Intent in = new Intent();
+        in.putExtra("face", faceUrl);
+        in.putExtra("token", token);
+        if (!TextUtils.isEmpty(extra)) {
+            in.putExtra("extra", extra);
+        }
+        setResult(RESULT_OK, in);
+        finish();
+    }
+
+
+}

+ 144 - 0
app/src/main/java/com/sheep/gamegroup/module/qrcode/QRCodeActivity.java

@@ -0,0 +1,144 @@
+package com.sheep.gamegroup.module.qrcode;
+
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.os.Looper;
+import android.util.Base64;
+import android.widget.ImageView;
+
+import com.alibaba.fastjson.JSONObject;
+import com.bumptech.glide.Glide;
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.QRCode;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.GlideImageLoader;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.G;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import butterknife.BindView;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.schedulers.Schedulers;
+
+//显示二维码  并每3秒轮询一次扫码结果
+public class QRCodeActivity extends BaseActivity implements Runnable {
+
+    @BindView(R.id.qr_iv)
+    public ImageView qrCodeImageView;
+
+    //谁
+    private String token;
+    //要做什么事
+    private String req;
+    //透传数据
+    private String extra;
+
+    private QRCode qrCode;
+
+    private boolean isLooping = true;
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.act_qrcode;
+    }
+
+    @Override
+    public void initData() {
+        token = getIntent().getStringExtra("token");
+        req = getIntent().getStringExtra("req");
+        extra = getIntent().getStringExtra("extra");
+        createQRCodeAction(true);
+    }
+
+    @Override
+    public void initView() {
+        TitleBarUtils.getInstance()
+                .setShowOrHide(this, true)
+                .setTitle(this, "扫描下面二维码")
+                .setTitleBack(this);
+    }
+
+    public void createQRCodeAction(boolean withLoop) {
+        JSONObject json = new JSONObject();
+        json.put("content", req);
+        json.put("bind_user", 1);
+        SheepApp.getInstance().getNetComponent().getApiService().createQRCodeAction(token, json)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        qrCode = baseMessage.getData(QRCode.class);
+                        Glide.with(QRCodeActivity.this).load(qrCode.getQr_url()).into(qrCodeImageView);
+                        //二维码图片加载成功才开始轮询扫码结果
+                        if (withLoop) {
+                            new Thread(QRCodeActivity.this).start();
+                        }
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        G.showToast("二维码生成失败");
+                        finish();
+                    }
+                });
+    }
+
+    public void fetchResult() {
+        SheepApp.getInstance().getNetComponent().getApiService().getQRCodeInfo(token, qrCode.getCode())
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        qrCode = baseMessage.getData(QRCode.class);
+                        if (qrCode.getStatus() == 1) {
+                            isLooping = false;
+                            returnResult(qrCode.getAction_content());
+                        } else {
+                            if (qrCode.isExpired()) {
+                                G.showToast("二维码已过期, 自动刷新二维码");
+                                createQRCodeAction(false);
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+
+                    }
+                });
+    }
+
+    public void returnResult(String result) {
+        Intent in = new Intent();
+        in.putExtra("extra", extra);
+        in.putExtra("result", result);
+        setResult(RESULT_OK, in);
+        finish();
+    }
+
+    @Override
+    public void onDestroy() {
+        isLooping = false;
+        super.onDestroy();
+    }
+
+    @Override
+    public void run() {
+        while (isLooping) {
+            try {
+                Thread.sleep(3000);
+                if (!isLooping) break;
+                runOnUiThread(() -> fetchResult());
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+}

+ 66 - 0
app/src/main/java/com/sheep/gamegroup/module/qrcode/QRCodeCaptureHelper.java

@@ -0,0 +1,66 @@
+package com.sheep.gamegroup.module.qrcode;
+
+import android.app.Activity;
+import android.net.Uri;
+import android.text.TextUtils;
+
+import com.baidu.idl.face.platform.FaceSDKManager;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.QRCode;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.util.Constant;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.LogUtil;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.G;
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
+
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.schedulers.Schedulers;
+
+public class QRCodeCaptureHelper {
+
+    public static void handle(Activity activity, String text) {
+        if (TextUtils.isEmpty(text)) return;
+        if(text.startsWith("http://") || text.startsWith("https://")){
+            Jump2View.getInstance().goWeb(activity, text, "-");
+        }
+        SheepApp.getInstance().getNetComponent().getApiService().getQRCodeInfo(SpUtils.getToken(activity), text)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        QRCode qrCode = baseMessage.getData(QRCode.class);
+                        handleQRCode(activity, qrCode);
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        G.showToast("扫码失败");
+                    }
+                });
+    }
+
+    private static void handleQRCode(Activity activity, QRCode qrCode) {
+        Uri uri = Uri.parse(qrCode.getContent());
+        if ("http".equals(uri.getScheme()) || "https".equals(uri.getScheme())) {
+            Jump2View.getInstance().goWeb(activity, uri.toString(), "-");
+        } else if ("sheep".equals(uri.getScheme())) {
+            handleAction(activity, uri, qrCode.getCode());
+        } else {
+            LogUtil.logE("无法解析文本:" + uri.toString());
+            G.showToast("无法解析文本");
+        }
+    }
+
+    private static void handleAction(Activity activity, Uri uri, String extra) {
+        if(uri.toString().startsWith("sheep://liveness")){
+            FaceSDKManager.getInstance().goLivenessCheck(activity, FaceSDKManager.NEED_FILEPATH, Constant.INTENT_DETECT_FACE, extra);
+        } else if(uri.toString().startsWith("sheep://facedetect")){
+            FaceSDKManager.getInstance().goFaceDetect(activity, FaceSDKManager.NEED_FILEPATH, Constant.INTENT_DETECT_FACE, extra);
+        }
+    }
+
+}

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

@@ -50,6 +50,7 @@ public class CertificationUtil {
                 if (TextUtils.isEmpty(errorMsg)) {
                     SheepApp.getInstance().setGamePackgeName("");
                     SheepApp.getInstance().setGameCode("");
+                    SheepApp.getInstance().setGameId("");
                     SheepApp.getInstance().setGameFlag(false);
                     activity.finish();
                 } else {
@@ -70,7 +71,7 @@ public class CertificationUtil {
             intent.setClassName(packageName, "com.kfzs.duanduan.data.observer.helper.WhistleActivity");
             intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
             intent.putExtra(activity.getString(R.string.kfzs_duanduan_datashare_certification_key), SheepApp.getInstance().getGameCode());
-
+            intent.putExtra(activity.getString(R.string.kfzs_duanduan_datashare_device_id), DeviceUtil.getDeviceId(SheepApp.getInstance()));
             if (TextUtils.isEmpty(ext)) {
                 intent.putExtra(activity.getString(R.string.kfzs_duanduan_datashare_package_extras), "");
                 intent.putExtra(activity.getString(R.string.kfzs_duanduan_datashare_certification_token), token);
@@ -94,9 +95,12 @@ public class CertificationUtil {
     /**
      * 验证获取数据
      */
-    public void authCertificationCode(final Activity activity, final String token) {
+    public void authCertificationCode(final Activity activity, final String token, String face) {
         ViewUtil.newInstance().showProgress(activity);
-        SheepApp.getInstance().getNetComponent().getApiService().verificationAuth(token, SheepApp.getInstance().getGameCode())
+        SheepApp.getInstance().getNetComponent().getApiService().verificationAuth(token
+                , SheepApp.getInstance().getGameCode()
+                , SheepApp.getInstance().getGameId()
+                , face)
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
@@ -114,7 +118,17 @@ public class CertificationUtil {
                     @Override
                     public void onError(BaseMessage baseMessage) {
                         ViewUtil.newInstance().hideProgress(activity);
-                        showCertificationErrorAndExitApp(activity, "请求授权错误 " + baseMessage.getMsg(), 1000);
+                        if (baseMessage.getCode() == 404000022) {
+                            Jump2View.getInstance().goFaceWithQR(activity, Constant.INTENT_DETECT_LIVENESS, token);
+                        } else if (baseMessage.getCode() == 404000023) {
+                            Jump2View.getInstance().goFaceWithQR(activity, Constant.INTENT_DETECT_FACE, token);
+                        } else if(baseMessage.getCode() == 404000024){
+                            G.showToast("需要绑定手机号");
+                        } else if(baseMessage.getCode() == 404000025){
+                            G.showToast("需要实名认证");
+                        } else {
+                            showCertificationErrorAndExitApp(activity, "请求授权错误 " + baseMessage.getMsg(), 1000);
+                        }
                     }
                 });
     }

+ 3 - 0
app/src/main/java/com/sheep/gamegroup/util/Constant.java

@@ -1,7 +1,10 @@
 package com.sheep.gamegroup.util;
 
 public class Constant {
+    public final static int INTENT_DETECT_LIVENESS = 1001;
+    public final static int INTENT_DETECT_FACE = 1002;
     public final static int INTENT_PAY = 1003;
     public final static int INTENT_RECHARGE = 1004;
     public final static int INTENT_CAPTURE_QRCODE = 1005;
+    public final static int INTENT_QRCODE_DATA = 1006;
 }

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

@@ -62,6 +62,7 @@ import com.sheep.gamegroup.module.game.activity.ActGameGroupOrGameDetail;
 import com.sheep.gamegroup.module.game.activity.ActGameRank;
 import com.sheep.gamegroup.module.game.activity.ActGitBagList;
 import com.sheep.gamegroup.module.game.activity.ActMyGameList;
+import com.sheep.gamegroup.module.qrcode.FaceWithQRActivity;
 import com.sheep.gamegroup.module.search.ActSearch;
 import com.sheep.gamegroup.module.game.activity.ActWelfareSpecialArea;
 import com.sheep.gamegroup.module.game.model.GameCenterType;
@@ -850,6 +851,20 @@ public class Jump2View {
     }
 
     /**
+     * 绑定手机页面并注册第三方账号
+     *
+     * @param activity
+     * @param type
+     * @param token
+     */
+    public void goFaceWithQR(Activity activity, int type, String token) {
+        Intent in = new Intent(activity, FaceWithQRActivity.class);
+        in.putExtra("type", type);
+        in.putExtra("token", token);
+        activity.startActivityForResult(in, Constant.INTENT_DETECT_FACE);
+    }
+
+    /**
      * 跳转到非wifi网络提示
      *
      * @param context

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

@@ -73,6 +73,8 @@ import com.sheep.gamegroup.absBase.IContentTypeContainer;
 import com.sheep.gamegroup.absBase.ITag;
 import com.sheep.gamegroup.dateview.DatePickerDialog;
 import com.sheep.gamegroup.dateview.DateUtil;
+import com.sheep.gamegroup.event.BigEvent;
+import com.sheep.gamegroup.event.EventTypes;
 import com.sheep.gamegroup.model.entity.Advertising;
 import com.sheep.gamegroup.model.entity.Applications;
 import com.sheep.gamegroup.model.entity.BaseMessage;
@@ -86,6 +88,7 @@ import com.sheep.gamegroup.model.entity.PayEntity;
 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.guide.NewbieGuideHelper;
 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;
@@ -1815,6 +1818,7 @@ public class ViewUtil {
                     ACache aCache = ACache.get(SheepApp.getInstance());
                     aCache.put(advertising.getDisplay_src(), String.format(Locale.CHINA, "%d;%d", dialog_center_ll.getWidth(), dialog_center_ll.getHeight()));
                     Jump2View.getInstance().tryShowYfShopAskDialog(activity);
+                    EventBus.getDefault().post(BigEvent.get().setEventTypes(EventTypes.GUIDE_NEXT));
                 }
             });
             if (TextUtils.isEmpty(advertising.getDesc())) {

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/ActBindMobileRegister.java

@@ -192,7 +192,7 @@ public class ActBindMobileRegister extends BaseActivity {
                             Jump2View.getInstance().checkCommendApp(activity, EntityUtils.getUserCode(loginEty));
                         }else {
                             CertificationUtil.newInstance().addCurUserToSdkLoginUser(SpUtils.getToken(ActBindMobileRegister.this));
-                            CertificationUtil.newInstance().authCertificationCode(activity, SpUtils.getToken(SheepApp.getInstance()));
+                            CertificationUtil.newInstance().authCertificationCode(activity, SpUtils.getToken(SheepApp.getInstance()), null);
                         }
                         TestUtil.saveUser(loginEty);
                     }

+ 58 - 7
app/src/main/java/com/sheep/gamegroup/view/activity/ActMain.java

@@ -3,6 +3,7 @@ package com.sheep.gamegroup.view.activity;
 import android.content.Intent;
 import android.graphics.Color;
 import android.graphics.drawable.Drawable;
+import android.net.Uri;
 import android.os.Build;
 import android.os.Bundle;
 import android.support.annotation.Nullable;
@@ -16,7 +17,10 @@ import android.widget.FrameLayout;
 import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
+import android.widget.Toast;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.kfzs.duanduan.cardview.ScreenUtil;
 import com.kfzs.duanduan.utils.StatusBarUtils;
 import com.kfzs.duanduan.view.DialogStorageLow;
@@ -24,41 +28,44 @@ import com.sheep.gamegroup.absBase.AbsObserver;
 import com.sheep.gamegroup.event.BigEvent;
 import com.sheep.gamegroup.greendao.download.DownLoadInfo;
 import com.sheep.gamegroup.helper.DownloadHelper;
+import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.Container;
 import com.sheep.gamegroup.model.entity.Lp;
 import com.sheep.gamegroup.model.entity.UserEntity;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.model.util.ShowRedDot;
 import com.sheep.gamegroup.module.home.fragment.FgtMainHeader;
 import com.sheep.gamegroup.module.home.fragment.FgtWrapper;
+import com.sheep.gamegroup.module.qrcode.QRCodeCaptureHelper;
 import com.sheep.gamegroup.util.ActionUtil;
 import com.sheep.gamegroup.util.ChannelContent;
 import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.Constant;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.DownloadUtil;
-import com.sheep.gamegroup.util.DrawablesHelper;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ListUtil;
-import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.MainTab;
 import com.sheep.gamegroup.util.SysAppUtil;
 import com.sheep.gamegroup.util.TestUtil;
 import com.sheep.gamegroup.util.UMConfigUtils;
 import com.sheep.gamegroup.util.ViewUtil;
-import com.sheep.gamegroup.util.statusbar.StatusBarCompat;
-import com.sheep.gamegroup.util.statusbar.StatusBarUtil;
-import com.sheep.gamegroup.util.viewHelper.LayoutParamsUtil;
+import com.sheep.gamegroup.util.upfile.UpFileListener;
+import com.sheep.gamegroup.util.upfile.UpFileUtils;
 import com.sheep.gamegroup.view.dialog.DialogGameOrTaskOrGift;
-import com.sheep.gamegroup.view.fragment.FgtPersonalCenter;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.PackageUtil;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
 import com.youmi.android.offer.BaseActYmPermissionCheck;
 
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
 
+import java.io.File;
+import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Locale;
@@ -80,6 +87,9 @@ import static com.sheep.gamegroup.view.adapter.TryMakeMoneyAdp.PUBLIC_TAG_PREFIX
  * realicing@sina.com
  */
 public class ActMain extends BaseActYmPermissionCheck {
+
+    public static WeakReference<View> tabBtn1, tabBtn2;
+
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         StatusBarUtils.setTranslucent(this);
@@ -167,6 +177,9 @@ public class ActMain extends BaseActYmPermissionCheck {
 //        }
         if (!TestUtil.isDev())
             CommonUtil.getInstance().initMiDong(this, DataUtil.getInstance().getUserId());
+
+        tabBtn1 = new WeakReference<>(findViewById(R.id.tab_1));
+        tabBtn2 = new WeakReference<>(findViewById(R.id.tab_3));
     }
 
     @Override
@@ -249,7 +262,7 @@ public class ActMain extends BaseActYmPermissionCheck {
         tabs.get(lastPosition).setActivated(true);
     }
 
-    private void switchFragment(int position) {
+    public void switchFragment(int position) {
         ViewUtil.setVisibility(main_header, position != 1);
         View lastTab = ListUtil.getItem(tabs, lastPosition);
         View curTab = ListUtil.getItem(tabs, position);
@@ -534,4 +547,42 @@ public class ActMain extends BaseActYmPermissionCheck {
         }
     }
 
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (resultCode == RESULT_OK) {
+            if(requestCode == Constant.INTENT_CAPTURE_QRCODE){
+                QRCodeCaptureHelper.handle(this, data.getStringExtra(CodeUtils.RESULT_STRING));
+            } else if(requestCode == Constant.INTENT_DETECT_FACE) {
+                UpFileUtils.upImage(new File(data.getStringExtra("bestPath")), new UpFileListener() {
+                    @Override
+                    public void Success(String msg, int index) {
+                        JSONObject json = JSONObject.parseObject(msg);
+                        JSONObject d = json.getJSONObject("data");
+
+                    }
+
+                    @Override
+                    public void Progress(String progress, int index) {
+
+                    }
+
+                    @Override
+                    public void Failure(String err) {
+                        Toast.makeText(ActMain.this, "网络故障", Toast.LENGTH_SHORT).show();
+                        finish();
+                    }
+                });
+            }
+        }
+    }
+
+    public Fragment getMainFragment1(){
+        return getSupportFragmentManager().findFragmentByTag("fragment_0");
+    }
+
+    public Fragment getMainFragment3(){
+        return getSupportFragmentManager().findFragmentByTag("fragment_2");
+    }
+
 }

+ 14 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/GameCertificationActivity.java

@@ -1,5 +1,6 @@
 package com.sheep.gamegroup.view.activity;
 
+import android.content.Intent;
 import android.graphics.Color;
 import android.os.Handler;
 import android.support.annotation.NonNull;
@@ -21,6 +22,7 @@ import com.sheep.gamegroup.greendao.DDProviderHelper;
 import com.sheep.gamegroup.greendao.download.SdkLoginUser;
 import com.sheep.gamegroup.util.CertificationUtil;
 import com.sheep.gamegroup.util.CommonUtil;
+import com.sheep.gamegroup.util.Constant;
 import com.sheep.gamegroup.util.GlideImageLoader;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ListUtil;
@@ -110,6 +112,7 @@ public class GameCertificationActivity extends BaseActivity {
                 }
             }
             SheepApp.getInstance().setGameCode(getIntent().getStringExtra(getString(R.string.kfzs_duanduan_datashare_game_code)));
+            SheepApp.getInstance().setGameId(getIntent().getStringExtra(getString(R.string.kfzs_duanduan_datashare_game_id)));
             packageName = getIntent().getStringExtra(getString(R.string.kfzs_duanduan_datashare_package_name));
             SheepApp.getInstance().setGamePackgeName(packageName);
             if (TextUtils.isEmpty(SheepApp.getInstance().getGameCode()) || TextUtils.isEmpty(packageName)) {
@@ -152,7 +155,7 @@ public class GameCertificationActivity extends BaseActivity {
     }
 
     @Override
-    public void onDestroy(){
+    public void onDestroy() {
         ViewUtil.newInstance().hideProgress(this);
         super.onDestroy();
     }
@@ -178,6 +181,15 @@ public class GameCertificationActivity extends BaseActivity {
         }
     }
 
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        if (requestCode == Constant.INTENT_DETECT_FACE && resultCode == RESULT_OK && data != null) {
+            String token = data.getStringExtra("token");
+            String face = data.getStringExtra("face");
+            CertificationUtil.newInstance().authCertificationCode(GameCertificationActivity.this, token, face);
+        }
+    }
+
     private class SdkUserAdapter extends RecyclerView.Adapter<SdkUserHolder> {
 
         @NonNull
@@ -253,7 +265,7 @@ public class GameCertificationActivity extends BaseActivity {
             itemView.setOnClickListener(v -> {
                 user.setLastLoginTime((System.currentTimeMillis() / 1000) + "");
                 DDProviderHelper.getInstance().addOrUpdateSdkLoginUser(user, null);
-                CertificationUtil.newInstance().authCertificationCode(GameCertificationActivity.this, user.getToken());
+                CertificationUtil.newInstance().authCertificationCode(GameCertificationActivity.this, user.getToken(), null);
             });
         }
 

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

@@ -5,6 +5,8 @@ import android.app.Activity;
 import android.content.Intent;
 import android.graphics.Color;
 import android.graphics.drawable.BitmapDrawable;
+import android.os.Handler;
+import android.os.Message;
 import android.support.v7.widget.GridLayoutManager;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
@@ -15,6 +17,7 @@ import android.view.View;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.PopupWindow;
+import android.widget.ScrollView;
 import android.widget.TextView;
 
 import com.kfzs.duanduan.cardview.ScreenUtil;
@@ -26,6 +29,7 @@ import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.entity.UserTaskExistsNew;
 import com.sheep.gamegroup.model.entity.WebParams;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.module.guide.NewbieGuideHelper;
 import com.sheep.gamegroup.module.home.adapter.AdpHomeList;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataUtil;
@@ -52,6 +56,7 @@ import org.afinal.simplecache.ACache;
 import org.afinal.simplecache.ApiKey;
 import org.greenrobot.eventbus.EventBus;
 
+import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Locale;
@@ -77,6 +82,17 @@ import static com.sheep.gamegroup.util.ViewUtil.backgroundAlpha;
 
 public class FgtPersonalCenter extends BaseFragment {
 
+    public static WeakReference<View> myMoneyRef, accountDetailRef, fagRef;
+    public static WeakReference<ScrollView> scrollRef;
+
+    @BindView(R.id.scroll_view)
+    ScrollView scroll_view;
+    @BindView(R.id.personalcenter_price_layout)
+    View personalcenter_price_layout;
+    @BindView(R.id.account_detail_layout)
+    View account_detail_layout;
+    @BindView(R.id.faq_layout)
+    View faq_layout;
     @BindView(R.id.icon_img_iv)
     ImageView iconImgIv;
     @BindView(R.id.name_tv)
@@ -153,6 +169,15 @@ public class FgtPersonalCenter extends BaseFragment {
     private String agentUrl;
     private Activity activity;
 
+    public static void scrollToBottom(Activity activity){
+        scrollRef.get().fullScroll(View.FOCUS_DOWN);
+        new Handler(){
+            public void handleMessage(Message msg){
+                new NewbieGuideHelper(activity).show(NewbieGuideHelper.GUIDE_FAQ);
+            }
+        }.sendEmptyMessageDelayed(0, 300);
+    }
+
     @Override
     public int getLayoutId() {
         return R.layout.fgt_personalcenter_layout;
@@ -165,6 +190,11 @@ public class FgtPersonalCenter extends BaseFragment {
             initViewOnVisibleToUser();
             initDataOnVisibleToUser();
         }
+        myMoneyRef = new WeakReference<>(personalcenter_price_layout);
+        accountDetailRef = new WeakReference<>(account_detail_layout);
+        fagRef = new WeakReference<>(faq_layout);
+        scrollRef = new WeakReference<>(scroll_view);
+        new NewbieGuideHelper(getActivity()).show(NewbieGuideHelper.GUIDE_USER);
     }
 
     @Override

+ 12 - 0
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtSmallSheep.java

@@ -73,6 +73,7 @@ import com.sheep.gamegroup.model.entity.WebParams;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.model.util.ShowRedDot;
 import com.sheep.gamegroup.module.game.util.HpRefreshWelfareHelper;
+import com.sheep.gamegroup.module.guide.NewbieGuideHelper;
 import com.sheep.gamegroup.module.home.adapter.AdpHomeList;
 import com.sheep.gamegroup.module.home.fragment.FgtDailyPlayList;
 import com.sheep.gamegroup.module.home.fragment.FgtPromoteGoodsList;
@@ -122,6 +123,7 @@ import org.afinal.simplecache.ApiKey;
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
 
+import java.lang.ref.WeakReference;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
@@ -139,6 +141,8 @@ import rx.functions.Action1;
 
 public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.View, TryMakeMoneyContract.View {
 
+    public static WeakReference<View> listRef;
+
     @BindView(R.id.upview1)
     MarqueeView upview1;
     @BindView(R.id.homepage_item_notice_mv)
@@ -212,6 +216,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
     private static final RecyleObj NULL = RecyleObj.make(RecyleType.NONE, null);//空数据
     public static final int WHAT_LOAD_RUN_TASK = 1;//加载正在进行的任务列表
     public static final int WHAT_TRY_SHOW_HB = 7;//尝试显示红包
+    public static final int WHAT_TRY_SHOW_NEWBIE_GUIDE = 8;//尝试显示新手引导
 
 
     public boolean needRefreshMsgCount = false;
@@ -240,6 +245,9 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
                 case WHAT_TRY_SHOW_HB:
                     isShowRedPackages(activity);
                     break;
+                case WHAT_TRY_SHOW_NEWBIE_GUIDE:
+                    new NewbieGuideHelper(getActivity()).show(NewbieGuideHelper.GUIDE_HOME);
+                    break;
             }
 
         }
@@ -576,6 +584,7 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
         CommonUtil.getInstance().initUrlConfigByNet();
         if (TestUtil.isLTVersion3_4_5())//3.4.5以前版本才调用下面的方法
             isShowRedPackage();
+        listRef = new WeakReference<>(home_list_rv);
     }
 
 
@@ -1271,6 +1280,9 @@ public class FgtSmallSheep extends BaseFragment implements SmallSheepContract.Vi
             case FGT_SHEEP_SHOW_NEW_USER_HONG_BAO:
                 mHandler.sendEmptyMessage(WHAT_TRY_SHOW_HB);
                 break;
+            case GUIDE_NEXT:
+                mHandler.sendEmptyMessage(WHAT_TRY_SHOW_NEWBIE_GUIDE);
+                break;
         }
     }
 

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

@@ -139,6 +139,9 @@ public class Config {
     public static final String WX_AUTH_APP_ID = "wx2be7f59bb7bb963f";
     public static final String QQ_APP_ID = "101461115";
 
+    //人脸识别
+    public final static String FACE_LICENSE_ID = "small-sheep-android-face-android";
+    public final static String FACE_LICENSE_FILE_NAME = "idl-license.face-android";
 
     //缓存数据的key
     public static final String KEY_ENABLE_CHECK_COPY_TEXT = "enable_check_copy_text";//是否开启粘贴板助手的key boolean

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

@@ -12,6 +12,7 @@ import android.support.multidex.MultiDexApplication;
 import android.text.TextUtils;
 import android.util.DisplayMetrics;
 
+import com.baidu.idl.face.platform.FaceSDKManager;
 import com.baidu.location.BDAbstractLocationListener;
 import com.baidu.location.BDLocation;
 import com.baidu.location.LocationClient;
@@ -90,6 +91,7 @@ public class SheepApp extends MultiDexApplication {
     private boolean isShowQB;
     private boolean isInitMidong = false;
     private String gameCode;//游戏code
+    private String gameId;//游戏id
     private String gamePackgeName;
     private boolean gameFlag;
 
@@ -109,6 +111,14 @@ public class SheepApp extends MultiDexApplication {
         this.gamePackgeName = gamePackgeName;
     }
 
+    public String getGameId() {
+        return gameId;
+    }
+
+    public void setGameId(String gameId) {
+        this.gameId = gameId;
+    }
+
     public String getGameCode() {
         return gameCode;
     }
@@ -310,6 +320,9 @@ public class SheepApp extends MultiDexApplication {
 
         //初始化换肤框架
         SkinUtil.init();
+
+        //初始化人脸识别
+        FaceSDKManager.getInstance().initialize(this, Config.FACE_LICENSE_ID, Config.FACE_LICENSE_FILE_NAME);
     }
 
     private IWXAPI wxApi;

+ 19 - 0
app/src/main/res/layout/act_qrcode.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/background_light_gray"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+
+    <ImageView
+        android:id="@+id/qr_iv"
+        android:adjustViewBounds="true"
+        android:scaleType="fitCenter"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="50dp"
+        android:layout_marginLeft="30dp"
+        android:layout_marginRight="30dp"
+        app:layout_constraintTop_toTopOf="parent"/>
+
+</android.support.constraint.ConstraintLayout>

+ 10 - 0
app/src/main/res/layout/fgt_main_header.xml

@@ -137,4 +137,14 @@
         android:src="@drawable/drawable_selector_ic_home_search"
         android:tint="@color/white" />
 
+    <ImageView
+        android:id="@+id/iv_scan"
+        android:layout_width="40dp"
+        android:layout_height="40dp"
+        android:layout_alignParentEnd="true"
+        android:layout_marginEnd="140dp"
+        android:padding="10dp"
+        android:src="@mipmap/scan"
+        android:tint="@color/white" />
+
 </RelativeLayout>

+ 1 - 0
app/src/main/res/layout/fgt_personalcenter_layout.xml

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/scroll_view"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:scrollbars="none">

+ 20 - 0
app/src/main/res/layout/newbie_guide_1.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content">
+    <ImageView
+        android:id="@+id/i1"
+        android:src="@mipmap/guide_1_1"
+        android:adjustViewBounds="true"
+        android:layout_width="260dp"
+        android:layout_height="wrap_content" />
+    <ImageView
+        android:src="@mipmap/guide_1_2"
+        android:adjustViewBounds="true"
+        android:layout_below="@+id/i1"
+        android:layout_marginTop="40dp"
+        android:layout_marginLeft="30dp"
+        android:layout_width="120dp"
+        android:layout_height="wrap_content" />
+
+</RelativeLayout>

+ 29 - 0
app/src/main/res/layout/newbie_guide_10.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content">
+    <ImageView
+        android:id="@+id/i1"
+        android:src="@mipmap/guide_10_2"
+        android:adjustViewBounds="true"
+        android:layout_width="74dp"
+        android:layout_marginLeft="128dp"
+        android:layout_height="wrap_content" />
+    <ImageView
+        android:id="@+id/i2"
+        android:src="@mipmap/guide_10_1"
+        android:adjustViewBounds="true"
+        android:layout_below="@+id/i1"
+        android:layout_marginTop="7dp"
+        android:layout_width="198dp"
+        android:layout_height="wrap_content" />
+    <ImageView
+        android:src="@mipmap/guide_10_3"
+        android:adjustViewBounds="true"
+        android:layout_below="@+id/i2"
+        android:layout_marginTop="20dp"
+        android:layout_marginLeft="20dp"
+        android:layout_width="125dp"
+        android:layout_height="wrap_content" />
+
+</RelativeLayout>

+ 12 - 0
app/src/main/res/layout/newbie_guide_2_1.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content">
+    <ImageView
+        android:id="@+id/i1"
+        android:src="@mipmap/guide_2_1"
+        android:adjustViewBounds="true"
+        android:layout_width="180dp"
+        android:layout_height="wrap_content" />
+
+</RelativeLayout>

+ 20 - 0
app/src/main/res/layout/newbie_guide_2_2.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content">
+    <ImageView
+        android:id="@+id/i1"
+        android:src="@mipmap/guide_2_2"
+        android:adjustViewBounds="true"
+        android:layout_width="180dp"
+        android:layout_height="wrap_content" />
+    <ImageView
+        android:src="@mipmap/guide_2_4"
+        android:adjustViewBounds="true"
+        android:layout_below="@+id/i1"
+        android:layout_marginTop="20dp"
+        android:layout_marginLeft="16dp"
+        android:layout_width="120dp"
+        android:layout_height="wrap_content" />
+
+</RelativeLayout>

+ 12 - 0
app/src/main/res/layout/newbie_guide_2_3.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content">
+    <ImageView
+        android:id="@+id/i1"
+        android:src="@mipmap/guide_2_3"
+        android:adjustViewBounds="true"
+        android:layout_width="52dp"
+        android:layout_height="wrap_content" />
+
+</RelativeLayout>

+ 20 - 0
app/src/main/res/layout/newbie_guide_3_1.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content">
+    <ImageView
+        android:id="@+id/i1"
+        android:src="@mipmap/guide_3_1"
+        android:adjustViewBounds="true"
+        android:layout_width="175dp"
+        android:layout_height="wrap_content" />
+    <ImageView
+        android:src="@mipmap/guide_3_3"
+        android:adjustViewBounds="true"
+        android:layout_below="@+id/i1"
+        android:layout_marginTop="20dp"
+        android:layout_centerHorizontal="true"
+        android:layout_width="127dp"
+        android:layout_height="wrap_content" />
+
+</RelativeLayout>

+ 14 - 0
app/src/main/res/layout/newbie_guide_3_2.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+    <ImageView
+        android:id="@+id/i1"
+        android:src="@mipmap/guide_3_2"
+        android:adjustViewBounds="true"
+        android:layout_alignParentRight="true"
+        android:layout_marginTop="140dp"
+        android:layout_width="60dp"
+        android:layout_height="wrap_content" />
+
+</RelativeLayout>

+ 20 - 0
app/src/main/res/layout/newbie_guide_4.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content">
+    <ImageView
+        android:id="@+id/i1"
+        android:src="@mipmap/guide_4_1"
+        android:adjustViewBounds="true"
+        android:layout_width="175dp"
+        android:layout_height="wrap_content" />
+    <ImageView
+        android:src="@mipmap/guide_4_2"
+        android:adjustViewBounds="true"
+        android:layout_below="@+id/i1"
+        android:layout_marginTop="20dp"
+        android:layout_centerHorizontal="true"
+        android:layout_width="125dp"
+        android:layout_height="wrap_content" />
+
+</RelativeLayout>

+ 20 - 0
app/src/main/res/layout/newbie_guide_5.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+    <ImageView
+        android:id="@+id/i1"
+        android:src="@mipmap/guide_5_1"
+        android:adjustViewBounds="true"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" />
+    <ImageView
+        android:src="@mipmap/guide_5_2"
+        android:adjustViewBounds="true"
+        android:layout_below="@+id/i1"
+        android:layout_marginTop="20dp"
+        android:layout_centerHorizontal="true"
+        android:layout_width="125dp"
+        android:layout_height="wrap_content" />
+
+</RelativeLayout>

+ 22 - 0
app/src/main/res/layout/newbie_guide_6.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+    <ImageView
+        android:id="@+id/i1"
+        android:src="@mipmap/guide_6_1"
+        android:adjustViewBounds="true"
+        android:layout_marginLeft="60dp"
+        android:layout_marginRight="60dp"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" />
+    <ImageView
+        android:src="@mipmap/guide_5_2"
+        android:adjustViewBounds="true"
+        android:layout_below="@+id/i1"
+        android:layout_marginTop="80dp"
+        android:layout_centerHorizontal="true"
+        android:layout_width="125dp"
+        android:layout_height="wrap_content" />
+
+</RelativeLayout>

+ 24 - 0
app/src/main/res/layout/newbie_guide_7.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+
+    <ImageView
+        android:id="@+id/i1"
+        android:src="@mipmap/guide_7_2"
+        android:adjustViewBounds="true"
+        android:layout_centerHorizontal="true"
+        android:layout_width="125dp"
+        android:layout_height="wrap_content" />
+
+    <ImageView
+        android:layout_below="@+id/i1"
+        android:src="@mipmap/guide_7_1"
+        android:adjustViewBounds="true"
+        android:layout_marginTop="30dp"
+        android:layout_marginBottom="16dp"
+        android:layout_marginLeft="60dp"
+        android:layout_width="205dp"
+        android:layout_height="wrap_content" />
+
+</RelativeLayout>

+ 13 - 0
app/src/main/res/layout/newbie_guide_8_1.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content">
+
+    <ImageView
+        android:id="@+id/i1"
+        android:src="@mipmap/guide_8_1"
+        android:adjustViewBounds="true"
+        android:layout_width="76dp"
+        android:layout_height="wrap_content" />
+
+</RelativeLayout>

+ 13 - 0
app/src/main/res/layout/newbie_guide_8_2.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content">
+
+    <ImageView
+        android:id="@+id/i1"
+        android:src="@mipmap/guide_8_2"
+        android:adjustViewBounds="true"
+        android:layout_width="90dp"
+        android:layout_height="wrap_content" />
+
+</RelativeLayout>

+ 15 - 0
app/src/main/res/layout/newbie_guide_8_3.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+
+    <ImageView
+        android:id="@+id/i1"
+        android:src="@mipmap/guide_8_3"
+        android:adjustViewBounds="true"
+        android:layout_centerHorizontal="true"
+        android:layout_marginTop="247dp"
+        android:layout_width="127dp"
+        android:layout_height="wrap_content" />
+
+</RelativeLayout>

+ 29 - 0
app/src/main/res/layout/newbie_guide_9.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:orientation="vertical">
+
+    <ImageView
+        android:src="@mipmap/guide_9_1"
+        android:adjustViewBounds="true"
+        android:layout_width="214dp"
+        android:layout_height="wrap_content" />
+
+    <ImageView
+        android:src="@mipmap/guide_9_2"
+        android:adjustViewBounds="true"
+        android:layout_marginTop="20dp"
+        android:layout_marginLeft="65dp"
+        android:layout_width="132dp"
+        android:layout_height="wrap_content" />
+
+    <ImageView
+        android:src="@mipmap/guide_9_3"
+        android:adjustViewBounds="true"
+        android:layout_marginTop="18dp"
+        android:layout_width="127dp"
+        android:layout_marginLeft="35dp"
+        android:layout_height="wrap_content" />
+
+</LinearLayout>

BIN
app/src/main/res/mipmap-xxhdpi/scan.png


BIN
app/src/main/res/mipmap/guide_10_1.png


BIN
app/src/main/res/mipmap/guide_10_2.png


BIN
app/src/main/res/mipmap/guide_10_3.png


BIN
app/src/main/res/mipmap/guide_1_1.png


BIN
app/src/main/res/mipmap/guide_1_2.png


BIN
app/src/main/res/mipmap/guide_2_1.png


BIN
app/src/main/res/mipmap/guide_2_2.png


BIN
app/src/main/res/mipmap/guide_2_3.png


BIN
app/src/main/res/mipmap/guide_2_4.png


BIN
app/src/main/res/mipmap/guide_3_1.png


BIN
app/src/main/res/mipmap/guide_3_2.png


BIN
app/src/main/res/mipmap/guide_3_3.png


BIN
app/src/main/res/mipmap/guide_4_1.png


BIN
app/src/main/res/mipmap/guide_4_2.png


BIN
app/src/main/res/mipmap/guide_5_1.png


BIN
app/src/main/res/mipmap/guide_5_2.png


BIN
app/src/main/res/mipmap/guide_6_1.png


BIN
app/src/main/res/mipmap/guide_6_2.png


BIN
app/src/main/res/mipmap/guide_7_1.png


BIN
app/src/main/res/mipmap/guide_7_2.png


BIN
app/src/main/res/mipmap/guide_8_1.png


BIN
app/src/main/res/mipmap/guide_8_2.png


BIN
app/src/main/res/mipmap/guide_8_3.png


BIN
app/src/main/res/mipmap/guide_9_1.png


BIN
app/src/main/res/mipmap/guide_9_2.png


BIN
app/src/main/res/mipmap/guide_9_3.png


+ 2 - 0
app/src/main/res/values/key_strings.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
+    <string name="kfzs_duanduan_datashare_game_id">kfzs:duanduan:game:id</string>
     <string name="kfzs_duanduan_datashare_game_code">kfzs:duanduan:game:code</string>
     <string name="kfzs_duanduan_datashare_package_name">kfzs:duanduan:game:package:name</string>
     <string name="kfzs_duanduan_datashare_package_extras">kfzs:duanduan:game:package:extras</string>
@@ -10,4 +11,5 @@
     <string name="kfzs_duanduan_datashare_certificationed">kfzs:duanduan:certificationed</string>
     <string name="kfzs_duanduan_datashare_certification_userid">kfzs:duanduan:certification:userid</string>
     <string name="kfzs_duanduan_datashare_certification_token">kfzs:duanduan:certification:token</string>
+    <string name="kfzs_duanduan_datashare_device_id">kfzs:duanduan:device:id</string>
 </resources>