Bläddra i källkod

添加海南元游平台SDK

kaiweicai 2 år sedan
förälder
incheckning
74096c7fb3
100 ändrade filer med 4383 tillägg och 353 borttagningar
  1. 3 1
      demo/build.gradle
  2. 2 0
      demo/src/main/AndroidManifest.xml
  3. 3 2
      demo/src/main/assets/yyxx_game/yyxx_cfg.properties
  4. 9 3
      demo/src/main/java/com/yyxx/commsdk/demo/DemoActivity.kt
  5. 2 0
      library_base/build.gradle
  6. 24 64
      library_base/src/main/java/cn/yyxx/commsdk/base/YYXXCommSdk.java
  7. 2 6
      library_base/src/main/java/cn/yyxx/commsdk/base/constants/Constants.java
  8. 2 5
      library_base/src/main/java/cn/yyxx/commsdk/base/entity/Function.java
  9. 17 3
      library_base/src/main/java/cn/yyxx/commsdk/base/entity/bean/InitBean.java
  10. 9 0
      library_base/src/main/java/cn/yyxx/commsdk/base/internal/PhoneLoginCallBack.java
  11. 3 8
      library_base/src/main/java/cn/yyxx/commsdk/base/internal/feature/IFeature.java
  12. 5 0
      library_base/src/main/java/cn/yyxx/commsdk/base/internal/feature/ILifeCycle.java
  13. 1 3
      library_base/src/main/java/cn/yyxx/commsdk/base/internal/feature/IRoleData.java
  14. 2 4
      library_channel/build.gradle
  15. 21 27
      library_channel/src/main/java/cn/yyxx/commsdk/impl/ChannelSdkImpl.java
  16. 78 12
      library_channel/src/main/java/cn/yyxx/commsdk/impl/channel/ChannelSdkYYXX.java
  17. 1 1
      library_core/src/main/cpp/comm_map.cpp
  18. 1 0
      library_core/src/main/cpp/comm_map.h
  19. 2 2
      library_core/src/main/cpp/params_kit.h
  20. 15 0
      library_core/src/main/cpp/tool_kit.cpp
  21. 3 0
      library_core/src/main/cpp/tool_kit.h
  22. 3 3
      library_core/src/main/cpp/yylog.cpp
  23. 1 1
      library_core/src/main/cpp/yylog.h
  24. 26 5
      library_core/src/main/cpp/yyxxgame.cpp
  25. 5 5
      library_core/src/main/java/cn/yyxx/commsdk/core/SdkBridge.java
  26. 3 1
      library_core/src/main/java/cn/yyxx/commsdk/core/SdkDrive.java
  27. 12 5
      library_core/src/main/java/cn/yyxx/commsdk/core/common/CommonOperationManager.java
  28. 1 1
      library_core/src/main/java/cn/yyxx/commsdk/core/entity/ComponentLoginConfig.java
  29. 81 0
      library_core/src/main/java/cn/yyxx/commsdk/core/entity/SdkLoginInfo.java
  30. 95 8
      library_core/src/main/java/cn/yyxx/commsdk/core/impl/SdkBridgeImpl.java
  31. 6 6
      library_core/src/main/java/cn/yyxx/commsdk/core/network/Hosts.java
  32. 142 0
      library_core/src/main/java/cn/yyxx/commsdk/core/network/SdkRequest.java
  33. 95 0
      library_core/src/main/java/cn/yyxx/commsdk/core/ui/dialog/LoadingDialogUtils.java
  34. 0 2
      library_core/src/main/java/cn/yyxx/commsdk/core/ui/dialog/PrivacyPolicyDialog.java
  35. 1 1
      library_core/src/main/java/cn/yyxx/commsdk/core/utils/MMKVUtils.java
  36. 4 0
      library_core/src/main/java/cn/yyxx/commsdk/core/utils/ParamsUtils.java
  37. 74 0
      library_core/src/main/java/cn/yyxx/commsdk/core/utils/SignUtils.java
  38. 0 84
      library_core/src/main/java/cn/yyxx/commsdk/core/utils/YYLog.java
  39. 15 0
      library_core/src/main/res/drawable/yyxx_comm_progress_drawable_white.xml
  40. 2 2
      library_core/src/main/res/layout/yyxx_comm_loading_dialog.xml
  41. 0 0
      library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_bg.9.png
  42. 0 0
      library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_01.png
  43. 0 0
      library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_02.png
  44. 0 0
      library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_03.png
  45. 0 0
      library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_04.png
  46. 0 0
      library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_05.png
  47. 0 0
      library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_06.png
  48. 0 0
      library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_07.png
  49. 0 0
      library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_08.png
  50. 0 0
      library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_09.png
  51. 0 0
      library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_10.png
  52. 0 0
      library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_11.png
  53. 0 0
      library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_12.png
  54. 2 0
      library_core/src/main/res/values/yyxx_comm_strings.xml
  55. 11 0
      library_core/src/main/res/values/yyxx_comm_styles.xml
  56. 2 1
      library_platform/build.gradle
  57. 1 0
      library_platform/platform_hnyy/.gitignore
  58. 38 0
      library_platform/platform_hnyy/build.gradle
  59. 0 0
      library_platform/platform_hnyy/consumer-rules.pro
  60. 21 0
      library_platform/platform_hnyy/proguard-rules.pro
  61. 14 0
      library_platform/platform_hnyy/src/main/AndroidManifest.xml
  62. 139 0
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/SdkPlatformBridge.java
  63. 16 5
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/BaseLoginActivity.java
  64. 169 0
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/HNYYLoginActivity.java
  65. 0 0
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/HNYYLoginFragmentTag.java
  66. 5 0
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/action/IJsCallback.java
  67. 62 0
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/action/PageJsInteraction.java
  68. 91 0
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/adapter/UserListAdapter.java
  69. 161 0
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/dialog/AutoLoginDialog.java
  70. 93 0
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/dialog/CustomExitGameDialog.java
  71. 90 0
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/dialog/JsBaseDialog.java
  72. 259 0
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/dialog/UserCenterDialog.java
  73. 277 0
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/dialog/WvPageListDialog.java
  74. 391 0
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/floating/DotImageView.java
  75. 839 0
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/floating/FloatLogoMenu.java
  76. 87 0
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/floating/FloatViewManager.java
  77. 53 0
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/BaseFragment.java
  78. 98 8
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserAccountLoginFragment.java
  79. 65 32
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserPhoneLoginFragment.java
  80. 35 12
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserPhoneLoginSetpwdFragment.java
  81. 68 18
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserRegisterFragment.java
  82. 34 10
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserRetrievePwdFragment.java
  83. 202 0
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserSwitchAccountLoginFragment.java
  84. 91 0
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/widget/AccountLoginListView.java
  85. 1 1
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/widget/TosUtil.java
  86. 193 0
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/impl/SdkPlatformImpl.java
  87. 0 0
      library_platform/platform_hnyy/src/main/res/anim/hnyy_rotate_anim.xml
  88. 0 0
      library_platform/platform_hnyy/src/main/res/drawable/hnyy_btn_account_bg.xml
  89. 0 0
      library_platform/platform_hnyy/src/main/res/drawable/hnyy_btn_exit_bg.xml
  90. 0 0
      library_platform/platform_hnyy/src/main/res/drawable/hnyy_btn_guest_bg.xml
  91. 0 0
      library_platform/platform_hnyy/src/main/res/drawable/hnyy_checkbox_select.xml
  92. 0 0
      library_platform/platform_hnyy/src/main/res/drawable/hnyy_color_white_40.xml
  93. 0 0
      library_platform/platform_hnyy/src/main/res/drawable/hnyy_color_white_70.xml
  94. 0 0
      library_platform/platform_hnyy/src/main/res/drawable/hnyy_common_wv_bg.xml
  95. 0 0
      library_platform/platform_hnyy/src/main/res/drawable/hnyy_dialog_ios_bg.xml
  96. 0 0
      library_platform/platform_hnyy/src/main/res/drawable/hnyy_edittext_bg.xml
  97. 4 1
      library_platform/platform_hnyy/src/main/res/drawable/hnyy_exit_bg.xml
  98. 0 0
      library_platform/platform_hnyy/src/main/res/drawable/hnyy_game_float_menu_bg.xml
  99. 0 0
      library_platform/platform_hnyy/src/main/res/drawable/hnyy_hide_float_view_bg.xml
  100. 0 0
      library_platform/platform_hnyy/src/main/res/drawable/hnyy_login_bg.xml

+ 3 - 1
demo/build.gradle

@@ -73,4 +73,6 @@ dependencies {
     implementation project(path: ':library_core')
     implementation project(path: ':library_channel')
     implementation project(path: ':library_platform')
- }
+    implementation project(path: ':library_platform:platform_hnyy')
+
+}

+ 2 - 0
demo/src/main/AndroidManifest.xml

@@ -58,6 +58,8 @@
         <meta-data
             android:name="yyrh_game_code"
             android:value="100001" />
+
+
     </application>
 
 </manifest>

+ 3 - 2
demo/src/main/assets/yyxx_game/yyxx_cfg.properties

@@ -1,3 +1,4 @@
 YYXX_GAME_CODE=100001
-YYXX_GCP_CODE=
-YYXX_ONLINE_ENV=http://testsdkapi.yyxxgame.com
+YYXX_GCP_CODE=Y0101025
+YYXX_ONLINE_ENV=http://testsdkapi.yyxxgame.com
+YYXX_PLATFORM=HNYY

+ 9 - 3
demo/src/main/java/com/yyxx/commsdk/demo/DemoActivity.kt

@@ -134,6 +134,9 @@ class DemoActivity : Activity(), View.OnClickListener {
                 1 -> {
                      YYXXCommSdk.getInstance().login(this@DemoActivity){code,result->
                          if (code == ResultInfo.CODE_SUCCESS){
+                            ToastUtils.toastInfo(this@DemoActivity,"code:$code   msg:$result")
+                         }else{
+                             ToastUtils.toastInfo(this@DemoActivity,"code:$code   msg:$result")
 
                          }
                      }
@@ -259,6 +262,12 @@ class DemoActivity : Activity(), View.OnClickListener {
                 override fun onResult(code: Int, result: String?) {
                     if (code == ResultInfo.CODE_SUCCESS){
                         if (YYXXCommSdk.getInstance().hasExitView(this@DemoActivity)){
+
+                            finish()
+
+
+                        }else{
+
                             val msg = "是否关闭游戏?"
                             AlertDialog.Builder(this@DemoActivity)
                                 .setMessage(msg)
@@ -269,9 +278,6 @@ class DemoActivity : Activity(), View.OnClickListener {
                                 .setNegativeButton("取消",null)
                                 .create()
                                 .show()
-
-                        }else{
-                            finish()
                         }
 
                     }

+ 2 - 0
library_base/build.gradle

@@ -37,6 +37,8 @@ dependencies {
     api files('../libs/yyxx_support_1.0.2.jar')
 //    api files('../libs/ali_authsdk_2.12.1.jar')
     api files('../libs/android-support-v4.jar')
+    api files('../libs/oaid_sdk_1.0.25.aar')
+
 }
 
 //apply from: 'buildJar.gradle'

+ 24 - 64
library_base/src/main/java/cn/yyxx/commsdk/base/YYXXCommSdk.java

@@ -16,6 +16,7 @@ import java.util.List;
 
 import cn.yyxx.commsdk.Version;
 import cn.yyxx.commsdk.base.entity.Function;
+import cn.yyxx.commsdk.base.entity.ResultInfo;
 import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
 import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
 import cn.yyxx.commsdk.base.internal.ICallback;
@@ -160,16 +161,26 @@ public final class YYXXCommSdk {
             return;
         }
 
-        SdkBridgeManager.call(Function.INITIALIZE, new Class[]{Activity.class,ICallback.class}, new Object[]{activity, callback});
+        ICallback initCallback = new ICallback() {
+            @Override
+            public void onResult(int code, String result) {
+                if (code == ResultInfo.CODE_SUCCESS){
+                    doSdkInit = true;
+                }
+
+                callback.onResult(code, result);
+            }
+        };
+
+
+        SdkBridgeManager.call(Function.INITIALIZE, new Class[]{Activity.class,ICallback.class}, new Object[]{activity, initCallback});
     }
 
     public void setLogoutListener(Activity activity,ICallback callback){
         if (checkSdkBridgeNull(Function.SET_LOGOUT_LISTENER, callback)) {
             return;
         }
-        if (checkSdkNonInit(Function.SET_LOGOUT_LISTENER, callback)) {
-            return;
-        }
+
         SdkBridgeManager.call(Function.SET_LOGOUT_LISTENER, new Class[]{Activity.class,ICallback.class}, new Object[]{activity,callback});
 
     }
@@ -240,58 +251,23 @@ public final class YYXXCommSdk {
 
 
     /**
-     * SDK角色创建信息上报
      *
-     * @param activity Activity上下文
-     * @param roleInfo 角色信息实体
-     * @param callback 角色信息上报回调对象
+     * @param activity 上下文
+     * @param type     上报场景
+     * @param roleInfo 角色信息
      */
-    public void roleCreate(Activity activity, SdkRoleInfo roleInfo, ICallback callback) {
-        if (checkSdkBridgeNull(Function.ROLE_CREATE, callback)) {
+    public void roleCreate(Activity activity, String type,SdkRoleInfo roleInfo) {
+        if (checkSdkBridgeNull(Function.UPLOAD_ROLE_INFO, null)) {
             return;
         }
 
-        if (checkSdkNonInit(Function.ROLE_CREATE, callback)) {
+        if (checkSdkNonInit(Function.UPLOAD_ROLE_INFO, callback)) {
             return;
         }
-        SdkBridgeManager.call(Function.ROLE_CREATE, new Class[]{Activity.class, SdkRoleInfo.class, ICallback.class}, new Object[]{activity, roleInfo, callback});
+        SdkBridgeManager.call(Function.UPLOAD_ROLE_INFO, new Class[]{Activity.class, SdkRoleInfo.class, ICallback.class}, new Object[]{activity, roleInfo, callback});
     }
 
-    /**
-     * SDK角色登录信息上报
-     *
-     * @param activity Activity上下文
-     * @param roleInfo 角色信息实体
-     * @param callback 角色信息上报回调对象
-     */
-    public void roleLauncher(Activity activity, SdkRoleInfo roleInfo, ICallback callback) {
-        if (checkSdkBridgeNull(Function.ROLE_LAUNCHER, callback)) {
-            return;
-        }
 
-        if (checkSdkNonInit(Function.ROLE_LAUNCHER, callback)) {
-            return;
-        }
-        SdkBridgeManager.call(Function.ROLE_LAUNCHER, new Class[]{Activity.class, SdkRoleInfo.class, ICallback.class}, new Object[]{activity, roleInfo, callback});
-    }
-
-    /**
-     * SDK角色升级信息上报
-     *
-     * @param activity Activity上下文
-     * @param roleInfo 角色信息实体
-     * @param callback 角色信息上报回调对象
-     */
-    public void roleUpgrade(Activity activity, SdkRoleInfo roleInfo, ICallback callback) {
-        if (checkSdkBridgeNull(Function.ROLE_UPGRADE, callback)) {
-            return;
-        }
-
-        if (checkSdkNonInit(Function.ROLE_UPGRADE, callback)) {
-            return;
-        }
-        SdkBridgeManager.call(Function.ROLE_UPGRADE, new Class[]{Activity.class, SdkRoleInfo.class, ICallback.class}, new Object[]{activity, roleInfo, callback});
-    }
 
     /**
      * 是否显示SDK退出框
@@ -475,22 +451,6 @@ public final class YYXXCommSdk {
     }
 
 
-    public String getCurrentOpenId() {
-        if (checkSdkBridgeNull(Function.GET_CURRENT_USER_ID, null)) {
-            return "";
-        }
-
-        if (checkSdkNonInit(Function.GET_CURRENT_USER_ID, null)) {
-            return "";
-        }
-
-        return (String) SdkBridgeManager.callback(Function.GET_CURRENT_USER_ID, null, null);
-    }
-
-    public String getCurrentSdkVersion() {
-        return Version.VERSION_NAME;
-    }
-
     private boolean checkSdkBridgeNull(String function, ICallback callback) {
         if (mSdkBridge == null) {
             Logger.e("invoke " + function + " error ... SdkBridge is null");
@@ -505,9 +465,9 @@ public final class YYXXCommSdk {
 
     private boolean checkSdkNonInit(String function, ICallback callback) {
         if (!doSdkInit) {
-            Logger.e("invoke " + function + " error ... QSGameSdk not initialized yet");
+            Logger.e("invoke " + function + " error ... YYXXCommSdk not initialized yet");
             if (callback != null) {
-                callback.onResult(-1, "QSGameSdk还未进行初始化");
+                callback.onResult(-1, "YYXXCommSdk还未进行初始化");
             }
             return true;
         } else {

+ 2 - 6
library_core/src/main/java/cn/yyxx/commsdk/core/constants/Constants.java → library_base/src/main/java/cn/yyxx/commsdk/base/constants/Constants.java

@@ -1,4 +1,4 @@
-package cn.yyxx.commsdk.core.constants;
+package cn.yyxx.commsdk.base.constants;
 
 public class Constants {
 
@@ -11,15 +11,11 @@ public class Constants {
 
     public static final String LOGOUT = "LOGOUT";
 
-    public static final String SP_KEY = "yyxx_comm";
 
-    public static final long CLICK_INTERVAL = 2000L;
 
-    public static final int CODE_SUCCESS = 0;
+    public static final long CLICK_INTERVAL = 2000L;
 
-    public static final int CODE_FAIL = 1;
 
-    public static final int CODE_SERROR = -1;
 
 
 }

+ 2 - 5
library_base/src/main/java/cn/yyxx/commsdk/base/entity/Function.java

@@ -18,9 +18,8 @@ public @interface Function {
     String LOGIN = "login";
     String LOGOUT = "logout";
     String CHARGE = "charge";
-    String ROLE_CREATE = "roleCreate";
-    String ROLE_LAUNCHER = "roleLauncher";
-    String ROLE_UPGRADE = "roleUpgrade";
+    String UPLOAD_ROLE_INFO = "uploadRoleInfo";
+
     String HAS_EXIT_VIEW = "hasExitView";
     String OPEN_EXIT_VIEW = "openExitView";
     String REPORT_GAME_EVENT = "reportGameEvent";
@@ -39,6 +38,4 @@ public @interface Function {
 
 
     String REQUEST_PERMISSION = "requestPermission";
-    String GET_CURRENT_USER_ID = "getCurrentUserId";
-    String GET_CURRENT_SDK_VERSION = "getCurrentSdkVersion";
 }

+ 17 - 3
library_core/src/main/java/cn/yyxx/commsdk/core/entry/bean/InitBean.java → library_base/src/main/java/cn/yyxx/commsdk/base/entity/bean/InitBean.java

@@ -1,5 +1,6 @@
-package cn.yyxx.commsdk.core.entry.bean;
+package cn.yyxx.commsdk.base.entity.bean;
 
+import android.app.Activity;
 import android.text.TextUtils;
 
 
@@ -10,6 +11,9 @@ import org.json.JSONObject;
 
 import java.text.DecimalFormat;
 
+import cn.yyxx.support.AppUtils;
+import cn.yyxx.support.device.DeviceInfoUtils;
+
 public class InitBean {
 
     private static final String switchState = "1";
@@ -22,6 +26,8 @@ public class InitBean {
 
     public String agreement_user = "";
 
+    public String isEmulator = "0";
+
     public JSONObject links = null;
 
     public JSONArray reg_tabs = null;
@@ -33,9 +39,10 @@ public class InitBean {
     public int rn_bh = 1800;
 
 
-    public  boolean isShowPhoneRegFrist,isOpenRealName,isOpenFloatView,isForceRealName,isShowKf,isSMSBlocking;
 
-    public static InitBean toBean(String json) {
+    public  boolean isLandscape,isShowPhoneRegFrist,isOpenRealName,isOpenFloatView,isForceRealName,isShowKf,isSMSBlocking;
+
+    public static InitBean toBean(String json, Activity activity) {
         if (TextUtils.isEmpty(json)) {
             return null;
         }
@@ -57,6 +64,12 @@ public class InitBean {
 
             initBean.rn_bh = jsonObject.optInt("rn_bh", 1800);
 
+            initBean.isLandscape = AppUtils.isLandscape(activity);
+
+            if (DeviceInfoUtils.isEmulator(activity) &&DeviceInfoUtils.isEmulator2(activity)){
+                initBean.isEmulator = "1";
+            }
+
             if (initBean.reg_tabs != null) {
 
                 if (initBean.reg_tabs.get(0).toString().equals("phone")) {
@@ -94,6 +107,7 @@ public class InitBean {
                 ", sdk_login=" + sdk_login +
                 ", bswitch=" + bswitch +
                 ", rn_bh=" + rn_bh +
+                ", isLandscape=" + isLandscape +
                 ", isShowPhoneRegFrist=" + isShowPhoneRegFrist +
                 ", isOpenRealName=" + isOpenRealName +
                 ", isOpenFloatView=" + isOpenFloatView +

+ 9 - 0
library_base/src/main/java/cn/yyxx/commsdk/base/internal/PhoneLoginCallBack.java

@@ -0,0 +1,9 @@
+package cn.yyxx.commsdk.base.internal;
+
+public interface PhoneLoginCallBack {
+
+    void onPhoneLoginSuccess(String msg);
+    void onPhoneLoginFailed(String msg);
+    void onPhoneNewLogin();
+
+}

+ 3 - 8
library_base/src/main/java/cn/yyxx/commsdk/base/internal/feature/IFeature.java

@@ -3,6 +3,7 @@ package cn.yyxx.commsdk.base.internal.feature;
 import android.app.Activity;
 
 import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
+import cn.yyxx.commsdk.base.entity.bean.InitBean;
 import cn.yyxx.commsdk.base.internal.ICallback;
 
 /**
@@ -17,9 +18,9 @@ public interface IFeature {
 
     void setLogoutListener(Activity activity,ICallback callback);
 
-    void login(Activity activity, ICallback callback);
+    void login(Activity activity, InitBean initBean, ICallback callback);
 
-    void logout(Activity activity, ICallback callback);
+    void logout();
 
     void charge(Activity activity, SdkChargeInfo chargeInfo, ICallback callback);
 
@@ -27,11 +28,5 @@ public interface IFeature {
 
     void openExitView(Activity activity, ICallback callback);
 
-    void onDestroy(Activity activity);
 
-    String getUserId();
-
-    String getChannelVersion();
-
-    String getChannelName();
 }

+ 5 - 0
library_base/src/main/java/cn/yyxx/commsdk/base/internal/feature/ILifeCycle.java

@@ -3,6 +3,7 @@ package cn.yyxx.commsdk.base.internal.feature;
 import android.app.Activity;
 import android.content.Intent;
 import android.content.res.Configuration;
+import android.os.Bundle;
 
 /**
  * @author #Suyghur.
@@ -28,4 +29,8 @@ public interface ILifeCycle {
 
     void onWindowFocusChanged(Activity activity,boolean hasFocus);
 
+    void onDestroy(Activity activity);
+
+    void onCreate(Activity activity, Bundle savedInstanceState);
+
 }

+ 1 - 3
library_base/src/main/java/cn/yyxx/commsdk/base/internal/feature/IRoleData.java

@@ -11,9 +11,7 @@ import cn.yyxx.commsdk.base.internal.ICallback;
  */
 public interface IRoleData {
 
-    void roleCreate(Activity activity, SdkRoleInfo roleInfo, ICallback callback);
+    void uploadRoleInfo(Activity activity,String type,SdkRoleInfo roleInfo);
 
-    void roleLauncher(Activity activity, SdkRoleInfo roleInfo, ICallback callback);
 
-    void roleUpgrade(Activity activity, SdkRoleInfo roleInfo, ICallback callback);
 }

+ 2 - 4
library_channel/build.gradle

@@ -33,11 +33,9 @@ android {
 
 dependencies {
     compileOnly project(':library_base')
-    compileOnly project(':library_channel_repository')
-
-    api project(':library_base')
+    compileOnly project(':library_platform')
 
-    api files('../library_channel/libs/oaid_sdk_1.0.25.aar')
+    compileOnly project(':library_channel_repository')
 }
 
 //apply from: 'buildJar.gradle'

+ 21 - 27
library_channel/src/main/java/cn/yyxx/commsdk/impl/ChannelSdkImpl.java

@@ -5,18 +5,18 @@ import android.app.Application;
 import android.content.Context;
 import android.content.Intent;
 import android.content.res.Configuration;
-
-
+import android.os.Bundle;
 
 
 
 import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
-import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
+
+import cn.yyxx.commsdk.base.entity.bean.InitBean;
 import cn.yyxx.commsdk.base.internal.ICallback;
 import cn.yyxx.commsdk.base.internal.feature.IApplication;
 import cn.yyxx.commsdk.base.internal.feature.IFeature;
 import cn.yyxx.commsdk.base.internal.feature.ILifeCycle;
-import cn.yyxx.commsdk.base.internal.feature.IRoleData;
+
 
 /**
  * @author #Suyghur.
@@ -55,36 +55,18 @@ public class ChannelSdkImpl {
         impl.setLogoutListener(activity,callback);
     }
 
-    public void login(Activity activity, final ICallback callback) {
-        impl.login(activity, callback);
+    public void login(Activity activity, InitBean initBean, final ICallback callback) {
+        impl.login(activity,initBean, callback);
     }
 
-    public void logout(Activity activity, final ICallback callback) {
-        impl.logout(activity, callback);
+    public void logout() {
+        impl.logout();
     }
 
     public void charge(Activity activity, SdkChargeInfo chargeInfo, ICallback callback) {
         impl.charge(activity, chargeInfo, callback);
     }
 
-    public void roleCreate(Activity activity, SdkRoleInfo roleInfo, ICallback callback) {
-        if (impl instanceof IRoleData) {
-            ((IRoleData) impl).roleCreate(activity, roleInfo, callback);
-        }
-    }
-
-    public void roleLauncher(Activity activity, SdkRoleInfo roleInfo, ICallback callback) {
-        if (impl instanceof IRoleData) {
-            ((IRoleData) impl).roleLauncher(activity, roleInfo, callback);
-        }
-    }
-
-    public void roleUpgrade(Activity activity, SdkRoleInfo roleInfo, ICallback callback) {
-        if (impl instanceof IRoleData) {
-            ((IRoleData) impl).roleUpgrade(activity, roleInfo, callback);
-        }
-    }
-
     public boolean hasExitView(Activity activity) {
         return impl.hasExitView(activity);
     }
@@ -92,6 +74,14 @@ public class ChannelSdkImpl {
     public void openExitView(Activity activity, final ICallback callback) {
         impl.openExitView(activity, callback);
     }
+
+    public void onCreate(Activity activity, Bundle savedInstanceState){
+
+        if (impl instanceof ILifeCycle) {
+            ((ILifeCycle) impl).onCreate(activity,savedInstanceState);
+        }
+    }
+
     public void onStart(Activity activity) {
         if (impl instanceof ILifeCycle) {
             ((ILifeCycle) impl).onStart(activity);
@@ -124,7 +114,11 @@ public class ChannelSdkImpl {
     }
 
     public void onDestroy(Activity activity) {
-        impl.onDestroy(activity);
+
+        if (impl instanceof ILifeCycle) {
+            ((ILifeCycle) impl).onDestroy(activity);
+        }
+
     }
 
     public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {

+ 78 - 12
library_channel/src/main/java/cn/yyxx/commsdk/impl/channel/ChannelSdkYYXX.java

@@ -1,25 +1,40 @@
 package cn.yyxx.commsdk.impl.channel;
 
 import android.app.Activity;
+import android.app.Application;
+import android.content.Context;
+import android.content.Intent;
+import android.content.res.Configuration;
+import android.os.Bundle;
 
 import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
+import cn.yyxx.commsdk.base.entity.bean.InitBean;
 import cn.yyxx.commsdk.base.internal.ICallback;
+import cn.yyxx.commsdk.base.internal.feature.IApplication;
 import cn.yyxx.commsdk.base.internal.feature.IFeature;
+import cn.yyxx.commsdk.base.internal.feature.ILifeCycle;
 import cn.yyxx.commsdk.base.utils.Logger;
+import cn.yyxx.commsdk.platform.PlatformSdk;
 
 /**
  * @author #Suyghur.
  * Created on 2021/12/26
  */
-public class ChannelSdkYYXX implements IFeature {
+public class ChannelSdkYYXX implements IFeature, ILifeCycle, IApplication {
+
+    private Activity activity;
+
     @Override
     public void initialize(Activity activity, ICallback callback) {
         Logger.i("initialize");
+        this.activity = activity;
+        PlatformSdk.getInstance(activity).initialize(activity,callback);
     }
 
     @Override
     public void initializeSuccess() {
-        Logger.i("initializeSuccess");
+
+        PlatformSdk.getInstance(activity).initializeSuccess();
 
     }
 
@@ -27,18 +42,22 @@ public class ChannelSdkYYXX implements IFeature {
     @Override
     public void setLogoutListener(Activity activity, ICallback callback) {
         Logger.i("setLogoutListener");
+        PlatformSdk.getInstance(activity).setLogoutListener(activity,callback);
     }
 
-    @Override
-    public void login(Activity activity, ICallback callback) {
 
+    @Override
+    public void login(Activity activity, InitBean initBean, ICallback callback) {
+        PlatformSdk.getInstance(activity).login(activity,initBean,callback);
     }
 
     @Override
-    public void logout(Activity activity, ICallback callback) {
+    public void logout() {
+        PlatformSdk.getInstance(activity).logout();
 
     }
 
+
     @Override
     public void charge(Activity activity, SdkChargeInfo chargeInfo, ICallback callback) {
 
@@ -46,31 +65,78 @@ public class ChannelSdkYYXX implements IFeature {
 
     @Override
     public boolean hasExitView(Activity activity) {
-        return false;
+        return PlatformSdk.getInstance(activity).hasExitView(activity);
     }
 
     @Override
     public void openExitView(Activity activity, ICallback callback) {
 
+        PlatformSdk.getInstance(activity).openExitView(activity,callback);
+
     }
 
     @Override
     public void onDestroy(Activity activity) {
+        PlatformSdk.getInstance(activity).onDestroy(activity);
+    }
+
+    @Override
+    public void onCreate(Activity activity, Bundle savedInstanceState) {
+        PlatformSdk.getInstance(activity).onCreate(activity,savedInstanceState);
+    }
+
+    @Override
+    public void onStart(Activity activity) {
+        PlatformSdk.getInstance(activity).onStart(activity);
+    }
+
+    @Override
+    public void onResume(Activity activity) {
+        PlatformSdk.getInstance(activity).onResume(activity);
+    }
 
+    @Override
+    public void onReStart(Activity activity) {
+        PlatformSdk.getInstance(activity).onReStart(activity);
+    }
+
+    @Override
+    public void onPause(Activity activity) {
+        PlatformSdk.getInstance(activity).onPause(activity);
+    }
+
+    @Override
+    public void onStop(Activity activity) {
+        PlatformSdk.getInstance(activity).onStop(activity);
+    }
+
+    @Override
+    public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
+        PlatformSdk.getInstance(activity).onActivityResult(activity,requestCode,resultCode,data);
+    }
+
+    @Override
+    public void onNewIntent(Activity activity, Intent intent) {
+        PlatformSdk.getInstance(activity).onNewIntent(activity,intent);
+    }
+
+    @Override
+    public void onConfigurationChanged(Activity activity, Configuration newconfig) {
+        PlatformSdk.getInstance(activity).onConfigurationChanged(activity,newconfig);
     }
 
     @Override
-    public String getUserId() {
-        return null;
+    public void onWindowFocusChanged(Activity activity, boolean hasFocus) {
+        PlatformSdk.getInstance(activity).onWindowFocusChanged(activity,hasFocus);
     }
 
     @Override
-    public String getChannelVersion() {
-        return null;
+    public void attachBaseContext(Application application, Context context) {
+        PlatformSdk.getInstance(context).attachBaseContext(application,context);
     }
 
     @Override
-    public String getChannelName() {
-        return null;
+    public void initApplication(Application application) {
+        PlatformSdk.getInstance(application).initApplication(application);
     }
 }

+ 1 - 1
library_core/src/main/cpp/comm_map.cpp

@@ -15,7 +15,7 @@ CommMap *CommMap::GetInstance() {
 
 void CommMap::Init(JNIEnv *env, jobject context) {
     comm_params["game_code"] = ToolKit::GetGameCode(env,context);
-    comm_params["gcp_code"] = ParamsKit::GetGcpCode(env,context);
+    comm_params["gcp_code"] = ToolKit::GetGcpCode(env,context);
     comm_params["cs_ver"] = ToolKit::GetClientVersion(env,context);
     comm_params["system"] = "android";
     comm_params["device_ver"] = ToolKit::GetDeviceSoftwareVersion();

+ 1 - 0
library_core/src/main/cpp/comm_map.h

@@ -12,6 +12,7 @@ public:
     static CommMap *GetInstance();
     void Init(JNIEnv *env,jobject context);
     Json::Value comm_params;
+    std::string signature = "";
 private:
     CommMap();
     ~CommMap();

+ 2 - 2
library_core/src/main/cpp/params_kit.h

@@ -8,8 +8,8 @@
 #include <string>
 #include <jni.h>
 
-#define CONFIG_FILE "YyrhParam.cnf"
-#define GCP_CODE "GCP_CODE"
+#define CONFIG_FILE "yyxx_cfg.properties"
+#define GCP_CODE "YYXX_GCP_CODE"
 
 
 #ifdef __cplusplus

+ 15 - 0
library_core/src/main/cpp/tool_kit.cpp

@@ -86,6 +86,21 @@ std::string ToolKit::GetGameCode(JNIEnv *env, jobject context) {
     return JString2String(env, result);
 }
 
+std::string ToolKit::GetGcpCode(JNIEnv *env, jobject context) {
+    jclass clz = env->FindClass("cn/yyxx/commsdk/core/utils/ParamsUtils");
+    if (clz == nullptr) {
+        LOGE("ManifestUtils clz is nullptr !!!");
+        return "";
+    }
+    const char *method_name = "getGcpCode";
+    const char *sig = "(Landroid/content/Context;)Ljava/lang/String;";
+    jmethodID mid = env->GetStaticMethodID(clz, method_name, sig);
+    jstring key = env->NewStringUTF("YYXX_GCP_CODE");
+    auto result = (jstring) env->CallStaticObjectMethod(clz, mid, context);
+    env->DeleteLocalRef(clz);
+    env->DeleteLocalRef(key);
+    return JString2String(env, result);
+}
 
 
 std::string ToolKit::GetSpCode(JNIEnv *env, jobject context) {

+ 3 - 0
library_core/src/main/cpp/tool_kit.h

@@ -19,6 +19,9 @@ extern "C" {
 
         static std::string GetGameCode(JNIEnv *env,jobject context);
 
+        static std::string GetGcpCode(JNIEnv *env,jobject context);
+
+
         static std::string  GetSpCode(JNIEnv *env, jobject context);
 
         static std::string  GetClientVersion(JNIEnv *env, jobject context);

+ 3 - 3
library_core/src/main/cpp/yylog.cpp

@@ -8,7 +8,7 @@ bool YYLog::is_debug = true;
 
 void YYLog::D(JNIEnv *env, const std::string &msg) {
     if (is_debug) {
-        jclass clz = env->FindClass("cn/yyxx/commsdk/core/utils/YYLog");
+        jclass clz = env->FindClass("cn/yyxx/commsdk/base/utils/Logger");
         if (clz == nullptr) {
             LOGE("YYLog clz is null");
             return;
@@ -37,7 +37,7 @@ void YYLog::I(JNIEnv *env, const std::string &msg) {
 }
 
 void YYLog::E(JNIEnv *env, const std::string &msg) {
-    jclass clz = env->FindClass("cn/yyxx/commsdk/core/utils/YYLog");
+    jclass clz = env->FindClass("cn/yyxx/commsdk/base/utils/Logger");
     if (clz == nullptr) {
         LOGE("YYLog clz is null");
         return;
@@ -51,7 +51,7 @@ void YYLog::E(JNIEnv *env, const std::string &msg) {
 }
 
 void YYLog::LogHandler(JNIEnv *env, const std::string &msg) {
-    jclass clz = env->FindClass("cn/yyxx/commsdk/core/utils/YYLog");
+    jclass clz = env->FindClass("cn/yyxx/commsdk/base/utils/Logger");
     if (clz == nullptr) {
         LOGE("YYLog clz is null");
         return;

+ 1 - 1
library_core/src/main/cpp/yylog.h

@@ -14,7 +14,7 @@
 extern "C" {
 #endif
 
-#define TAG "YYLog"
+#define TAG "yyxx_commsdk"
 #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,TAG,__VA_ARGS__)
 #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,TAG,__VA_ARGS__)
 

+ 26 - 5
library_core/src/main/cpp/yyxxgame.cpp

@@ -62,10 +62,16 @@ jstring InvokeJob(JNIEnv *env,jobject clz,jstring data){
     time_t t;
     long ts = time(&t);
     Json::Value root = ToolKit::ToJsonObject(_data);
-    Json::Value::Members members = CommMap::GetInstance()->comm_params.getMemberNames();
-    for (auto &member:members) {
-        root[member] = CommMap::GetInstance()->comm_params[member];
+    std::string signature = CommMap::GetInstance()->signature;
+    if (signature.empty() || signature == "null"){
+        Json::Value::Members members = CommMap::GetInstance()->comm_params.getMemberNames();
+        for (auto &member:members) {
+            root[member] = CommMap::GetInstance()->comm_params[member];
+        }
+    }else{
+        root["access_token"] = signature;
     }
+
     std::string timestamp = std::to_string(ts);
     std::string sort_signature = ToolKit::GetJsonSortSignature(root);
     sort_signature.append("&time=").append(timestamp).append(API_KEY);
@@ -97,6 +103,16 @@ jstring InvokeJob(JNIEnv *env,jobject clz,jstring data){
 
 }
 
+jstring InvokeEncryptRsa(JNIEnv *env,jobject clz,jstring data){
+    const char *_data = env->GetStringUTFChars(data,JNI_FALSE);
+    jstring  result = ToolKit::RsaEncrypt(env,_data);
+    if (_data){
+        env->ReleaseStringUTFChars(data,_data);
+    }
+    return result;
+}
+
+
 jstring ParseJob(JNIEnv *env,jobject clz,jstring data){
     const char *_data = env->GetStringUTFChars(data,JNI_FALSE);
     jstring result = AesKit::Decrypt(env,_data);
@@ -107,6 +123,11 @@ jstring ParseJob(JNIEnv *env,jobject clz,jstring data){
 
 }
 
+static void SetClientSignature(JNIEnv *env, jclass thiz, jstring signature) {
+    std::string _signature = ToolKit::JString2String(env, signature);
+    CommMap::GetInstance()->signature = _signature;
+}
+
 static JNINativeMethod gMethods[] = {
 
         {"initDrive",  "(Landroid/content/Context;)V",            (void *) InitSdkDrive},
@@ -114,9 +135,9 @@ static JNINativeMethod gMethods[] = {
 //        {"setParam",   "(Ljava/lang/String;Ljava/lang/String;)V", (void *) SetParam},
 //        {"getParam",   "(Ljava/lang/String;)Ljava/lang/String;",  (void *) GetParam},
         {"invokeJob",  "(Ljava/lang/String;)Ljava/lang/String;",  (void *) InvokeJob},
+        {"invokeEncryptRsa",  "(Ljava/lang/String;)Ljava/lang/String;",  (void *) InvokeEncryptRsa},
         {"parseJob",   "(Ljava/lang/String;)Ljava/lang/String;",  (void *) ParseJob},
-//        {"RsaEncrypt", "(Ljava/lang/String;)Ljava/lang/String;",  (void *) RsaEncrypt}
-};
+        {"setClientSignature", "(Ljava/lang/String;)V",(void *) SetClientSignature}};
 
 JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
     JNIEnv *env = nullptr;

+ 5 - 5
library_core/src/main/java/cn/yyxx/commsdk/core/SdkBridge.java

@@ -11,6 +11,7 @@ import java.util.List;
 
 import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
 import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
+import cn.yyxx.commsdk.base.entity.bean.InitBean;
 import cn.yyxx.commsdk.base.internal.ICallback;
 import cn.yyxx.commsdk.base.internal.IInitialize;
 import cn.yyxx.commsdk.core.impl.SdkBridgeImpl;
@@ -122,12 +123,11 @@ public final class SdkBridge {
         impl.onCreate(activity,savedInstanceState);
     }
 
-    public String getCurrentUserId() {
-        return impl.getCurrentUserId();
-    }
-
-
     public void requestPermission(Activity activity, List<String> permissions, ICallback callback) {
         impl.requestPermission(activity, permissions, callback);
     }
+
+    public void onWindowFocusChanged(Activity activity,boolean hasFocus){
+        impl.onWindowFocusChanged(activity,hasFocus);
+    }
 }

+ 3 - 1
library_core/src/main/java/cn/yyxx/commsdk/core/SdkDrive.java

@@ -26,9 +26,11 @@ public class SdkDrive {
 
     public native String invokeJob(String data);
 
+    public native String invokeEncryptRsa(String data);
+
     public native String parseJob(String data);
 
-//    public native String RsaEncrypt(String data);
+    public native static void setClientSignature(String signature);
 
     private static final class NTestHolder {
         private static final SdkDrive INSTANCE = new SdkDrive();

+ 12 - 5
library_core/src/main/java/cn/yyxx/commsdk/core/common/CommonOperationManager.java

@@ -25,9 +25,10 @@ import cn.yyxx.commsdk.base.internal.IMsaDeviceCallback;
 import cn.yyxx.commsdk.base.internal.IRequestCallback;
 import cn.yyxx.commsdk.base.utils.Logger;
 import cn.yyxx.commsdk.core.SdkDrive;
-import cn.yyxx.commsdk.core.constants.Constants;
-import cn.yyxx.commsdk.core.entry.bean.InitBean;
+import cn.yyxx.commsdk.base.constants.Constants;
+import cn.yyxx.commsdk.base.entity.bean.InitBean;
 import cn.yyxx.commsdk.core.network.SdkRequest;
+import cn.yyxx.commsdk.core.ui.dialog.LoadingDialogUtils;
 import cn.yyxx.commsdk.core.ui.dialog.PrivacyPolicyDialog;
 import cn.yyxx.commsdk.core.ui.dialog.SingleButtonDialog;
 import cn.yyxx.commsdk.core.utils.MMKVUtils;
@@ -73,12 +74,16 @@ public class CommonOperationManager {
         }
 
 
+
         String isShowPolicy = MMKVUtils.getInstance().commonKV.decodeString("isShowPolicy","");
         if (isShowPolicy.isEmpty()){
+
+            LoadingDialogUtils.getInstance().show(activity);
             SdkRequest.getInstance().initAgreement(activity, new IRequestCallback() {
                 @Override
                 public void onResponse(ResultInfo resultInfo) {
 
+                    LoadingDialogUtils.getInstance().hide();
 
                     if (resultInfo.code == 400){
                         showExitDialog(activity);
@@ -171,13 +176,15 @@ public class CommonOperationManager {
 
     private void startInitSdk(Activity activity, ICallback callback) {
 
+        LoadingDialogUtils.getInstance().show(activity,activity.getString(ResourceUtil.getStringId(activity,"yyxx_comm_initing")));
+
         SdkRequest.getInstance().initSdk(activity, new IRequestCallback() {
             @Override
             public void onResponse(ResultInfo resultInfo) {
-
+                LoadingDialogUtils.getInstance().hide();
                 if (resultInfo.code ==ResultInfo.CODE_SUCCESS){
-                    initBean = InitBean.toBean(resultInfo.data);
-                    initBean.toString();
+                    initBean = InitBean.toBean(resultInfo.data,activity);
+                    SdkDrive.setClientSignature(initBean.access_token);
                     Logger.i(initBean.toString());
                     callback.onResult(resultInfo.CODE_SUCCESS,activity.getString(ResourceUtil.getStringId(activity,"yyxx_comm_init_success")));
                 }else if (resultInfo.code ==ResultInfo.CODE_FAIL){

+ 1 - 1
library_core/src/main/java/cn/yyxx/commsdk/core/entry/ComponentLoginConfig.java → library_core/src/main/java/cn/yyxx/commsdk/core/entity/ComponentLoginConfig.java

@@ -1,4 +1,4 @@
-package cn.yyxx.commsdk.core.entry;
+package cn.yyxx.commsdk.core.entity;
 
 public class ComponentLoginConfig {
         public String agreement_privacy = "";

+ 81 - 0
library_core/src/main/java/cn/yyxx/commsdk/core/entity/SdkLoginInfo.java

@@ -0,0 +1,81 @@
+package cn.yyxx.commsdk.core.entity;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import cn.yyxx.support.JsonUtils;
+
+public class SdkLoginInfo {
+
+    private static SdkLoginInfo mInstance;
+
+    public String authentication = "",user_center= "",login_token= "",rn_si= "",uname= "",token= "";
+
+    private SdkLoginInfo() {
+
+    }
+
+    public static SdkLoginInfo getInstance() {
+        if (mInstance == null) {
+            synchronized (SdkLoginInfo.class) {
+                if (mInstance == null) {
+                    mInstance = new SdkLoginInfo();
+                }
+            }
+        }
+        return mInstance;
+    }
+
+    public void  reset(){
+        authentication = "";
+        user_center= "";
+        login_token= "";
+        rn_si= "";
+        uname= "";
+        token= "";
+
+    }
+
+
+    public void initLoginInfo(String json){
+        try {
+            JSONObject jsonObject = new JSONObject(json);
+            JSONObject links = jsonObject.optJSONObject("links");
+            if (JsonUtils.hasJsonKey(links, "authentication")) {
+                authentication = links.optString("authentication");
+            }
+            if (JsonUtils.hasJsonKey(links, "user_center")) {
+                user_center = links.optString("user_center");
+            }
+            if (JsonUtils.hasJsonKey(jsonObject, "login_token")) {
+                login_token = jsonObject.optString("login_token");
+            }
+            if (JsonUtils.hasJsonKey(jsonObject, "rn_si")) {
+                rn_si = jsonObject.optString("rn_si");
+            }
+            if (JsonUtils.hasJsonKey(jsonObject, "uname")) {
+                uname = jsonObject.optString("uname");
+            }
+            if (JsonUtils.hasJsonKey(jsonObject, "token")) {
+                token = jsonObject.optString("token");
+            }
+
+
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+
+    }
+
+    @Override
+    public String toString() {
+        return "SdkLoginInfo{" +
+                "authentication='" + authentication + '\'' +
+                ", user_center='" + user_center + '\'' +
+                ", login_token='" + login_token + '\'' +
+                ", rn_si='" + rn_si + '\'' +
+                ", uname='" + uname + '\'' +
+                ", token='" + token + '\'' +
+                '}';
+    }
+}

+ 95 - 8
library_core/src/main/java/cn/yyxx/commsdk/core/impl/SdkBridgeImpl.java

@@ -12,12 +12,14 @@ import org.json.JSONException;
 import org.json.JSONObject;
 
 import java.util.List;
-import java.util.Map;
+
+
 
 import cn.yyxx.commsdk.base.entity.Function;
 import cn.yyxx.commsdk.base.entity.ResultInfo;
 import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
 import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
+import cn.yyxx.commsdk.base.entity.bean.InitBean;
 import cn.yyxx.commsdk.base.internal.ICallback;
 
 import cn.yyxx.commsdk.base.utils.Logger;
@@ -107,12 +109,12 @@ public final class SdkBridgeImpl {
 
     }
 
-    public void login(Activity activity, final ICallback callback) {
+    public void login(Activity activity , final ICallback callback) {
         if (mSdkProxy == null) {
             mSdkProxy = getSdkProxyManager(activity);
         }
 
-        SdkProxyManager.call(Function.LOGIN,  new Class[]{Activity.class, ICallback.class}, new Object[]{activity,callback});
+        SdkProxyManager.call(Function.LOGIN,  new Class[]{Activity.class,InitBean.class, ICallback.class}, new Object[]{activity,CommonOperationManager.initBean,callback});
 
     }
 
@@ -134,42 +136,129 @@ public final class SdkBridgeImpl {
     }
 
     public boolean hasExitView(Activity activity) {
-        return false;
+         return (boolean)SdkProxyManager.callback(Function.HAS_EXIT_VIEW,new Class[]{Activity.class}, new Object[]{activity});
     }
 
     public void openExitView(Activity activity, final ICallback callback) {
+        SdkProxyManager.call(Function.OPEN_EXIT_VIEW,new Class[]{Activity.class,ICallback.class}, new Object[]{activity,callback});
     }
 
     public void onStart(Activity activity) {
+
+        if (mSdkProxy == null) {
+            mSdkProxy = getSdkProxyManager(activity);
+        }
+
+        SdkProxyManager.call(Function.ON_START, new Class[]{Activity.class}, new Object[]{activity});
+
     }
 
     public void onRestart(Activity activity) {
+
+        if (mSdkProxy == null) {
+            mSdkProxy = getSdkProxyManager(activity);
+        }
+
+        SdkProxyManager.call(Function.ON_RESTART, new Class[]{Activity.class}, new Object[]{activity});
+
     }
 
     public void onResume(Activity activity) {
+
+        if (mSdkProxy == null) {
+            mSdkProxy = getSdkProxyManager(activity);
+        }
+
+        SdkProxyManager.call(Function.ON_RESUME, new Class[]{Activity.class}, new Object[]{activity});
+
     }
 
 
     public void onPause(Activity activity) {
+        
+        if (mSdkProxy == null) {
+            mSdkProxy = getSdkProxyManager(activity);
+        }
+        
+        SdkProxyManager.call(Function.ON_PAUSE, new Class[]{Activity.class}, new Object[]{activity});
+
     }
 
     public void onStop(Activity activity) {
+        
+        if (mSdkProxy == null) {
+            mSdkProxy = getSdkProxyManager(activity);
+        }
+        
+        SdkProxyManager.call(Function.ON_STOP, new Class[]{Activity.class}, new Object[]{activity});
+
     }
 
     public void onDestroy(Activity activity) {
+        
+        if (mSdkProxy == null) {
+            mSdkProxy = getSdkProxyManager(activity);
+        }
+        SdkProxyManager.call(Function.ON_DESTROY, new Class[]{Activity.class}, new Object[]{activity});
+
     }
 
     public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent intent) {
+
+        if (mSdkProxy == null) {
+            mSdkProxy = getSdkProxyManager(activity);
+        }
+        
+        SdkProxyManager.call(Function.ON_ACTIVITY_RESULT,
+                new Class[]{Activity.class, Integer.class, Integer.class, Intent.class},
+                new Object[]{activity, requestCode, resultCode, intent});
+        
     }
 
     public void onNewIntent(Activity activity, Intent intent) {
+
+        if (mSdkProxy == null) {
+            mSdkProxy = getSdkProxyManager(activity);
+        }
+        
+        SdkProxyManager.call(Function.ON_NEW_INTENT, new Class[]{Activity.class, Intent.class}, new Object[]{activity, intent});
+
     }
 
     public void onConfigurationChanged(Activity activity, Configuration newConfigs){
+        
+
+        if (mSdkProxy == null) {
+            mSdkProxy = getSdkProxyManager(activity);
+        }
+        
+        
+        SdkProxyManager.call(Function.ON_CONFIGURATION_CHANGED, new Class[]{Activity.class,Configuration.class}, new Object[]{activity,newConfigs});
+
+        
     }
-    public void onCreate(Activity activity, Bundle saveInstanceState){
+    public void onCreate(Activity activity, Bundle savedInstanceState){
+
+        if (mSdkProxy == null) {
+            mSdkProxy = getSdkProxyManager(activity);
+        }
+        
+        SdkProxyManager.call(Function.ON_CREATE, new Class[]{Activity.class, Bundle.class}, new Object[]{activity, savedInstanceState});
 
     }
+
+
+    public void onWindowFocusChanged(Activity activity,boolean hasFocus){
+
+        if (mSdkProxy == null) {
+            mSdkProxy = getSdkProxyManager(activity);
+        }
+        
+        SdkProxyManager.call(Function.ON_WINDOW_FOCUS_CHANGED, new Class[]{Activity.class,boolean.class}, new Object[]{activity,hasFocus});
+
+    }
+
+
     public void requestPermission(Activity activity, List<String> permissions, ICallback callback) {
         Logger.i(" request  extend permission ...");
         PermissionKit.with().permission(permissions).request(activity, new IPermissionCallback() {
@@ -209,9 +298,7 @@ public final class SdkBridgeImpl {
 
 
 
-    public String getCurrentUserId() {
-        return "";
-    }
+
 
 
     private JSONObject permissionList2Json(List<String> list) {

+ 6 - 6
library_core/src/main/java/cn/yyxx/commsdk/core/network/Hosts.java

@@ -13,18 +13,18 @@ public class Hosts {
 
     public static final String  BASIC_URL_INIT_SDK = "activate";
 
-    public static final String  BASIC_URL_FAST_REGISTER = HOST +  "/fast_register";
-    public static final String  BASIC_URL_USER_LOGIN = HOST + "/user_login";
+    public static final String  BASIC_URL_FAST_REGISTER = "fast_register";
+    public static final String  BASIC_URL_USER_LOGIN =  "user_login";
     public static final String  BASIC_URL_UPLOAD_ROLEINFO = HOST +  "/report_role_info";
     public static final String  BASIC_URL_RECHARGE_INIT= HOST +  "/recharge_init";
     public static final String  BASIC_URL_CHANNEL_LOGIN = HOST +  "/channel_login";
-    public static final String  BASIC_URL_GET_CAPTCHA = HOST +  "/phone_captcha";
-    public static final String  BASIC_URL_PHONE_REGISTER = HOST +  "/phone_register";
-    public static final String  BASIC_URL_PHONE_RESETPWD = HOST +  "/phone_reset_pwd";
+    public static final String  BASIC_URL_GET_CAPTCHA = "phone_captcha";
+    public static final String  BASIC_URL_PHONE_REGISTER =  "phone_register";
+    public static final String  BASIC_URL_PHONE_RESETPWD =   "phone_reset_pwd";
 
     public static final String  BASIC_URL_ORDER_QUERY = HOST +  "/order_query";
     public static final String  BASIC_URL_AGREEMENT_INIT = HOST +  "/agreement_init";
-    public static final String  BASIC_URL_SMS_LOGIN = HOST +  "/phone_sms_login";
+    public static final String  BASIC_URL_SMS_LOGIN =   "phone_sms_login";
     public static final String  BASIC_URL_PAYMENTWAY = HOST +  "/payment_way";
     
 }

+ 142 - 0
library_core/src/main/java/cn/yyxx/commsdk/core/network/SdkRequest.java

@@ -2,7 +2,10 @@ package cn.yyxx.commsdk.core.network;
 
 import static cn.yyxx.commsdk.core.network.Hosts.HOST;
 
+import android.app.Activity;
 import android.content.Context;
+import android.text.TextUtils;
+import android.util.Log;
 
 import org.json.JSONException;
 import org.json.JSONObject;
@@ -10,10 +13,15 @@ import org.json.JSONObject;
 import cn.yyxx.commsdk.base.internal.ICallback;
 import cn.yyxx.commsdk.base.internal.IRequestCallback;
 
+import cn.yyxx.commsdk.base.utils.Logger;
 import cn.yyxx.commsdk.core.SdkDrive;
 import cn.yyxx.commsdk.core.common.CommonOperationManager;
 import cn.yyxx.commsdk.core.utils.ManifestUtils;
+import cn.yyxx.commsdk.core.utils.SignUtils;
 import cn.yyxx.support.PropertiesUtils;
+import cn.yyxx.support.device.DeviceInfoUtils;
+import cn.yyxx.support.encryption.aes.AesUtils;
+import cn.yyxx.support.encryption.rsa.RsaUtils;
 
 public class SdkRequest {
     private static volatile SdkRequest mInstance;
@@ -57,4 +65,138 @@ public class SdkRequest {
         String paramText = SdkDrive.getInstance().invokeJob(ifa_info.toString());
         VolleyRequest.post(context,HOST,paramText,callback);
     }
+
+    public void reigsterAccount(Context context, String account,String password,IRequestCallback callback){
+
+        JSONObject json = new JSONObject();
+
+        String uname_pwd = SdkDrive.getInstance().invokeEncryptRsa(account + "|" +password);
+
+        try {
+            json.put("route_path",Hosts.BASIC_URL_FAST_REGISTER);
+            json.put("smt_type",CommonOperationManager.initBean.isEmulator);
+            json.put("uname_pwd",uname_pwd);
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+
+
+
+        String paramText = SdkDrive.getInstance().invokeJob(json.toString());
+
+        VolleyRequest.post(context,HOST,paramText,callback);
+    }
+
+    public void accountLogin(Context context, String account,String password,String login_token,IRequestCallback callback){
+
+        JSONObject json = new JSONObject();
+
+        try {
+            json.put("route_path",Hosts.BASIC_URL_USER_LOGIN);
+            json.put("smt_type",CommonOperationManager.initBean.isEmulator);
+
+            if (TextUtils.isEmpty(password)){
+
+                json.put("login_token",login_token);
+
+            }else{
+
+                String uname_pwd = SdkDrive.getInstance().invokeEncryptRsa(account + "|" +password);
+                json.put("uname_pwd",uname_pwd);
+            }
+
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+
+
+
+        String paramText = SdkDrive.getInstance().invokeJob(json.toString());
+
+        VolleyRequest.post(context,HOST,paramText,callback);
+    }
+
+    public void getPhoneCaptcha(Context context,String phoneNum,String action,IRequestCallback callback){
+        JSONObject json = new JSONObject();
+
+        try {
+            json.put("route_path",Hosts.BASIC_URL_GET_CAPTCHA);
+            json.put("phone",phoneNum);
+            json.put("action",action);
+
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+
+
+
+        String paramText = SdkDrive.getInstance().invokeJob(json.toString());
+
+        VolleyRequest.post(context,HOST,paramText,callback);
+    }
+
+
+    public void phoneLoginWithSms(Context context,String phoneNum,String code,IRequestCallback callback){
+        JSONObject json = new JSONObject();
+
+        try {
+            json.put("route_path",Hosts.BASIC_URL_SMS_LOGIN);
+            json.put("phone",phoneNum);
+            json.put("sms",code);
+
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+
+
+
+        String paramText = SdkDrive.getInstance().invokeJob(json.toString());
+
+        VolleyRequest.post(context,HOST,paramText,callback);
+    }
+
+    public void setPassword(Context context, String account, String password,String code, IRequestCallback callback){
+
+        JSONObject json = new JSONObject();
+
+        String uname_pwd = SdkDrive.getInstance().invokeEncryptRsa(account + "|" +password);
+
+        try {
+            json.put("route_path",Hosts.BASIC_URL_PHONE_REGISTER);
+            json.put("smt_type",CommonOperationManager.initBean.isEmulator);
+            json.put("sms",code);
+            json.put("uname_pwd",uname_pwd);
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+
+
+
+        String paramText = SdkDrive.getInstance().invokeJob(json.toString());
+
+        VolleyRequest.post(context,HOST,paramText,callback);
+
+    }
+
+    public void resetPassword(Context context, String phoneNum, String password,String code, IRequestCallback callback){
+
+        JSONObject json = new JSONObject();
+
+        String phone_pwd = SdkDrive.getInstance().invokeEncryptRsa(phoneNum + "|" +password + "|" +code);
+
+        try {
+            json.put("route_path",Hosts.BASIC_URL_PHONE_RESETPWD);
+            json.put("phone_pwd",phone_pwd);
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+
+
+
+        String paramText = SdkDrive.getInstance().invokeJob(json.toString());
+
+        VolleyRequest.post(context,HOST,paramText,callback);
+
+    }
+
 }

+ 95 - 0
library_core/src/main/java/cn/yyxx/commsdk/core/ui/dialog/LoadingDialogUtils.java

@@ -0,0 +1,95 @@
+package cn.yyxx.commsdk.core.ui.dialog;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.Context;
+import android.graphics.Color;
+import android.graphics.drawable.ColorDrawable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.Window;
+import android.widget.TextView;
+
+import cn.yyxx.commsdk.core.utils.ResourceUtil;
+
+public class LoadingDialogUtils {
+
+    public static LoadingDialogUtils mInstance;
+    private AlertDialog dialog;
+
+
+    private static boolean isLoading;
+
+    private LoadingDialogUtils(){}
+
+    public void show(Context context,String msg){
+        if (null == context || ((Activity)context).isFinishing()) return;
+        if (isLoading)return;
+        dialog = new AlertDialog.Builder(context, ResourceUtil.getStyleId(context, "yyxx_comm_loading_dialog")).create();
+        View view = LayoutInflater.from(context).inflate(ResourceUtil.getLayoutId(context, "yyxx_comm_loading_dialog"),null);
+        TextView text = view.findViewById(ResourceUtil.getId(context, "id_tv_loadingmsg"));
+        text.setText(msg);
+        Window window = dialog.getWindow();
+        if (window != null){
+            window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
+        }
+        dialog.show();
+        dialog.setCancelable(false);
+        dialog.setCanceledOnTouchOutside(false);
+        dialog.setContentView(view);
+
+
+    }
+
+    public void show(Context context){
+        if (null == context || ((Activity)context).isFinishing()) return;
+        if (isLoading)return;
+        dialog = new AlertDialog.Builder(context, ResourceUtil.getStyleId(context, "hnyy_progress_dialog")).create();
+        View view = LayoutInflater.from(context).inflate(ResourceUtil.getLayoutId(context, "hnyy_dialog_progress"),null);
+        TextView text = view.findViewById(ResourceUtil.getId(context, "id_tv_loadingmsg"));
+        text.setVisibility(View.GONE);
+        Window window = dialog.getWindow();
+        if (window != null){
+            window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
+            window.setWindowAnimations(ResourceUtil.getAnimId(context,"hnyy_rotate_anim"));
+
+        }
+        dialog.show();
+        dialog.setCancelable(false);
+        dialog.setCanceledOnTouchOutside(false);
+        dialog.setContentView(view);
+
+
+    }
+
+
+    public void hide(){
+        if (dialog != null){
+            dialog.dismiss();
+        }
+    }
+    public static boolean isLoading() {
+        return isLoading;
+    }
+
+
+
+
+
+
+    /**
+     * 单一实例
+     *
+     */
+    public static LoadingDialogUtils getInstance() {
+        if (mInstance == null) {
+            synchronized (LoadingDialogUtils.class) {
+                if (mInstance == null) {
+                    mInstance = new LoadingDialogUtils();
+                    return mInstance;
+                }
+            }
+        }
+        return mInstance;
+    }
+}

+ 0 - 2
library_core/src/main/java/cn/yyxx/commsdk/core/ui/dialog/PrivacyPolicyDialog.java

@@ -42,8 +42,6 @@ public class PrivacyPolicyDialog extends Dialog {
 
         setContentView(ResourceUtil.getLayoutId(context,
                 "yyxx_comm_privacy_dialog"));
-        boolean  isLandscape = AppUtils.isLandscape(context);
-
 
          WebView webView;
          WebSettings webSettings;

+ 1 - 1
library_core/src/main/java/cn/yyxx/commsdk/core/utils/MMKVUtils.java

@@ -34,7 +34,7 @@ public class MMKVUtils implements MMKVHandler {
     public void init(Context context) {
         String dir = String.format(Locale.getDefault(), "%s/sdk_info", context.getExternalFilesDir("").getAbsolutePath());
         Logger.i("root dir:" + dir);
-        MMKV.initialize(context, dir, MMKVLogLevel.LevelInfo);
+        MMKV.initialize(context, dir, MMKVLogLevel.LevelNone);
         MMKV.registerHandler(this);
 
         userKV = MMKV.mmkvWithID("user_info");

+ 4 - 0
library_core/src/main/java/cn/yyxx/commsdk/core/utils/ParamsUtils.java

@@ -7,8 +7,12 @@ import cn.yyxx.support.PropertiesUtils;
 public class ParamsUtils {
     private static String  CONFIG_FILE  =  "yyxx_cfg.properties";
     private static String  YYXX_GAME_CODE  =  "YYXX_GAME_CODE";
+    private static String  YYXX_GCP_CODE  =  "YYXX_GCP_CODE";
     private static String ASSETS_PATH = "yyxx_game";
     public static String getGameCode(Context context){
          return PropertiesUtils.getValue4Properties(context,CONFIG_FILE,ASSETS_PATH,YYXX_GAME_CODE);
     }
+    public static String getGcpCode(Context context){
+        return PropertiesUtils.getValue4Properties(context,CONFIG_FILE,ASSETS_PATH,YYXX_GCP_CODE);
+    }
 }

+ 74 - 0
library_core/src/main/java/cn/yyxx/commsdk/core/utils/SignUtils.java

@@ -0,0 +1,74 @@
+package cn.yyxx.commsdk.core.utils;
+
+
+import android.util.Base64;
+
+import java.io.ByteArrayOutputStream;
+import java.net.URLEncoder;
+import java.security.Key;
+import java.security.KeyFactory;
+import java.security.MessageDigest;
+import java.security.spec.X509EncodedKeySpec;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.crypto.Cipher;
+import javax.crypto.Mac;
+import javax.crypto.spec.SecretKeySpec;
+
+public class SignUtils {
+
+    private static final int MAX_ENCRYPT_BLOCK = 117;
+    public static final String KEY_ALGORITHM = "RSA";
+
+
+
+    public static String encryptRsaByPublicKey(String key, String text)
+            throws Exception {
+
+        // 对公钥解密
+        byte[] data = Base64.decode(key, Base64.NO_WRAP);
+
+
+
+        byte[] byteText = text.getBytes();
+        // 取得公钥
+        X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(data);
+        KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
+        Key publicKey = keyFactory.generatePublic(x509KeySpec);
+
+        // 对数据加密
+        Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
+        cipher.init(Cipher.ENCRYPT_MODE, publicKey);
+
+        int inputLen = byteText.length;
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        int offSet = 0;
+        byte[] cache;
+        int i = 0;
+        while (inputLen -offSet > 0 ){
+            if(inputLen -offSet >MAX_ENCRYPT_BLOCK){
+                cache = cipher.doFinal(byteText,offSet,MAX_ENCRYPT_BLOCK);
+            }else{
+                cache = cipher.doFinal(byteText,offSet,inputLen - offSet);
+            }
+            out.write(cache,0,cache.length);
+            i++;
+            offSet = i * MAX_ENCRYPT_BLOCK;
+        }
+        byte[] encryptedData = out.toByteArray();
+        out.close();
+
+
+        String strBase64 = new String(Base64.encode(encryptedData, Base64.NO_WRAP));
+
+        return strBase64;
+    }
+
+
+}
+

+ 0 - 84
library_core/src/main/java/cn/yyxx/commsdk/core/utils/YYLog.java

@@ -1,84 +0,0 @@
-package cn.yyxx.commsdk.core.utils;
-
-import android.app.Application;
-
-import com.dolin.zap.Zap;
-import com.dolin.zap.entity.Config;
-import com.dolin.zap.entity.Level;
-
-import cn.yyxx.support.hawkeye.LogUtils;
-
-public final class YYLog {
-
-    private static final String TAG = "YYLog";
-    private static boolean hasZapInit = false;
-
-    private YYLog() {
-    }
-
-    public static void initZap(Application application) {
-        Level level = null;
-        if (LogUtils.DEBUG) {
-            level = Level.DEBUG;
-        } else {
-            level = Level.INFO;
-        }
-        Config config = new Config.Builder()
-                //logcat输出最低等级
-                .setLogcatLevel(level)
-                //是否开启缓存日志
-                .setRecordEnable(true)
-                //缓存日志最低等级
-                .setRecordLevel(Level.DEBUG)
-                //是否开启压缩缓存日志内容
-                .setCompressEnable(true)
-                //缓存文件的过期时间
-                .setOverdueDay(3)
-                //缓存文件大小限制,超过则会自动扩容新文件
-                .setFileSizeLimitDay(10)
-                .create();
-        Zap.initialize(application, config);
-        hasZapInit = true;
-    }
-
-    public static void d(Object object) {
-        d(TAG, object);
-    }
-
-    public static void d(String tag, Object object) {
-        if (hasZapInit) {
-            Zap.d(tag, object);
-        } else {
-            LogUtils.d(tag, object);
-        }
-    }
-
-    public static void i(Object object) {
-        i(TAG, object);
-    }
-
-    public static void i(String tag, Object object) {
-        if (hasZapInit) {
-            Zap.i(tag, object);
-        } else {
-            LogUtils.i(tag, object);
-        }
-    }
-
-    public static void e(Object object) {
-        e(TAG, object);
-    }
-
-    public static void e(String tag, Object object) {
-        if (hasZapInit) {
-            Zap.e(tag, object);
-        } else {
-            LogUtils.e(tag, object);
-        }
-    }
-
-    public static void logHandler(String msg) {
-        LogUtils.logHandler(msg);
-    }
-
-}

+ 15 - 0
library_core/src/main/res/drawable/yyxx_comm_progress_drawable_white.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<animation-list android:oneshot="false"
+                xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:duration="83" android:drawable="@mipmap/yyxx_comm_loading_white_01" />
+    <item android:duration="83" android:drawable="@mipmap/yyxx_comm_loading_white_02" />
+    <item android:duration="83" android:drawable="@mipmap/yyxx_comm_loading_white_03" />
+    <item android:duration="83" android:drawable="@mipmap/yyxx_comm_loading_white_04" />
+    <item android:duration="83" android:drawable="@mipmap/yyxx_comm_loading_white_05" />
+    <item android:duration="83" android:drawable="@mipmap/yyxx_comm_loading_white_06" />
+    <item android:duration="83" android:drawable="@mipmap/yyxx_comm_loading_white_07" />
+    <item android:duration="83" android:drawable="@mipmap/yyxx_comm_loading_white_08" />
+    <item android:duration="83" android:drawable="@mipmap/yyxx_comm_loading_white_09" />
+    <item android:duration="83" android:drawable="@mipmap/yyxx_comm_loading_white_11" />
+    <item android:duration="83" android:drawable="@mipmap/yyxx_comm_loading_white_12" />
+</animation-list>

+ 2 - 2
library_platform/src/main/res/layout/hnyy_dialog_progress.xml → library_core/src/main/res/layout/yyxx_comm_loading_dialog.xml

@@ -2,7 +2,7 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
-              android:background="@mipmap/hnyy_ic_loading_bg"
+              android:background="@mipmap/yyxx_comm_loading_bg"
               android:gravity="center"
               android:orientation="vertical"
               android:padding="16.0dip" >
@@ -10,7 +10,7 @@
     <ProgressBar
             android:layout_width="30.0dip"
             android:layout_height="30.0dip"
-            android:indeterminateDrawable="@drawable/hnyy_progress_drawable_white" />
+            android:indeterminateDrawable="@drawable/yyxx_comm_progress_drawable_white" />
 
     <TextView
             android:id="@+id/id_tv_loadingmsg"

+ 0 - 0
library_platform/src/main/res/mipmap-hdpi/hnyy_ic_loading_bg.9.png → library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_bg.9.png


+ 0 - 0
library_platform/src/main/res/mipmap-hdpi/hnyy_ic_loading_white_01.png → library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_01.png


+ 0 - 0
library_platform/src/main/res/mipmap-hdpi/hnyy_ic_loading_white_02.png → library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_02.png


+ 0 - 0
library_platform/src/main/res/mipmap-hdpi/hnyy_ic_loading_white_03.png → library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_03.png


+ 0 - 0
library_platform/src/main/res/mipmap-hdpi/hnyy_ic_loading_white_04.png → library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_04.png


+ 0 - 0
library_platform/src/main/res/mipmap-hdpi/hnyy_ic_loading_white_05.png → library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_05.png


+ 0 - 0
library_platform/src/main/res/mipmap-hdpi/hnyy_ic_loading_white_06.png → library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_06.png


+ 0 - 0
library_platform/src/main/res/mipmap-hdpi/hnyy_ic_loading_white_07.png → library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_07.png


+ 0 - 0
library_platform/src/main/res/mipmap-hdpi/hnyy_ic_loading_white_08.png → library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_08.png


+ 0 - 0
library_platform/src/main/res/mipmap-hdpi/hnyy_ic_loading_white_09.png → library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_09.png


+ 0 - 0
library_platform/src/main/res/mipmap-hdpi/hnyy_ic_loading_white_10.png → library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_10.png


+ 0 - 0
library_platform/src/main/res/mipmap-hdpi/hnyy_ic_loading_white_11.png → library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_11.png


+ 0 - 0
library_platform/src/main/res/mipmap-hdpi/hnyy_ic_loading_white_12.png → library_core/src/main/res/mipmap-hdpi/yyxx_comm_loading_white_12.png


+ 2 - 0
library_core/src/main/res/values/yyxx_comm_strings.xml

@@ -1,12 +1,14 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
 
+
     <string name="yyxx_comm_disagreement">不同意</string>
     <string name="yyxx_comm_agreement">同意</string>
     <string name="yyxx_comm_title_tip">温馨提示</string>
     <string name="yyxx_comm_confirm">确定</string>
     <string name="yyxx_comm_network_error_tip">网络出错,请检查网络</string>
     <string name="yyxx_comm_params_error_tip">参数异常,请检查yyxx_cfg.properties中的YYXX_GAME_CODE值</string>
+    <string name="yyxx_comm_initing">正在初始化...</string>
     <string name="yyxx_comm_init_success">初始化成功</string>
     <string name="yyxx_comm_init_fail">初始化失败</string>
 </resources>

+ 11 - 0
library_core/src/main/res/values/yyxx_comm_styles.xml

@@ -27,4 +27,15 @@
     <!-- 模糊 -->
     </style>
 
+
+    <style name="yyxx_comm_loading_dialog" parent="@android:style/Theme.Dialog">
+        <item name="android:windowFrame">@null</item>
+        <item name="android:windowIsFloating">true</item>
+        <item name="android:windowIsTranslucent">true</item>
+        <item name="android:windowNoTitle">true</item>
+        <item name="android:background">@null</item>
+        <item name="android:windowBackground">@null</item>
+        <item name="android:backgroundDimEnabled">false</item>
+    </style>
+
 </resources>

+ 2 - 1
library_platform/build.gradle

@@ -42,10 +42,11 @@ dependencies {
 
     compileOnly project(':library_base')
 
-    compileOnly project(':library_channel')
 
     compileOnly project(':library_core')
 
+
+
 }
 
 //apply from: 'buildJar.gradle'

+ 1 - 0
library_platform/platform_hnyy/.gitignore

@@ -0,0 +1 @@
+/build

+ 38 - 0
library_platform/platform_hnyy/build.gradle

@@ -0,0 +1,38 @@
+plugins {
+    id 'com.android.library'
+}
+
+android {
+    compileSdk 31
+
+    defaultConfig {
+        minSdk 21
+        targetSdk 31
+
+         consumerProguardFiles "consumer-rules.pro"
+    }
+
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+        }
+    }
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_7
+        targetCompatibility JavaVersion.VERSION_1_7
+    }
+}
+
+dependencies {
+
+
+    compileOnly project(':library_base')
+
+
+    compileOnly project(':library_core')
+
+    compileOnly project(':library_platform')
+
+
+}

+ 0 - 0
library_platform/platform_hnyy/consumer-rules.pro


+ 21 - 0
library_platform/platform_hnyy/proguard-rules.pro

@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile

+ 14 - 0
library_platform/platform_hnyy/src/main/AndroidManifest.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="cn.yyxx.commsdk.platform_hnyy">
+    <application>
+        <activity
+            android:name="cn.yyxx.commsdk.platform.hnyy.HNYYLoginActivity"
+            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
+            android:imeOptions="flagNoFullscreen|flagNoExtractUi"
+            android:launchMode="singleTask"
+            android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
+            android:windowSoftInputMode="adjustResize|stateHidden|stateVisible" />
+    </application>
+
+</manifest>

+ 139 - 0
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/SdkPlatformBridge.java

@@ -0,0 +1,139 @@
+package cn.yyxx.commsdk.platform;
+
+import android.app.Activity;
+import android.app.Application;
+import android.content.Context;
+import android.content.Intent;
+import android.content.res.Configuration;
+import android.os.Bundle;
+
+
+import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
+import cn.yyxx.commsdk.base.entity.bean.InitBean;
+import cn.yyxx.commsdk.base.internal.ICallback;
+import cn.yyxx.commsdk.base.internal.feature.IApplication;
+import cn.yyxx.commsdk.base.internal.feature.IFeature;
+import cn.yyxx.commsdk.base.internal.feature.ILifeCycle;
+import cn.yyxx.commsdk.platform.hnyy.impl.SdkPlatformImpl;
+
+public class SdkPlatformBridge implements IFeature, ILifeCycle, IApplication {
+
+    private SdkPlatformImpl impl = null;
+
+    public SdkPlatformBridge(Context context) {
+        if (null == impl) {
+            impl = new SdkPlatformImpl(context);
+        }
+    }
+
+
+
+
+    @Override
+    public void attachBaseContext(Application application, Context context) {
+        impl.attachBaseContext(application,context);
+    }
+
+    @Override
+    public void initApplication(Application application) {
+        impl.initApplication(application);
+
+    }
+
+    @Override
+    public void initialize(Activity activity, ICallback callback) {
+        impl.initialize(activity,callback);
+    }
+
+    @Override
+    public void initializeSuccess() {
+        impl.initializeSuccess();
+    }
+
+    @Override
+    public void setLogoutListener(Activity activity, ICallback callback) {
+        impl.setLogoutListener(activity,callback);
+    }
+
+    @Override
+    public void login(final Activity activity, InitBean initBean, final ICallback callback) {
+        impl.login(activity,initBean,callback);
+    }
+
+    @Override
+    public void logout() {
+        impl.logout();
+    }
+
+    @Override
+    public void charge(Activity activity, SdkChargeInfo chargeInfo, ICallback callback) {
+        impl.charge(activity,chargeInfo,callback);
+    }
+
+    @Override
+    public boolean hasExitView(Activity activity) {
+        return impl.hasExitView(activity);
+    }
+
+    @Override
+    public void openExitView(Activity activity,ICallback callback) {
+        impl.openExitView(activity,callback);
+    }
+
+
+    @Override
+    public void onStart(Activity activity) {
+        impl.onStart(activity);
+    }
+
+    @Override
+    public void onResume(Activity activity) {
+        impl.onResume(activity);
+    }
+
+    @Override
+    public void onReStart(Activity activity) {
+        impl.onResume(activity);
+    }
+
+    @Override
+    public void onPause(Activity activity) {
+        impl.onPause(activity);
+    }
+
+    @Override
+    public void onStop(Activity activity) {
+        impl.onStop(activity);
+    }
+
+    @Override
+    public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
+        impl.onActivityResult(activity,requestCode,resultCode,data);
+    }
+
+    @Override
+    public void onNewIntent(Activity activity, Intent intent) {
+        impl.onNewIntent(activity,intent);
+    }
+
+    @Override
+    public void onConfigurationChanged(Activity activity, Configuration newconfig) {
+        impl.onConfigurationChanged(activity,newconfig);
+    }
+
+    @Override
+    public void onWindowFocusChanged(Activity activity, boolean hasFocus) {
+        impl.onWindowFocusChanged(activity,hasFocus);
+    }
+
+    @Override
+    public void onDestroy(Activity activity) {
+        impl.onDestroy(activity);
+
+    }
+
+    @Override
+    public void onCreate(Activity activity, Bundle savedInstanceState) {
+        impl.onCreate(activity,savedInstanceState);
+    }
+}

+ 16 - 5
library_platform/src/main/java/cn/yyxx/commsdk/platform/BaseLoginActivity.java → library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/BaseLoginActivity.java

@@ -1,7 +1,9 @@
-package cn.yyxx.commsdk.platform;
+package cn.yyxx.commsdk.platform.hnyy;
 
 import android.content.Context;
 import android.os.Build;
+import android.os.Bundle;
+
 import android.support.v4.app.Fragment;
 import android.support.v4.app.FragmentActivity;
 import android.support.v4.app.FragmentTransaction;
@@ -12,7 +14,7 @@ import android.widget.EditText;
 
 import java.util.LinkedList;
 
-//import cn.yyxx.support.ResUtils;
+
 
 /**
  * @author #Suyghur.
@@ -24,11 +26,13 @@ public class BaseLoginActivity extends FragmentActivity {
     protected String currentFragmentTag = "";
     protected int containerId = 0;
 
-    public void switchFragment(String tag) {
+
+    public void switchFragment(String tag, Bundle bundle) {
 
     }
 
-    public void switchFragment(Fragment fragment, String tag) {
+    public void switchFragment(Fragment fragment, String tag, Bundle bundle) {
+
         if (fragmentStack == null) {
             return;
         }
@@ -42,8 +46,13 @@ public class BaseLoginActivity extends FragmentActivity {
             fragmentStack.add(tag);
         }
 
+
+        if (bundle !=null ){
+            fragment.setArguments(bundle);
+        }
+
         FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
-//        transaction.setCustomAnimations(ResUtils.getResId(this, "qs_core_fragment_push_anim", "anim"), ResUtils.getResId(this, "qs_core_fragment_popup_anim", "anim"));
+
         Fragment tagFragment = getSupportFragmentManager().findFragmentByTag(currentFragmentTag);
         if (tagFragment != null && !tag.equals(currentFragmentTag)) {
             tagFragment.onPause();
@@ -56,6 +65,8 @@ public class BaseLoginActivity extends FragmentActivity {
             tagFragment.onResume();
             transaction.show(tagFragment);
         }
+
+
         currentFragmentTag = tag;
         transaction.commitAllowingStateLoss();
     }

+ 169 - 0
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/HNYYLoginActivity.java

@@ -0,0 +1,169 @@
+package cn.yyxx.commsdk.platform.hnyy;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.os.Build;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+
+import cn.yyxx.commsdk.base.internal.ICallback;
+
+import cn.yyxx.commsdk.platform.LoginViewModel;
+import cn.yyxx.commsdk.platform.hnyy.dialog.AutoLoginDialog;
+import cn.yyxx.commsdk.platform.hnyy.floating.FloatViewManager;
+import cn.yyxx.commsdk.platform.hnyy.fragment.UserAccountLoginFragment;
+import cn.yyxx.commsdk.platform.hnyy.fragment.UserPhoneLoginFragment;
+import cn.yyxx.commsdk.platform.hnyy.fragment.UserPhoneLoginSetpwdFragment;
+import cn.yyxx.commsdk.platform.hnyy.fragment.UserRegisterFragment;
+import cn.yyxx.commsdk.platform.hnyy.fragment.UserRetrievePwdFragment;
+import cn.yyxx.commsdk.platform.hnyy.fragment.UserSwitchAccountLoginFragment;
+import cn.yyxx.commsdk.platform.hnyy.impl.SdkPlatformImpl;
+import cn.yyxx.commsdk.platform.user.UserSessionManager;
+import cn.yyxx.support.AndroidBug5497Workaround;
+import cn.yyxx.support.AppUtils;
+import cn.yyxx.support.ResUtils;
+
+public class HNYYLoginActivity extends BaseLoginActivity {
+
+
+
+
+    private UserAccountLoginFragment userAccountLoginFragment;
+    private UserPhoneLoginFragment userPhoneLoginFragment;
+    private UserPhoneLoginSetpwdFragment userPhoneLoginSetpwdFragment;
+    private UserRegisterFragment userRegisterFragment;
+    private UserRetrievePwdFragment userRetrievePwdFragment;
+    private UserSwitchAccountLoginFragment userSwitchAccountLoginFragment;
+
+    public static LoginViewModel loginViewModel;
+
+    @Override
+    protected void onCreate(@Nullable final Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
+            Window window = getWindow();
+            window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
+            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
+
+
+            WindowManager.LayoutParams lp = getWindow().getAttributes();
+            lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
+            getWindow().setAttributes(lp);
+        }
+        containerId = ResUtils.getResId(this, "hnyy_login_container", "id");
+        initView(this);
+        if (UserSessionManager.getInstance().getLocalLastSession() != null){
+            autoLogin(this);
+        }else{
+            if (SdkPlatformImpl.initConfig.isShowPhoneRegFrist){
+                switchFragment(HNYYLoginFragmentTag.PAGE_PHONE_LOGIN,null);
+            }else{
+                switchFragment(HNYYLoginFragmentTag.PAGE_ACCOUNT_REGISTER,null);
+            }
+        }
+
+    }
+
+    public static void start(Activity activity, ICallback callback) {
+        loginViewModel = new LoginViewModel(callback);
+        activity.startActivity(new Intent(activity, HNYYLoginActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
+    }
+
+    private void initView(Context context){
+        if (AppUtils.isLandscape(context)) {
+            getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
+        }
+        setContentView(ResUtils.getResId(this, "hnyy_login", "layout"));
+
+        if (!AppUtils.isLandscape(context)) {
+            AndroidBug5497Workaround.assistActivity(this);
+        }
+
+
+    }
+
+    @Override
+    public void switchFragment(final String tag,Bundle bundle) {
+        super.switchFragment(tag,bundle);
+       switch (tag){
+           case HNYYLoginFragmentTag.PAGE_ACCOUNT_LOGIN:
+               if (userAccountLoginFragment == null){
+                   userAccountLoginFragment = new UserAccountLoginFragment();
+               }
+               switchFragment(userAccountLoginFragment,tag,bundle);
+               break;
+           case HNYYLoginFragmentTag.PAGE_PHONE_LOGIN:
+               if (userPhoneLoginFragment == null){
+                   userPhoneLoginFragment = new UserPhoneLoginFragment();
+               }
+
+               switchFragment(userPhoneLoginFragment,tag,bundle);
+               break;
+           case HNYYLoginFragmentTag.PAGE_POHONE_SET_PASSWORD:
+               if (userPhoneLoginSetpwdFragment == null){
+                   userPhoneLoginSetpwdFragment = new UserPhoneLoginSetpwdFragment();
+               }
+
+               switchFragment(userPhoneLoginSetpwdFragment,tag,bundle);
+               break;
+           case HNYYLoginFragmentTag.PAGE_ACCOUNT_REGISTER:
+               if (userRegisterFragment == null){
+                   userRegisterFragment = new UserRegisterFragment();
+               }
+               switchFragment(userRegisterFragment,tag,bundle);
+               break;
+           case HNYYLoginFragmentTag.PAGE_RETRIEVE_PASSWORD:
+               if (userRetrievePwdFragment == null){
+                   userRetrievePwdFragment = new UserRetrievePwdFragment();
+               }
+               switchFragment(userRetrievePwdFragment,tag,bundle);
+               break;
+           case HNYYLoginFragmentTag.PAGE_SWITCH_ACCOUNT_LOGIN:
+               if (userSwitchAccountLoginFragment == null){
+                   userSwitchAccountLoginFragment = new UserSwitchAccountLoginFragment();
+               }
+               switchFragment(userSwitchAccountLoginFragment,tag,bundle);
+               break;
+
+       }
+    }
+
+    private void autoLogin(final Activity activity) {
+        AutoLoginDialog.Builder builder = new AutoLoginDialog.Builder(activity,loginViewModel);
+        builder.setPositiveButton(new DialogInterface.OnClickListener() {
+            @Override
+            public void onClick(DialogInterface dialog, int which) {
+                //取消回调
+                dialog.dismiss();
+
+                switchFragment(HNYYLoginFragmentTag.PAGE_SWITCH_ACCOUNT_LOGIN,null);
+
+
+            }
+        }).setCloseDialogCallback(new AutoLoginDialog.CloseDialogCallback() {
+
+
+            @Override
+            public void onLoginSuccess() {
+                if (!isFinishing()) {
+                     finish();
+                    SdkPlatformImpl.getInstance(activity).showFloat();
+                }
+            }
+            @Override
+            public void onLoginFail() {
+                switchFragment(HNYYLoginFragmentTag.PAGE_SWITCH_ACCOUNT_LOGIN,null);
+            }
+        });
+
+        builder.Create().show();
+    }
+
+}

+ 0 - 0
library_platform/src/main/java/cn/yyxx/commsdk/platform/hnyy/HNYYLoginFragmentTag.java → library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/HNYYLoginFragmentTag.java


+ 5 - 0
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/action/IJsCallback.java

@@ -0,0 +1,5 @@
+package cn.yyxx.commsdk.platform.hnyy.action;
+
+public interface IJsCallback {
+
+}

+ 62 - 0
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/action/PageJsInteraction.java

@@ -0,0 +1,62 @@
+package cn.yyxx.commsdk.platform.hnyy.action;
+
+
+import android.webkit.JavascriptInterface;
+
+import cn.yyxx.commsdk.platform.hnyy.dialog.JsBaseDialog;
+
+
+public class PageJsInteraction {
+
+    private JsBaseDialog baseDialog;
+    public PageJsInteraction(JsBaseDialog baseDialog) {
+
+        this.baseDialog =baseDialog;
+
+    }
+
+
+
+    @JavascriptInterface
+    public void zfColse() {   //提供给js调用的方法
+        this.baseDialog.zfColse();
+    }
+
+
+    @JavascriptInterface
+    public void showJsMsg(String message) {
+        this.baseDialog.showJsMsg(message);
+    }
+    @JavascriptInterface
+    public void modifyPwd(String message) {   //提供给js调用的方法
+
+        this.baseDialog.modifyPwd(message);
+
+    }
+
+
+    @JavascriptInterface
+    public void zfOrder(String message) {
+        this.baseDialog.zfOrder(message);
+    }
+
+    @JavascriptInterface
+    public void openq0q0(String url)  {
+        this.baseDialog.openq0q0(url);
+    }
+
+    @JavascriptInterface
+    public String webExt() {
+        return this.baseDialog.webExt();
+    }
+
+    @JavascriptInterface
+    public void switchAccount() {
+         this.baseDialog.switchAccount();
+    }
+
+    @JavascriptInterface
+    public void realNameResult(String json){
+        this.baseDialog.realNameResult(json);
+    }
+}

+ 91 - 0
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/adapter/UserListAdapter.java

@@ -0,0 +1,91 @@
+package cn.yyxx.commsdk.platform.hnyy.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import java.util.ArrayList;
+
+import cn.yyxx.commsdk.core.utils.ResourceUtil;
+import cn.yyxx.commsdk.platform.user.UserSession;
+import cn.yyxx.commsdk.platform.user.UserSessionManager;
+
+
+public class UserListAdapter extends BaseAdapter {
+	private Context context;
+	public ArrayList<UserSession> list;
+	private LayoutInflater mInflater = null;
+
+
+
+	public UserListAdapter(Context context, ArrayList<UserSession> list) {
+		this.context = context;
+		this.list = list;
+		this.mInflater = LayoutInflater.from(context);
+
+	}
+
+	@Override
+	public int getCount() {
+		// TODO Auto-generated method stub
+		return list.size();
+	}
+
+	@Override
+	public Object getItem(int position) {
+		// TODO Auto-generated method stub
+		return position;
+	}
+
+	@Override
+	public long getItemId(int position) {
+		// TODO Auto-generated method stub
+		return position;
+	}
+
+	@Override
+	public View getView(final int position, View convertView, ViewGroup parent) {
+		// TODO Auto-generated method stub
+		ViewHolder holder = null;
+		if (convertView == null) {
+			convertView = mInflater.inflate(ResourceUtil.getLayoutId(context, "hnyy_user_list_item"), parent,false);
+			holder = new ViewHolder();
+
+			holder.accountName = convertView
+					.findViewById(ResourceUtil.getId(context, "history_account"));
+			holder.closeItem =  convertView
+					.findViewById(ResourceUtil.getId(context, "item_close"));
+			
+			holder.closeItem.setOnClickListener(new OnClickListener() {
+				
+				@Override
+				public void onClick(View v) {
+					// TODO Auto-generated method stub
+					deleteItem(position);
+				}
+			});
+			
+			convertView.setTag(holder);
+		} else {
+			holder = (ViewHolder) convertView.getTag();
+
+		}
+		holder.accountName.setText(list.get(position).uname);
+		return convertView;
+	}
+
+	class ViewHolder {
+		TextView accountName;
+		ImageView closeItem;
+
+	}
+	private void deleteItem(int position){
+		UserSessionManager.getInstance().removeSession(list.get(position).uname);
+	}
+
+}

+ 161 - 0
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/dialog/AutoLoginDialog.java

@@ -0,0 +1,161 @@
+package cn.yyxx.commsdk.platform.hnyy.dialog;
+
+import android.app.Activity;
+import android.app.Dialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.os.Looper;
+import android.util.TypedValue;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.view.WindowManager;
+import android.widget.TextView;
+
+import java.util.Timer;
+import java.util.TimerTask;
+
+import cn.yyxx.commsdk.base.entity.ResultInfo;
+import cn.yyxx.commsdk.base.internal.ICallback;
+import cn.yyxx.commsdk.core.utils.ResourceUtil;
+import cn.yyxx.commsdk.platform.LoginViewModel;
+import cn.yyxx.commsdk.platform.user.UserSession;
+import cn.yyxx.commsdk.platform.user.UserSessionManager;
+
+
+public class AutoLoginDialog extends Dialog {
+
+
+    private static TextView hnyy_auto_login_account_text, hnyy_auto_login_cancel_text;
+    private static AutoLoginDialog dialog;
+    private static Timer timer;
+
+    public AutoLoginDialog(Context context, int theme) {
+        super(context, theme);
+
+    }
+
+    public static class Builder {
+        private Context context;
+        private OnClickListener positiveButtonClickListener;
+        private CloseDialogCallback closeDialogCallback;
+
+        private LoginViewModel loginViewModel;
+
+        private UserSession lastUserSession;
+
+        public Builder(Context context, LoginViewModel loginViewModel) {
+            this.context = context;
+            this.loginViewModel = loginViewModel;
+        }
+
+        public Builder setPositiveButton(OnClickListener listener) {
+            this.positiveButtonClickListener = listener;
+            return this;
+        }
+
+        public Builder setCloseDialogCallback(CloseDialogCallback closeDialogCallback) {
+            this.closeDialogCallback = closeDialogCallback;
+            return this;
+        }
+
+
+        public void dialogDismiss() {
+            if (timer != null) {
+                timer.cancel();
+            }
+
+            dialog.dismiss();
+        }
+
+        public AutoLoginDialog Create() {
+            {
+                LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+                dialog = new AutoLoginDialog(context, ResourceUtil.getStyleId(context, "hnyy_auto_login_dialog"));
+                View layout = inflater.inflate(ResourceUtil.getLayoutId(context, "hnyy_quick_login_bar"), null);
+                ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+                Window window = dialog.getWindow();
+                window.setGravity(Gravity.TOP);
+                WindowManager.LayoutParams lp = window.getAttributes();
+
+                lp.y = dp2Px(50, context);  //设置出现的高度,距离顶部
+                window.setAttributes(lp);
+
+                dialog.addContentView(layout, layoutParams);
+
+                hnyy_auto_login_cancel_text = dialog.findViewById(ResourceUtil.getId(context,
+                        "hnyy_auto_login_cancel_text"));
+                hnyy_auto_login_account_text = dialog.findViewById(ResourceUtil.getId(context,
+                        "hnyy_auto_login_account_text"));
+
+
+                if (hnyy_auto_login_cancel_text != null) {
+                    hnyy_auto_login_cancel_text.setOnClickListener(new View.OnClickListener() {
+                        @Override
+                        public void onClick(View view) {
+                            if (timer != null) {
+                                timer.cancel();
+                            }
+
+                            timer = null;
+                            positiveButtonClickListener.onClick(dialog, DialogInterface.BUTTON_POSITIVE);
+                        }
+                    });
+                }
+
+                String hnyy_enter_game_tip = context.getString(ResourceUtil.getStringId(context, "hnyy_enter_game_tip"));
+                lastUserSession = UserSessionManager.getInstance().getLocalLastSession();
+                String autoTip = lastUserSession.uname + hnyy_enter_game_tip;
+
+                hnyy_auto_login_account_text.setText(autoTip);
+                dialog.setCancelable(false);
+                timer = new Timer();
+                timer.schedule(task, 2000);
+                return dialog;
+            }
+        }
+
+        TimerTask task = new TimerTask() {
+
+            @Override
+            public void run() {
+                Looper.prepare();
+
+                dialogDismiss();
+
+                loginViewModel.accountLogin((Activity) context, lastUserSession.uname, lastUserSession.password, lastUserSession.login_token, new ICallback() {
+                    @Override
+                    public void onResult(int code, String result) {
+                        if (code == ResultInfo.CODE_SUCCESS){
+                            closeDialogCallback.onLoginSuccess();
+                        }else {
+                            closeDialogCallback.onLoginFail();
+
+                        }
+
+                    }
+                });
+
+                Looper.loop();
+            }
+
+        };
+
+
+    }
+
+    public interface CloseDialogCallback {
+        void onLoginSuccess();
+
+        void onLoginFail();
+    }
+
+    public static int dp2Px(float dp, Context mContext) {
+        return (int) TypedValue.applyDimension(
+                TypedValue.COMPLEX_UNIT_DIP,
+                dp,
+                mContext.getResources().getDisplayMetrics());
+    }
+}

+ 93 - 0
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/dialog/CustomExitGameDialog.java

@@ -0,0 +1,93 @@
+package cn.yyxx.commsdk.platform.hnyy.dialog;
+
+
+import android.app.Dialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import cn.yyxx.commsdk.core.utils.ResourceUtil;
+import cn.yyxx.support.AppUtils;
+
+
+public class CustomExitGameDialog extends Dialog {
+
+	private	static Button bt_exit_game;
+	private static Button bt_goon_game;
+	private static TextView hnyy_issure_exit;
+	private static CustomExitGameDialog dialog;
+
+	public CustomExitGameDialog(Context context, int theme) {
+		super(context, theme);
+
+	}
+	public  static class  Builder{
+		private Context context;
+		private OnClickListener positiveButtonClickListener;
+		private OnClickListener negativeButtonClickListener;
+		public Builder(Context context){ this.context = context;}
+		public Builder setPositiveButton(OnClickListener listener){
+			this.positiveButtonClickListener = listener;
+			return this;
+		}
+		public Builder setnegativeButton(OnClickListener listener){
+			this.negativeButtonClickListener = listener;
+			return this;
+		}
+		public void setTitle(String title){
+			hnyy_issure_exit.setText(title);
+		}
+		public void  dialogDismiss(){dialog.dismiss();}
+		public CustomExitGameDialog Create(){
+			{
+				LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+				dialog = new CustomExitGameDialog(context, ResourceUtil.getStyleId(context,"hnyy_base_dialog"));
+
+
+				View layout =  inflater.inflate(ResourceUtil.getLayoutId(context, "hnyy_exit_game_dialog"),null);
+
+
+				if (!AppUtils.isLandscape(context)){
+					LinearLayout ll_exit_game = layout.findViewById(ResourceUtil.getId(context, "ll_exit_game"));
+					ll_exit_game.setScaleX(0.9f);
+					ll_exit_game.setScaleY(0.9f);
+				}
+
+				dialog.addContentView(layout,new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
+
+				bt_exit_game =(Button) dialog.findViewById(ResourceUtil.getId(context,
+						"find_pwd_confirm_btn"));
+				bt_goon_game = (Button) dialog.findViewById(ResourceUtil.getId(context,
+						"find_pwd_cancel_btn"));
+				if (bt_exit_game!=null){
+					bt_exit_game.setOnClickListener(new View.OnClickListener() {
+						@Override
+						public void onClick(View view) {
+							positiveButtonClickListener.onClick(dialog,DialogInterface.BUTTON_POSITIVE);
+						}
+					});
+				}
+				if (bt_goon_game!=null){
+					bt_goon_game.setOnClickListener(new View.OnClickListener() {
+						@Override
+						public void onClick(View view) {
+							negativeButtonClickListener.onClick(dialog,DialogInterface.BUTTON_NEGATIVE);
+						}
+					});
+				}
+				hnyy_issure_exit = dialog.findViewById(ResourceUtil.getId(context,
+						"hnyy_issure_exit"));
+				return dialog;
+			}
+		}
+
+
+	}
+
+
+}

+ 90 - 0
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/dialog/JsBaseDialog.java

@@ -0,0 +1,90 @@
+package cn.yyxx.commsdk.platform.hnyy.dialog;
+
+
+import android.app.Dialog;
+import android.content.Context;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import cn.yyxx.commsdk.Version;
+import cn.yyxx.commsdk.base.utils.Logger;
+import cn.yyxx.support.AppUtils;
+
+
+public class JsBaseDialog extends Dialog {
+
+
+    public JsBaseDialog(@NonNull Context context) {
+        super(context);
+    }
+
+    public JsBaseDialog(@NonNull Context context, int themeResId) {
+        super(context, themeResId);
+    }
+
+    protected JsBaseDialog(@NonNull Context context, boolean cancelable, @Nullable OnCancelListener cancelListener) {
+        super(context, cancelable, cancelListener);
+    }
+
+    public void zfColse() {   //提供给js调用的方法
+        Logger.i("zfColse");
+    }
+
+
+
+    public void showJsMsg(String message) {
+        Logger.i("showJsMsg:" + message);
+    }
+
+    public void modifyPwd(String message) {
+        Logger.i("modifyPwd:" + message);
+    }
+
+    public void zfOrder(String message) {   //提供给js调用的方法
+        Logger.i("zfOrder:" + message);
+    }
+
+    public void openq0q0(String url)  {
+
+        Logger.i("openq0q0:" + url);
+
+    }
+    public void switchAccount()  {
+
+        Logger.i("switchAccount");
+
+    }
+
+    public String webExt(){
+
+        JSONObject json = new JSONObject();
+
+
+        try {
+            if (AppUtils.isLandscape(getContext())){
+
+                json.put("orientation","landscape");
+
+            }else{
+
+                json.put("orientation","portrait");
+
+            }
+
+            json.put("version", Version.VERSION_NAME);
+
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+
+        Logger.i("webExt : " + json.toString());
+        return json.toString();
+    }
+
+    public void realNameResult(String json){
+        Logger.i("realNameResult:"+ json);
+    }
+}

+ 259 - 0
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/dialog/UserCenterDialog.java

@@ -0,0 +1,259 @@
+package cn.yyxx.commsdk.platform.hnyy.dialog;
+
+
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.View;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
+import android.webkit.DownloadListener;
+import android.webkit.WebSettings;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
+import android.widget.ImageView;
+
+
+
+import java.net.URISyntaxException;
+
+import cn.yyxx.commsdk.core.utils.ResourceUtil;
+import cn.yyxx.commsdk.platform.hnyy.action.PageJsInteraction;
+import cn.yyxx.commsdk.platform.hnyy.fragment.widget.TosUtil;
+import cn.yyxx.support.AppUtils;
+
+
+public class UserCenterDialog extends JsBaseDialog {
+
+
+    private ImageView close_btn,loading;
+    private Context context;
+    private WebView webView;
+    private WebSettings webSettings;
+
+    private String url;
+    public OnClosePageListener listener;
+
+    public UserCenterDialog(Context context) {
+        super(context);
+        this.context = context;
+    }
+
+
+    public UserCenterDialog(Context context, int theme, String url) {
+        super(context, theme);
+        this.context = context;
+
+        this.url = url;
+
+    }
+
+    public UserCenterDialog(Context context, int theme, String url, OnClosePageListener listener) {
+        super(context, theme);
+        this.context = context;
+
+        this.url = url;
+        this.listener = listener;
+    }
+    public UserCenterDialog(Context context, int theme, String url, OnClosePageListener listener, boolean isHiddenClose) {
+        super(context, theme);
+        this.context = context;
+
+        this.url = url;
+        this.listener = listener;
+
+    }
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        if (!AppUtils.isLandscape(context)){
+            setContentView(ResourceUtil.getLayoutId(context,
+                    "hnyy_usercenter_portait_dialog"));
+            getWindow().getAttributes().gravity = Gravity.CENTER;
+        }else{
+            setContentView(ResourceUtil.getLayoutId(context,
+                    "hnyy_usercenter_dialog"));
+            getWindow().getAttributes().gravity = Gravity.LEFT;
+        }
+
+
+        setCancelable(false);
+        webView = findViewById(ResourceUtil.getId(context,
+                "wb_user_info"));
+
+        close_btn = findViewById(ResourceUtil.getId(context,
+                "close_btn"));
+
+
+
+        close_btn.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+
+                if (listener != null){
+                    listener.onClose();
+                }
+
+                webView.destroy();
+                dismiss();
+
+            }
+        });
+
+        loading = findViewById(ResourceUtil.getId(context, "hnyy_loading"));
+        Animation rotateAnimation = AnimationUtils.loadAnimation(context, ResourceUtil.getAnimId(context, "hnyy_rotate_anim"));
+        loading.startAnimation(rotateAnimation);
+
+        webSettings = webView.getSettings();
+        webSettings.setAllowFileAccess(true);
+        webSettings.setJavaScriptEnabled(true);
+        webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
+        webSettings.setBuiltInZoomControls(false);// 设置支持缩放
+        webSettings.setDomStorageEnabled(true);
+        webView.setHorizontalScrollBarEnabled(false);//水平不显示
+        webView.setVerticalScrollBarEnabled(false); //垂直不显示
+
+
+        webView.addJavascriptInterface(new PageJsInteraction(this), "yyrhsdk");
+        webView.setWebViewClient(new WebViewClient(){
+            @Override
+            public void onPageFinished(WebView view, String url) {
+                super.onPageFinished(view, url);
+                loading.clearAnimation();
+                loading.setVisibility(View.GONE);
+            }
+
+            @Override
+            public boolean shouldOverrideUrlLoading(WebView view, String url) {
+
+
+
+
+                if (url.startsWith("http:") || url.startsWith("https")) {
+                    return super.shouldOverrideUrlLoading(view, url);
+                } else if (url.startsWith("mqqwpa://")) {
+
+                    Intent intent = null;
+                    try {
+                        intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME);
+                        context.startActivity(intent);
+                    } catch (URISyntaxException e) {
+                        e.printStackTrace();
+                    }
+
+                    webView.goBack();
+                    return true;
+
+                }else{
+                    return true;
+                }
+            }
+
+        });
+
+        webView.setDownloadListener(new DownloadListener() {
+            @Override
+            public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
+                Uri uri = Uri.parse(url);
+                Intent intent = new Intent(Intent.ACTION_VIEW, uri);
+                context.startActivity(intent);
+            }
+        });
+
+
+        webView.setBackgroundColor(0);
+        webView.getBackground().setAlpha(0);
+
+
+        webView.loadUrl(url);
+    }
+
+
+
+
+    public interface OnClosePageListener {
+         void onClose();
+         void onDissmiss();
+         void onRealNameSuccess(String birthday);
+    }
+
+
+
+    @Override
+    public void zfColse() {
+        super.zfColse();
+        if (listener != null){
+            listener.onClose();
+        }
+        dismiss();
+    }
+
+
+    @Override
+    public void modifyPwd(String message) {
+        super.modifyPwd(message);
+     }
+
+    @Override
+    public void showJsMsg(String message) {
+        super.showJsMsg(message);
+        new TosUtil(context,TosUtil.TOAST_ERROR,  message).show();
+    }
+
+
+
+
+    @Override
+    public void openq0q0(String url) {
+        super.openq0q0(url);
+
+        {
+            Log.i("openq0q0", url);
+
+            if (TextUtils.isEmpty(url)) {
+                return;
+            }
+            if (url.equals("mqqwpa://")) {
+                try {
+
+                    Intent intent = context.getPackageManager().getLaunchIntentForPackage("com.tencent.mobileqq");
+                    context.startActivity(intent);
+
+                } catch (Exception e) {
+                    e.printStackTrace();
+
+                }
+            } else {
+                Intent intent = null;
+                try {
+                    intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME);
+                    context.startActivity(intent);
+                } catch (URISyntaxException e) {
+                    e.printStackTrace();
+                }
+
+            }
+
+
+        }
+    }
+
+    @Override
+    public void switchAccount() {
+        super.switchAccount();
+        dismiss();
+
+    }
+
+
+
+    @Override
+    public void dismiss() {
+        super.dismiss();
+    }
+}

+ 277 - 0
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/dialog/WvPageListDialog.java

@@ -0,0 +1,277 @@
+package cn.yyxx.commsdk.platform.hnyy.dialog;
+
+
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
+import android.webkit.DownloadListener;
+import android.webkit.WebSettings;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+
+import java.net.URISyntaxException;
+
+import cn.yyxx.commsdk.core.utils.ResourceUtil;
+import cn.yyxx.commsdk.platform.hnyy.action.PageJsInteraction;
+import cn.yyxx.commsdk.platform.hnyy.fragment.widget.TosUtil;
+import cn.yyxx.support.AppUtils;
+
+public class WvPageListDialog extends JsBaseDialog {
+
+
+    private ImageView close_btn,loading;
+    private Context context;
+    private WebView webView;
+    private WebSettings webSettings;
+
+    private String url;
+    public OnClosePageListener listener;
+    private boolean isHiddenClo = false;
+
+    public WvPageListDialog(Context context, int theme, String url) {
+        super(context, theme);
+        this.context = context;
+        this.url = url;
+    }
+
+    public WvPageListDialog(Context context, int theme, String url, OnClosePageListener listener) {
+        super(context, theme);
+        this.context = context;
+
+        this.url = url;
+        this.listener = listener;
+    }
+    public WvPageListDialog(Context context, int theme, String url, OnClosePageListener listener, boolean isHiddenClose) {
+        super(context, theme);
+        this.context = context;
+
+        this.url = url;
+        this.listener = listener;
+        this.isHiddenClo = isHiddenClose;
+    }
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+            setContentView(ResourceUtil.getLayoutId(context,
+                    "hnyy_webview_common_dialog"));
+
+
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
+            Window window = getWindow();
+            window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
+            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
+
+
+            WindowManager.LayoutParams lp = getWindow().getAttributes();
+            lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
+            getWindow().setAttributes(lp);
+        }
+
+
+            setCancelable(false);
+
+
+
+        if (!AppUtils.isLandscape(context)){
+
+            LinearLayout ll_webview_common = findViewById(ResourceUtil.getId(context, "ll_webview_common"));
+            ll_webview_common.setScaleX(0.9f);
+            ll_webview_common.setScaleY(0.9f);
+
+        }
+
+        webView = findViewById(ResourceUtil.getId(context,
+                "wb_user_info"));
+
+        close_btn = findViewById(ResourceUtil.getId(context,
+                "close_btn"));
+
+        loading = findViewById(ResourceUtil.getId(context, "hnyy_loading"));
+        Animation rotateAnimation = AnimationUtils.loadAnimation(context, ResourceUtil.getAnimId(context, "hnyy_rotate_anim"));
+        loading.startAnimation(rotateAnimation);
+
+        close_btn.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+
+                if (listener != null){
+                    listener.onClose();
+                }
+
+                webView.destroy();
+                dismiss();
+
+            }
+        });
+        if (isHiddenClo){
+            close_btn.setVisibility(View.GONE);
+        }
+
+        webSettings = webView.getSettings();
+        webSettings.setAllowFileAccess(true);
+        webSettings.setJavaScriptEnabled(true);
+        webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
+        webSettings.setBuiltInZoomControls(false);// 设置支持缩放
+        webSettings.setDomStorageEnabled(true);
+        webView.setHorizontalScrollBarEnabled(false);//水平不显示
+        webView.setVerticalScrollBarEnabled(false); //垂直不显示
+
+        webView.addJavascriptInterface(new PageJsInteraction(this), "yyrhsdk");
+        webView.setWebViewClient(new WebViewClient(){
+            @Override
+            public void onPageFinished(WebView view, String url) {
+                super.onPageFinished(view, url);
+                loading.clearAnimation();
+                loading.setVisibility(View.GONE);
+            }
+
+            @Override
+            public boolean shouldOverrideUrlLoading(WebView view, String url) {
+
+
+                if (url.startsWith("http:") || url.startsWith("https")) {
+                    return super.shouldOverrideUrlLoading(view, url);
+                } else if (url.startsWith("mqqwpa://")) {
+
+                    Intent intent = null;
+                    try {
+                        intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME);
+                        context.startActivity(intent);
+                    } catch (URISyntaxException e) {
+                        e.printStackTrace();
+                    }
+
+                    webView.goBack();
+                    return true;
+
+                }else{
+                    return true;
+                }
+            }
+
+        });
+
+        webView.setDownloadListener(new DownloadListener() {
+            @Override
+            public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
+                Uri uri = Uri.parse(url);
+                Intent intent = new Intent(Intent.ACTION_VIEW, uri);
+                context.startActivity(intent);
+            }
+        });
+
+
+        webView.setBackgroundColor(0);
+        webView.getBackground().setAlpha(0);
+
+        webView.loadUrl(url);
+    }
+
+
+
+
+    public interface OnClosePageListener {
+         void onClose();
+         void onDissmiss();
+         void onRealNameSuccess();
+    }
+
+
+
+    @Override
+    public void zfColse() {
+        super.zfColse();
+        if (listener != null){
+            listener.onClose();
+        }
+        dismiss();
+    }
+
+    @Override
+    public void showJsMsg(String message) {
+        super.showJsMsg(message);
+        new TosUtil(context,TosUtil.TOAST_ERROR,  message).show();
+    }
+
+
+    @Override
+    public void modifyPwd(String message) {
+        super.modifyPwd(message);
+
+
+
+    }
+
+
+    @Override
+    public void openq0q0(String url) {
+        super.openq0q0(url);
+
+
+            if (TextUtils.isEmpty(url)) {
+                return;
+            }
+
+            if (url.equals("mqqwpa://")) {
+                try {
+
+                    Intent intent = context.getPackageManager().getLaunchIntentForPackage("com.tencent.mobileqq");
+                    context.startActivity(intent);
+
+                } catch (Exception e) {
+                    e.printStackTrace();
+
+                }
+            } else {
+                Intent intent = null;
+                try {
+                    intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME);
+                    context.startActivity(intent);
+                } catch (URISyntaxException e) {
+                    e.printStackTrace();
+                }
+
+            }
+
+
+
+    }
+
+    @Override
+    public void dismiss() {
+        super.dismiss();
+
+        if (listener != null){
+            listener.onDissmiss();
+        }
+
+
+    }
+
+    @Override
+    public void realNameResult(String json) {
+        super.realNameResult(json);
+//        try {
+//
+//            SDKSettings.loginData.rn_si = new JSONObject(json).optString("si");
+//            listener.onRealNameSuccess();
+//
+//        } catch (JSONException e) {
+//            e.printStackTrace();
+//        }
+
+
+    }
+}

+ 391 - 0
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/floating/DotImageView.java

@@ -0,0 +1,391 @@
+/*
+ * Copyright (c) 2016, Shanghai YUEWEN Information Technology Co., Ltd.
+ * All rights reserved.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ *  Neither the name of Shanghai YUEWEN Information Technology Co., Ltd. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY SHANGHAI YUEWEN INFORMATION TECHNOLOGY CO., LTD. AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+package cn.yyxx.commsdk.platform.hnyy.floating;
+
+import android.animation.Animator;
+import android.animation.ValueAnimator;
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.Camera;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Matrix;
+import android.graphics.Paint;
+import android.graphics.Rect;
+import android.support.annotation.Nullable;
+import android.text.TextUtils;
+import android.util.AttributeSet;
+import android.view.View;
+import android.view.animation.LinearInterpolator;
+
+
+/**
+ * Created by wengyiming on 2017/7/21.
+ */
+
+/**
+ * 00%=FF(不透明)    5%=F2    10%=E5    15%=D8    20%=CC    25%=BF    30%=B2    35%=A5    40%=99    45%=8c    50%=7F
+ * 55%=72    60%=66    65%=59    70%=4c    75%=3F    80%=33    85%=21    90%=19    95%=0c    100%=00(全透明)
+ */
+public class DotImageView extends View {
+    private static final String TAG = DotImageView.class.getSimpleName();
+    public static final int NORMAL = 0;//不隐藏
+    public static final int HIDE_LEFT = 1;//左边隐藏
+    public static final int HIDE_RIGHT = 2;//右边隐藏
+    private Paint mPaint;//用于画anything
+
+    private Paint mPaintBg;//用于画anything
+    private String dotNum = null;//红点数字
+    private float mAlphValue;//透明度动画值
+    private float mRolateValue = 1f;//旋转动画值
+    private boolean inited = false;//标记透明动画是否执行过,防止因onreseme 切换导致重复执行
+
+
+    private Bitmap mBitmap;//logo
+    private final int mLogoBackgroundRadius = dip2px(25);//logo的灰色背景圆的半径
+    private final int mLogoWhiteRadius = dip2px(20);//logo的白色背景的圆的半径
+    private final int mRedPointRadiusWithNum = dip2px(6);//红点圆半径
+    private final int mRedPointRadius = dip2px(3);//红点圆半径
+    private final int mRedPointOffset = dip2px(10);//红点对logo的偏移量,比如左红点就是logo中心的 x - mRedPointOffset
+
+    private boolean isDraging = false;//是否 绘制旋转放大动画,只有 非停靠边缘才绘制
+    private float scaleOffset;//放大偏移值
+    private ValueAnimator mDragingValueAnimator;//放大、旋转 属性动画
+    private LinearInterpolator mLinearInterpolator = new LinearInterpolator();//通用用加速器
+    public boolean mDrawDarkBg = true;//是否绘制黑色背景,当菜单关闭时,才绘制灰色背景
+    private static final float hideOffset = 0.5f;//往左右隐藏多少宽度的偏移值, 隐藏宽度的0.4
+    private static final float hideOffsetAlpha = 0.5f;//往左右隐藏多少宽度的偏移值, 隐藏宽度的0.4
+    private Camera mCamera;//camera用于执行3D动画
+
+    private boolean mDrawNum = false;//只绘制红点还是红点+白色数字
+
+    private int mStatus = NORMAL;//0 正常,1 左,2右,3 中间方法旋转
+    private int mLastStatus = mStatus;
+    private Matrix mMatrix;
+    private boolean mIsResetPosition;
+
+    private int mBgColor = 0x99000000;
+
+
+    public void setBgColor(int bgColor) {
+        mBgColor = bgColor;
+    }
+
+
+    public void setDrawNum(boolean drawNum) {
+        this.mDrawNum = drawNum;
+    }
+
+    public void setDrawDarkBg(boolean drawDarkBg) {
+        mDrawDarkBg = drawDarkBg;
+        invalidate();
+    }
+
+    public int getStatus() {
+        return mStatus;
+    }
+
+
+    public void setStatus(int status) {
+        this.mStatus = status;
+        isDraging = false;
+        if (this.mStatus != NORMAL) {
+            setDrawNum(mDrawNum);
+            this.mDrawDarkBg = true;
+        }
+        invalidate();
+
+    }
+
+    public void setBitmap(Bitmap bitmap) {
+        mBitmap = bitmap;
+    }
+
+    public DotImageView(Context context, Bitmap bitmap) {
+        super(context);
+        this.mBitmap = bitmap;
+        init();
+    }
+
+
+    public DotImageView(Context context) {
+        super(context);
+        init();
+    }
+
+    public DotImageView(Context context, @Nullable AttributeSet attrs) {
+        super(context, attrs);
+        init();
+    }
+
+    public DotImageView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+        init();
+    }
+
+    private void init() {
+        mPaint = new Paint();
+        mPaint.setAntiAlias(true);
+        mPaint.setTextSize(sp2px(10));
+        mPaint.setStyle(Paint.Style.FILL);
+
+        mPaintBg = new Paint();
+        mPaintBg.setAntiAlias(true);
+        mPaintBg.setStyle(Paint.Style.FILL);
+        mPaintBg.setColor(mBgColor);//60% 黑色背景 (透明度 40%)
+
+        mCamera = new Camera();
+        mMatrix = new Matrix();
+    }
+
+    /**
+     * 这个方法是否有优化空间
+     */
+    @Override
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+        int wh = mLogoBackgroundRadius * 2;
+        setMeasuredDimension(wh, wh);
+    }
+
+    @Override
+    protected void onDraw(Canvas canvas) {
+        super.onDraw(canvas);
+        float centryX = getWidth() / 2;
+        float centryY = getHeight() / 2;
+        canvas.save();//保存一份快照,方便后面恢复
+        mCamera.save();
+        setAlpha(1.0f);
+        if (mStatus == NORMAL) {
+            if (mLastStatus != NORMAL) {
+                canvas.restore();//恢复画布的原始快照
+                mCamera.restore();
+            }
+
+            if (isDraging) {
+
+                //如果当前是拖动状态则放大并旋转
+               // canvas.scale((scaleOffset + 1f), (scaleOffset + 1f), getWidth() / 2, getHeight() / 2);
+                if (mIsResetPosition) {
+                    //手指拖动后离开屏幕复位时使用 x轴旋转 3d动画
+                    mCamera.save();
+                    mCamera.rotateX(720 * scaleOffset);//0-720度 最多转两圈
+                    mCamera.getMatrix(mMatrix);
+
+                    mMatrix.preTranslate(-getWidth() / 2, -getHeight() / 2);
+                    mMatrix.postTranslate(getWidth() / 2, getHeight() / 2);
+                    canvas.concat(mMatrix);
+                    mCamera.restore();
+                } else {
+                    //手指拖动且手指未离开屏幕则使用 绕图心2d旋转动画
+                    canvas.rotate(60 * mRolateValue, getWidth() / 2, getHeight() / 2);
+                }
+            }
+
+
+        } else if (mStatus == HIDE_LEFT) {
+            canvas.translate(-getWidth() * hideOffset, 0);
+            canvas.rotate(0, getWidth() / 2, getHeight() / 2);
+            setAlpha(hideOffsetAlpha);
+
+        } else if (mStatus == HIDE_RIGHT) {
+            canvas.translate(getWidth() * hideOffset, 0);
+            canvas.rotate(0, getWidth() / 2, getHeight() / 2);
+            setAlpha(hideOffsetAlpha);
+        }
+        canvas.save();
+        if (!isDraging) {
+            if (mDrawDarkBg) {
+                mPaintBg.setColor(Color.TRANSPARENT);
+                canvas.drawCircle(centryX, centryY, mLogoBackgroundRadius, mPaintBg);
+                // 60% 白色 (透明度 40%)
+                mPaint.setColor(0x99ffffff);
+            } else {
+                //100% 白色背景 (透明度 0%)
+                mPaint.setColor(0xFFFFFFFF);
+            }
+            if (mAlphValue != 0) {
+                mPaint.setAlpha((int) (mAlphValue * 255));
+            }
+            canvas.drawCircle(centryX, centryY, mLogoWhiteRadius, mPaint);
+        }
+
+        canvas.restore();
+        //100% 白色背景 (透明度 0%)
+        mPaint.setColor(0xFFFFFFFF);
+        int left = (int) (centryX - mBitmap.getWidth() / 2);
+        int top = (int) (centryY - mBitmap.getHeight() / 2);
+        canvas.drawBitmap(mBitmap, left, top, mPaint);
+
+
+        if (!TextUtils.isEmpty(dotNum)) {
+            int readPointRadus = (mDrawNum ? mRedPointRadiusWithNum : mRedPointRadius);
+            mPaint.setColor(Color.RED);
+            if (mStatus == HIDE_LEFT) {
+                canvas.drawCircle(centryX + mRedPointOffset, centryY - mRedPointOffset, readPointRadus, mPaint);
+                if (mDrawNum) {
+                    mPaint.setColor(Color.WHITE);
+                    canvas.drawText(dotNum, centryX + mRedPointOffset - getTextWidth(dotNum, mPaint) / 2, centryY - mRedPointOffset + getTextHeight(dotNum, mPaint) / 2, mPaint);
+                }
+            } else if (mStatus == HIDE_RIGHT) {
+                canvas.drawCircle(centryX - mRedPointOffset, centryY - mRedPointOffset, readPointRadus, mPaint);
+                if (mDrawNum) {
+                    mPaint.setColor(Color.WHITE);
+                    canvas.drawText(dotNum, centryX - mRedPointOffset - getTextWidth(dotNum, mPaint) / 2, centryY - mRedPointOffset + getTextHeight(dotNum, mPaint) / 2, mPaint);
+                }
+            } else {
+                if (mLastStatus == HIDE_LEFT) {
+                    canvas.drawCircle(centryX + mRedPointOffset, centryY - mRedPointOffset, readPointRadus, mPaint);
+                    if (mDrawNum) {
+                        mPaint.setColor(Color.WHITE);
+                        canvas.drawText(dotNum, centryX + mRedPointOffset - getTextWidth(dotNum, mPaint) / 2, centryY - mRedPointOffset + getTextHeight(dotNum, mPaint) / 2, mPaint);
+                    }
+                } else if (mLastStatus == HIDE_RIGHT) {
+                    canvas.drawCircle(centryX - mRedPointOffset, centryY - mRedPointOffset, readPointRadus, mPaint);
+                    if (mDrawNum) {
+                        mPaint.setColor(Color.WHITE);
+                        canvas.drawText(dotNum, centryX - mRedPointOffset - getTextWidth(dotNum, mPaint) / 2, centryY - mRedPointOffset + getTextHeight(dotNum, mPaint) / 2, mPaint);
+                    }
+                }
+            }
+        }
+        mLastStatus = mStatus;
+    }
+
+
+    public void setDotNum(int num, Animator.AnimatorListener l) {
+        if (!inited) {
+            startAnim(num, l);
+        } else {
+            refreshDot(num);
+        }
+    }
+
+    public void refreshDot(int num) {
+        if (num > 0) {
+            String dotNumTmp = String.valueOf(num);
+            if (!TextUtils.equals(dotNum, dotNumTmp)) {
+                dotNum = dotNumTmp;
+                invalidate();
+            }
+        } else {
+            dotNum = null;
+        }
+    }
+
+    public void startAnim(final int num, Animator.AnimatorListener l) {
+        ValueAnimator valueAnimator = ValueAnimator.ofFloat(1.f, 0.6f, 1f, 0.6f);
+        valueAnimator.setInterpolator(mLinearInterpolator);
+        valueAnimator.setDuration(3000);
+        valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+            @Override
+            public void onAnimationUpdate(ValueAnimator animation) {
+                mAlphValue = (float) animation.getAnimatedValue();
+                invalidate();
+
+            }
+        });
+        valueAnimator.addListener(l);
+        valueAnimator.addListener(new Animator.AnimatorListener() {
+            @Override
+            public void onAnimationStart(Animator animation) {
+
+            }
+
+            @Override
+            public void onAnimationEnd(Animator animation) {
+                inited = true;
+                refreshDot(num);
+                mAlphValue = 0;
+
+            }
+
+            @Override
+            public void onAnimationCancel(Animator animation) {
+                mAlphValue = 0;
+            }
+
+            @Override
+            public void onAnimationRepeat(Animator animation) {
+
+            }
+        });
+        valueAnimator.start();
+    }
+
+    public void setDraging(boolean draging, float offset, boolean isResetPosition) {
+        isDraging = draging;
+        this.mIsResetPosition = isResetPosition;
+        if (offset > 0 && offset != this.scaleOffset) {
+            this.scaleOffset = offset;
+        }
+        if (isDraging && mStatus == NORMAL) {
+            if (mDragingValueAnimator != null) {
+                if (mDragingValueAnimator.isRunning()) return;
+            }
+            mDragingValueAnimator = ValueAnimator.ofFloat(0, 6f, 12f, 0f);
+            mDragingValueAnimator.setInterpolator(mLinearInterpolator);
+            mDragingValueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+                @Override
+                public void onAnimationUpdate(ValueAnimator animation) {
+                    mRolateValue = (float) animation.getAnimatedValue();
+                    invalidate();
+                }
+            });
+            mDragingValueAnimator.addListener(new Animator.AnimatorListener() {
+                @Override
+                public void onAnimationStart(Animator animation) {
+
+                }
+
+                @Override
+                public void onAnimationEnd(Animator animation) {
+                    isDraging = false;
+                    mIsResetPosition = false;
+                }
+
+                @Override
+                public void onAnimationCancel(Animator animation) {
+
+                }
+
+                @Override
+                public void onAnimationRepeat(Animator animation) {
+
+                }
+            });
+            mDragingValueAnimator.setDuration(1000);
+            mDragingValueAnimator.start();
+        }
+    }
+
+    private int dip2px(float dipValue) {
+        final float scale = getContext().getResources().getDisplayMetrics().density;
+        return (int) (dipValue * scale + 0.5f);
+    }
+
+    private int sp2px(float spValue) {
+        final float fontScale = getContext().getResources().getDisplayMetrics().scaledDensity;
+        return (int) (spValue * fontScale + 0.5f);
+    }
+
+    private float getTextHeight(String text, Paint paint) {
+        Rect rect = new Rect();
+        paint.getTextBounds(text, 0, text.length(), rect);
+        return rect.height() / 1.1f;
+    }
+
+    private float getTextWidth(String text, Paint paint) {
+        return paint.measureText(text);
+    }
+}

+ 839 - 0
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/floating/FloatLogoMenu.java

@@ -0,0 +1,839 @@
+/*
+ * Copyright (c) 2016, Shanghai YUEWEN Information Technology Co., Ltd.
+ * All rights reserved.
+ * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ *  Neither the name of Shanghai YUEWEN Information Technology Co., Ltd. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY SHANGHAI YUEWEN INFORMATION TECHNOLOGY CO., LTD. AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+package cn.yyxx.commsdk.platform.hnyy.floating;
+
+import android.animation.Animator;
+import android.animation.ValueAnimator;
+import android.app.Activity;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.SharedPreferences;
+import android.graphics.Bitmap;
+import android.graphics.PixelFormat;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+import android.os.CountDownTimer;
+import android.os.Handler;
+import android.os.Looper;
+import android.util.DisplayMetrics;
+import android.util.TypedValue;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.View.OnTouchListener;
+import android.view.WindowManager;
+import android.view.animation.Interpolator;
+import android.view.animation.LinearInterpolator;
+import android.widget.LinearLayout;
+
+import cn.yyxx.commsdk.base.utils.Logger;
+import cn.yyxx.commsdk.core.utils.ResourceUtil;
+import cn.yyxx.commsdk.platform.hnyy.dialog.CustomExitGameDialog;
+
+
+/**
+ * Created by wengyiming on 2017/7/20.
+ */
+public class FloatLogoMenu {
+
+
+
+
+
+    /**
+     * 记录 logo 停放的位置,以备下次恢复
+     */
+    private static final String LOCATION_X = "hintLocation";
+    private static final String LOCATION_Y = "locationY";
+
+    /**
+     * 悬浮球 坐落 左 右 标记
+     */
+    public static final int LEFT = 0;
+    public static final int RIGHT = 1;
+
+    /**
+     * 记录系统状态栏的高度
+     */
+    private int mStatusBarHeight;
+    /**
+     * 记录当前手指位置在屏幕上的横坐标值
+     */
+    private float mXInScreen;
+
+    /**
+     * 记录当前手指位置在屏幕上的纵坐标值
+     */
+    private float mYInScreen;
+
+    /**
+     * 记录手指按下时在屏幕上的横坐标的值
+     */
+    private float mXDownInScreen;
+
+    /**
+     * 记录手指按下时在屏幕上的纵坐标的值
+     */
+    private float mYDownInScreen;
+
+    /**
+     * 记录手指按下时在小悬浮窗的View上的横坐标的值
+     */
+    private float mXInView;
+
+    /**
+     * 记录手指按下时在小悬浮窗的View上的纵坐标的值
+     */
+    private float mYinview;
+
+    /**
+     * 记录屏幕的宽度
+     */
+    private int mScreenWidth,screenHeigth;
+
+    /**
+     * 来自 activity 的 wManager
+     */
+    private WindowManager wManager;
+
+
+    /**
+     * 为 wManager 设置 LayoutParams
+     */
+    private WindowManager.LayoutParams wmParams,wmParams2;
+
+    /**
+     * 带透明度动画、旋转、放大的悬浮球
+     */
+    private DotImageView mFloatLogo;
+
+
+    /**
+     * 用于 定时 隐藏 logo的定时器
+     */
+    private CountDownTimer mHideTimer;
+
+
+    /**
+     * float menu的高度
+     */
+    private Handler mHandler = new Handler(Looper.getMainLooper());
+
+
+    /**
+     * 悬浮窗左右移动到默认位置 动画的 加速器
+     */
+    private Interpolator mLinearInterpolator = new LinearInterpolator();
+
+    /**
+     * 标记是否拖动中
+     */
+    private boolean isDraging = false;
+
+    /**
+     * 用于恢复悬浮球的location的属性动画值
+     */
+    private int mResetLocationValue;
+
+    private LinearLayout ll_hide;
+
+
+
+    private boolean isShowing = false;
+
+    /**
+     * 手指离开屏幕后 用于恢复 悬浮球的 logo 的左右位置
+     */
+    private Runnable updatePositionRunnable = new Runnable() {
+        @Override
+        public void run() {
+            isDraging = true;
+            checkPosition();
+
+        }
+    };
+
+
+
+    /**
+     * 这个事件用于处理移动、自定义点击或者其它事情,return true可以保证onclick事件失效
+     */
+    private OnTouchListener touchListener = new OnTouchListener() {
+        @Override
+        public boolean onTouch(View v, MotionEvent event) {
+            switch (event.getAction()) {
+                case MotionEvent.ACTION_DOWN:
+                    floatEventDown(event);
+                    break;
+                case MotionEvent.ACTION_MOVE:
+                    floatEventMove(event);
+                    break;
+                case MotionEvent.ACTION_UP:
+                    floatEventUp();
+                case MotionEvent.ACTION_CANCEL:
+                    floatEventCancel();
+                    break;
+            }
+            return true;
+        }
+    };
+
+
+    private View  createHideView(Context context){
+         hideView = LayoutInflater.from(context).inflate(ResourceUtil.getLayoutId(context,
+                "hnyy_hide_float_view"), null);
+        ll_hide = hideView.findViewById(ResourceUtil.getId(context,
+                "ll_hide"));
+        return hideView;
+    }
+
+
+
+
+
+
+    /**
+     * R.drawable.game_logo
+     *
+     * @param floatItems
+     */
+    private Bitmap mLogoRes;
+
+    /**
+     * 用于显示在 mActivity 上的 mActivity
+     */
+    private Context mActivity;
+
+
+
+
+    /**
+     * 停靠默认位置
+     */
+    private int mDefaultLocation = RIGHT;
+
+
+    /**
+     * 悬浮窗 坐落 位置
+     */
+    private int mHintLocation = mDefaultLocation;
+
+
+
+
+    private ValueAnimator valueAnimator;
+
+
+    private View hideView;
+
+    private  OnFloatClickListener mListener;
+
+    private FloatLogoMenu(Builder builder) {
+
+
+        mLogoRes = builder.mLogoRes;
+        mActivity = builder.mActivity;
+
+        mDefaultLocation = builder.mDefaultLocation;
+        mListener = builder.listener;
+
+
+
+        if (mLogoRes == null) {
+            throw new IllegalArgumentException("No logo found,you can setLogo/showWithLogo to set a FloatLogo ");
+        }
+
+
+        initFloatWindow();
+        initTimer();
+        initFloat();
+
+    }
+
+
+    /**
+     * 初始化悬浮球 window
+     */
+    private void initFloatWindow() {
+        wmParams = new WindowManager.LayoutParams( WindowManager.LayoutParams.MATCH_PARENT,
+                WindowManager.LayoutParams.WRAP_CONTENT,
+                WindowManager.LayoutParams.TYPE_SYSTEM_ERROR,
+                WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
+                        | WindowManager.LayoutParams.FLAG_FULLSCREEN,
+                PixelFormat.TRANSLUCENT);
+
+
+
+        if (mActivity instanceof Activity) {
+            Activity activity = (Activity) mActivity;
+            wManager = activity.getWindowManager();
+            //类似dialog,寄托在activity的windows上,activity关闭时需要关闭当前float
+            wmParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL;
+
+
+        } else {
+            wManager = (WindowManager) mActivity.getSystemService(Context.WINDOW_SERVICE);
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+                if (Build.VERSION.SDK_INT > 23) {
+                    //在android7.1以上系统需要使用TYPE_PHONE类型 配合运行时权限
+                    wmParams.type = WindowManager.LayoutParams.TYPE_PHONE;
+                } else {
+                    wmParams.type =WindowManager.LayoutParams.TYPE_TOAST;
+                }
+            } else {
+                wmParams.type = WindowManager.LayoutParams.TYPE_PHONE;
+            }
+        }
+        DisplayMetrics dm = new DisplayMetrics();
+        wManager.getDefaultDisplay().getMetrics(dm);
+        mScreenWidth = dm.widthPixels;
+        screenHeigth = dm.heightPixels;
+
+        //判断状态栏是否显示 如果不显示则statusBarHeight为0
+        mStatusBarHeight = dp2Px(0, mActivity);
+
+        wmParams.format = PixelFormat.RGBA_8888;
+        wmParams.gravity = Gravity.LEFT | Gravity.TOP;
+
+
+
+
+        wmParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
+        | WindowManager.LayoutParams.FLAG_FULLSCREEN;
+        mHintLocation = getSetting(LOCATION_X, mDefaultLocation);
+        int defaultY = ((screenHeigth - mStatusBarHeight) / 2) / 3;
+        int y = getSetting(LOCATION_Y, defaultY);
+        if (mHintLocation == LEFT) {
+            wmParams.x = 0;
+        } else {
+            wmParams.x = mScreenWidth;
+        }
+
+
+        if (y != 0 && y != defaultY) {
+            wmParams.y = y;
+        } else {
+            wmParams.y = defaultY;
+        }
+
+        wmParams.alpha = 1;
+        wmParams.width = WindowManager.LayoutParams.WRAP_CONTENT;
+        wmParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
+
+
+
+        wmParams2 = new WindowManager.LayoutParams();
+        wmParams2.format = PixelFormat.RGBA_8888;
+        wmParams2.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
+        wmParams2.width = WindowManager.LayoutParams.WRAP_CONTENT;
+        wmParams2.height = WindowManager.LayoutParams.WRAP_CONTENT;
+        wmParams2.y=-screenHeigth / 4;
+        wmParams2.gravity = Gravity.CENTER_HORIZONTAL;
+        wmParams2.type = WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL;
+    }
+
+
+    /**
+     * 初始化悬浮球
+     */
+    private void initFloat() {
+
+        mFloatLogo = new DotImageView(mActivity, mLogoRes);
+        mFloatLogo.setLayoutParams(new WindowManager.LayoutParams(dp2Px(50, mActivity), dp2Px(50, mActivity)));
+        mFloatLogo.setDrawDarkBg(true);
+        mFloatLogo.setVisibility(View.GONE);
+        mFloatLogo.setOnTouchListener(touchListener);//恢复touch事件
+
+
+        try {
+
+            hideView = createHideView(mActivity);
+
+
+
+        }
+        catch (Exception e) {
+            e.printStackTrace();
+        }
+        mHideTimer.start();
+    }
+
+
+    /**
+     * 初始化 隐藏悬浮球的定时器
+     */
+    private void initTimer() {
+        mHideTimer = new CountDownTimer(2000, 10) {        //悬浮窗超过5秒没有操作的话会自动隐藏
+            @Override
+            public void onTick(long millisUntilFinished) {
+
+
+            }
+
+            @Override
+            public void onFinish() {
+
+                if (!isDraging) {
+                    if (mHintLocation == LEFT) {
+                        mFloatLogo.setStatus(DotImageView.HIDE_LEFT);
+                        mFloatLogo.setDrawDarkBg(true);
+                    } else {
+                        mFloatLogo.setStatus(DotImageView.HIDE_RIGHT);
+                        mFloatLogo.setDrawDarkBg(true);
+                    }
+
+                }
+            }
+        };
+    }
+
+
+
+
+    /**
+     * 悬浮窗touch事件的 down 事件
+     */
+    private void floatEventDown(MotionEvent event) {
+        isDraging = false;
+        mHideTimer.cancel();
+        if (mFloatLogo.getStatus() != DotImageView.NORMAL) {
+            mFloatLogo.setStatus(DotImageView.NORMAL);
+        }
+        if (!mFloatLogo.mDrawDarkBg) {
+            mFloatLogo.setDrawDarkBg(true);
+        }
+        if (mFloatLogo.getStatus() != DotImageView.NORMAL) {
+            mFloatLogo.setStatus(DotImageView.NORMAL);
+        }
+        mXInView = event.getX();
+        mYinview = event.getY();
+        mXDownInScreen = event.getRawX();
+        mYDownInScreen = event.getRawY();
+        mXInScreen = event.getRawX();
+        mYInScreen = event.getRawY();
+
+        hideView.setVisibility(View.VISIBLE);
+    }
+
+    /**
+     * 悬浮窗touch事件的 move 事件
+     */
+    private void floatEventMove(MotionEvent event) {
+        mXInScreen = event.getRawX();
+        mYInScreen = event.getRawY();
+
+
+        //连续移动的距离超过3则更新一次视图位置
+        if (Math.abs(mXInScreen - mXDownInScreen) > mFloatLogo.getWidth() / 4 || Math.abs(mYInScreen - mYDownInScreen) > mFloatLogo.getWidth() / 4) {
+            wmParams.x = (int) (mXInScreen - mXInView);
+            wmParams.y = (int) (mYInScreen - mYinview) - mFloatLogo.getHeight() / 2;
+            updateViewPosition(); // 手指移动的时候更新小悬浮窗的位置
+            double a = mScreenWidth / 2;
+            float offset = (float) ((a - (Math.abs(wmParams.x - a))) / a);
+            mFloatLogo.setDraging(isDraging, offset, false);
+        } else {
+            isDraging = false;
+            mFloatLogo.setDraging(false, 0, true);
+        }
+
+
+
+        float x = wmParams.x;
+        float y = wmParams.y;
+        float XMinPoint = mScreenWidth / 2 - hideView.getWidth();
+        float XMaxPoint = mScreenWidth / 2 + hideView.getWidth();
+        float YMinPoint = screenHeigth / 4 - hideView.getHeight() - mStatusBarHeight;
+
+        float YMaxPoint = screenHeigth / 4   - mStatusBarHeight;
+
+        if (x >= XMinPoint && x <= XMaxPoint && y >=YMinPoint && y <= YMaxPoint){
+
+            ll_hide.setBackgroundResource(ResourceUtil.getDrawableId(mActivity, "hnyy_hide_float_view_bg"));
+
+        }else {
+            ll_hide.setBackgroundResource(ResourceUtil.getDrawableId(mActivity, "hnyy_text_black"));
+        }
+
+    }
+
+
+
+
+    private void floatEventUp() {
+
+
+
+        float x = wmParams.x;
+        float y = wmParams.y;
+        float RawX = mScreenWidth / 2 - hideView.getWidth();
+        float RawX1 = mScreenWidth / 2 + hideView.getWidth();
+        float RawY = screenHeigth / 4 - hideView.getHeight() - mStatusBarHeight;
+
+        float RawY1 = screenHeigth / 4   - mStatusBarHeight;
+
+        hideView.setVisibility(View.GONE);
+
+        if (x >= RawX && x <= RawX1 && y >=RawY && y <= RawY1){
+
+
+
+
+            CustomExitGameDialog.Builder builder = new CustomExitGameDialog.Builder(mActivity);
+            builder.Create().show();
+            builder.setPositiveButton(new DialogInterface.OnClickListener() {
+                @Override
+                public void onClick(DialogInterface dialog, int which) {
+
+                    hideFloat();
+
+
+                    dialog.dismiss();
+                }
+            });
+            builder.setnegativeButton(new DialogInterface.OnClickListener() {
+                @Override
+                public void onClick(DialogInterface dialog, int which) {
+
+                    dialog.dismiss();
+                }
+            });
+            builder.setTitle(mActivity.getString(ResourceUtil.getStringId(mActivity, "hnyy_close_float_view_tip")));
+
+        }
+
+
+
+    }
+    /**
+     * 悬浮窗touch事件的 up 事件
+     */
+    private void floatEventCancel() {
+        if (mXInScreen < mScreenWidth / 2) {   //在左边
+            mHintLocation = LEFT;
+        } else {                   //在右边
+            mHintLocation = RIGHT;
+        }
+        if (valueAnimator == null) {
+            valueAnimator = ValueAnimator.ofInt(64);
+            valueAnimator.setInterpolator(mLinearInterpolator);
+            valueAnimator.setDuration(1000);
+            valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+                @Override
+                public void onAnimationUpdate(ValueAnimator animation) {
+                    mResetLocationValue = (int) animation.getAnimatedValue();
+                    mHandler.post(updatePositionRunnable);
+                }
+            });
+
+            valueAnimator.addListener(new Animator.AnimatorListener() {
+                @Override
+                public void onAnimationStart(Animator animation) {
+
+                }
+
+                @Override
+                public void onAnimationEnd(Animator animation) {
+                    if (Math.abs(wmParams.x) < 0) {
+                        wmParams.x = 0;
+                    } else if (Math.abs(wmParams.x) > mScreenWidth) {
+                        wmParams.x = mScreenWidth;
+                    }
+                    updateViewPosition();
+                    isDraging = false;
+                    mFloatLogo.setDraging(false, 0, true);
+                    mHideTimer.start();
+                }
+
+                @Override
+                public void onAnimationCancel(Animator animation) {
+                    if (Math.abs(wmParams.x) < 0) {
+                        wmParams.x = 0;
+                    } else if (Math.abs(wmParams.x) > mScreenWidth) {
+                        wmParams.x = mScreenWidth;
+                    }
+
+                    updateViewPosition();
+                    isDraging = false;
+                    mFloatLogo.setDraging(false, 0, true);
+                    mHideTimer.start();
+
+                }
+
+                @Override
+                public void onAnimationRepeat(Animator animation) {
+
+                }
+            });
+        }
+        if (!valueAnimator.isRunning()) {
+            valueAnimator.start();
+        }
+
+//        //这里需要判断如果如果手指所在位置和logo所在位置在一个宽度内则不移动,
+        if (Math.abs(mXInScreen - mXDownInScreen) > mFloatLogo.getWidth() / 5 || Math.abs(mYInScreen - mYDownInScreen) > mFloatLogo.getHeight() / 5) {
+            isDraging = false;
+
+        }else {
+            if (isDraging)
+                return;
+            if (mListener != null)  mListener.onClick();
+
+        }
+
+    }
+
+
+    /**
+     * 用于检查并更新悬浮球的位置
+     */
+    private void checkPosition() {
+        if (wmParams.x > 0 && wmParams.x < mScreenWidth) {
+            if (mHintLocation == LEFT) {
+                wmParams.x = wmParams.x - mResetLocationValue;
+            } else {
+                wmParams.x = wmParams.x + mResetLocationValue;
+            }
+            updateViewPosition();
+            double a = mScreenWidth / 2;
+            float offset = (float) ((a - (Math.abs(wmParams.x - a))) / a);
+            mFloatLogo.setDraging(isDraging, offset, true);
+            return;
+        }
+
+
+        if (Math.abs(wmParams.x) < 0) {
+            wmParams.x = 0;
+        } else if (Math.abs(wmParams.x) > mScreenWidth) {
+            wmParams.x = mScreenWidth;
+        }
+        if (valueAnimator.isRunning()) {
+            valueAnimator.cancel();
+        }
+
+
+        updateViewPosition();
+        isDraging = false;
+
+
+    }
+
+
+
+
+    /**
+     * 更新悬浮窗在屏幕中的位置。
+     */
+    private void updateViewPosition() {
+        isDraging = true;
+        try {
+            wManager.updateViewLayout(mFloatLogo, wmParams);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public void show() {
+
+        if (isShowing) return;;
+
+            try {
+                if (wManager != null && wmParams != null && mFloatLogo != null) {
+
+
+                    wManager.addView(hideView, wmParams2);
+                    wManager.addView(mFloatLogo, wmParams);
+
+                    mFloatLogo.setVisibility(View.VISIBLE);
+                    isShowing = true;
+
+                }
+                if (mHideTimer != null) {
+                    mHideTimer.start();
+                } else {
+                    initTimer();
+                    mHideTimer.start();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+
+    }
+
+
+
+    /**
+     * 隐藏悬浮窗
+     */
+    public void hideFloat() {
+        if (!isShowing) return;
+        //记录上次的位置logo的停放位置,以备下次恢复
+        saveSetting(LOCATION_X, mHintLocation);
+        saveSetting(LOCATION_Y, wmParams.y);
+        mFloatLogo.clearAnimation();
+        try {
+            mHideTimer.cancel();
+
+            wManager.removeViewImmediate(mFloatLogo);
+            wManager.removeViewImmediate(hideView);
+
+            isDraging = false;
+
+            isShowing = false;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
+
+
+    /**
+     * 移除所有悬浮窗 释放资源
+     */
+    public void destoryFloat() {
+        //记录上次的位置logo的停放位置,以备下次恢复
+        saveSetting(LOCATION_X, mHintLocation);
+        saveSetting(LOCATION_Y, wmParams.y);
+        mFloatLogo.clearAnimation();
+        try {
+            mHideTimer.cancel();
+
+            wManager.removeViewImmediate(mFloatLogo);
+            wManager.removeViewImmediate(hideView);
+
+            isDraging = false;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
+
+
+
+
+
+    /**
+     * 用于保存悬浮球的位置记录
+     *
+     * @param key          String
+     * @param defaultValue int
+     * @return int
+     */
+    private int getSetting(String key, int defaultValue) {
+        try {
+            SharedPreferences sharedata = mActivity.getSharedPreferences("floatLogo", 0);
+            return sharedata.getInt(key, defaultValue);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return defaultValue;
+    }
+
+    /**
+     * 用于保存悬浮球的位置记录
+     *
+     * @param key   String
+     * @param value int
+     */
+    public void saveSetting(String key, int value) {
+        try {
+            SharedPreferences.Editor sharedata = mActivity.getSharedPreferences("floatLogo", 0).edit();
+            sharedata.putInt(key, value);
+            sharedata.apply();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static int dp2Px(float dp, Context mContext) {
+        return (int) TypedValue.applyDimension(
+                TypedValue.COMPLEX_UNIT_DIP,
+                dp,
+                mContext.getResources().getDisplayMetrics());
+    }
+
+
+
+
+
+    public static final class Builder {
+
+
+        private Bitmap mLogoRes;
+        private int mDefaultLocation;
+
+        private Context mActivity;
+
+        private  OnFloatClickListener listener;
+
+        private FloatLogoMenu floatLogoMenu;
+
+        public Builder setBgDrawable(Drawable drawable) {
+
+            return this;
+        }
+
+        public Builder() {
+        }
+
+
+
+        public Builder logo(Bitmap val) {
+            mLogoRes = val;
+            return this;
+        }
+
+        public Builder withActivity(Activity val) {
+            mActivity = val;
+            return this;
+        }
+
+
+
+        public Builder defaultLocation(int val) {
+            mDefaultLocation = val;
+            return this;
+        }
+
+
+
+        public Builder setOnFloatClickListener(OnFloatClickListener onClickFloatListener) {
+            listener = onClickFloatListener;
+            return this;
+        }
+
+
+        public void show() {
+            if (floatLogoMenu == null){
+                floatLogoMenu = new FloatLogoMenu(this);
+            }
+            floatLogoMenu.show();
+        }
+        public void hide(){
+            if (floatLogoMenu != null){
+
+                floatLogoMenu.hideFloat();
+            }
+
+        }
+        public void release(){
+            if (floatLogoMenu != null){
+                floatLogoMenu.destoryFloat();
+            }
+        }
+    }
+    public interface OnFloatClickListener {
+        void onClick();
+    }
+
+}

+ 87 - 0
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/floating/FloatViewManager.java

@@ -0,0 +1,87 @@
+package cn.yyxx.commsdk.platform.hnyy.floating;
+
+
+import static cn.yyxx.commsdk.base.constants.Constants.CLICK_INTERVAL;
+
+import android.app.Activity;
+import android.graphics.BitmapFactory;
+
+
+
+import cn.yyxx.commsdk.core.entity.SdkLoginInfo;
+import cn.yyxx.commsdk.core.utils.ResourceUtil;
+import cn.yyxx.commsdk.platform.hnyy.dialog.UserCenterDialog;
+
+public class FloatViewManager {
+
+    private static FloatViewManager manager = null;
+
+
+
+    private FloatLogoMenu.Builder builder;
+
+
+    private long clickLoginTime = 0L;
+
+
+    private FloatViewManager(Activity activity) {
+        initView(activity);
+    }
+
+
+
+    public static FloatViewManager getInstance(Activity activity) {
+
+        if (manager == null) {
+            synchronized (FloatViewManager.class) {
+                if (manager == null) {
+                    manager = new FloatViewManager(activity);
+                }
+            }
+        }
+
+        return manager;
+    }
+
+    public void initView(final Activity activity){
+
+        if (builder == null) {
+
+            builder = new FloatLogoMenu.Builder()
+                    .withActivity(activity)
+                    .logo(BitmapFactory.decodeResource(activity.getResources(), ResourceUtil.getMipmapId(activity,"hnyy_float_icon")))
+                    .setBgDrawable(activity.getResources().getDrawable(ResourceUtil.getDrawableId(activity,"hnyy_game_float_menu_bg")))
+                    .defaultLocation(FloatLogoMenu.LEFT)
+                    .setOnFloatClickListener(new FloatLogoMenu.OnFloatClickListener() {
+                        @Override
+                        public void onClick() {
+
+                            if (System.currentTimeMillis() - clickLoginTime < CLICK_INTERVAL) {
+
+                                return;
+                            }
+                            String  info = SdkLoginInfo.getInstance().toString();
+                            clickLoginTime = System.currentTimeMillis();
+                            new UserCenterDialog(activity,ResourceUtil.getStyleId(activity,"hnyy_half_black_dialog"), SdkLoginInfo.getInstance().user_center).show();
+                        }
+                    });
+
+
+
+
+        }
+    }
+
+    public void showFloat() {
+        builder.show();
+    }
+
+
+    public void hideFloat() {
+        builder.hide();
+    }
+
+    public void releaseFloat(){builder.release();}
+
+
+}

+ 53 - 0
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/BaseFragment.java

@@ -0,0 +1,53 @@
+package cn.yyxx.commsdk.platform.hnyy.fragment;
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.ImageButton;
+
+import cn.yyxx.commsdk.core.utils.ResourceUtil;
+import cn.yyxx.commsdk.platform.hnyy.HNYYLoginActivity;
+import cn.yyxx.commsdk.platform.hnyy.dialog.WvPageListDialog;
+import cn.yyxx.commsdk.platform.hnyy.impl.SdkPlatformImpl;
+
+public class BaseFragment extends android.support.v4.app.Fragment implements View.OnClickListener {
+    private ImageButton btn_kefu;
+    public HNYYLoginActivity loginImpl;
+
+
+    @Override
+    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
+        super.onViewCreated(view, savedInstanceState);
+        btn_kefu = view.findViewById(ResourceUtil.getId(getActivity(),"btn_kefu"));
+        if (btn_kefu != null){
+            btn_kefu.setOnClickListener(this);
+            if (!SdkPlatformImpl.initConfig.isShowKf){
+                btn_kefu.setVisibility(View.GONE);
+            }
+        }
+
+
+        if (getActivity() instanceof HNYYLoginActivity) {
+            loginImpl = (HNYYLoginActivity) getActivity();
+        }
+
+    }
+
+
+
+    @Override
+    public void onClick(View v) {
+        if (v.getId() == ResourceUtil.getId(getActivity(), "btn_kefu")){
+
+            if (!TextUtils.isEmpty(SdkPlatformImpl.initConfig.service_center)){
+
+                new WvPageListDialog(getActivity(),ResourceUtil.getStyleId(getActivity(),"hnyy_base_dialog"), SdkPlatformImpl.initConfig.service_center).show();
+
+            }
+
+
+
+        }
+    }
+}

+ 98 - 8
library_platform/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/fragment/UserAccountLoginFragment.java → library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserAccountLoginFragment.java

@@ -1,9 +1,8 @@
-package cn.yyxx.commsdk.platform.hnyy.fragment.fragment;
+package cn.yyxx.commsdk.platform.hnyy.fragment;
 
 
-import static cn.yyxx.commsdk.core.constants.Constants.CLICK_INTERVAL;
+import static cn.yyxx.commsdk.base.constants.Constants.CLICK_INTERVAL;
 
-import android.app.Fragment;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
@@ -21,8 +20,16 @@ import android.widget.ImageView;
 import android.widget.ListView;
 import android.widget.TextView;
 
+import java.util.ArrayList;
+
+import cn.yyxx.commsdk.base.entity.ResultInfo;
+import cn.yyxx.commsdk.base.internal.ICallback;
 import cn.yyxx.commsdk.core.utils.ResourceUtil;
-import cn.yyxx.commsdk.platform.hnyy.fragment.fragment.widget.TosUtil;
+import cn.yyxx.commsdk.platform.hnyy.HNYYLoginFragmentTag;
+import cn.yyxx.commsdk.platform.hnyy.adapter.UserListAdapter;
+import cn.yyxx.commsdk.platform.hnyy.fragment.widget.TosUtil;
+import cn.yyxx.commsdk.platform.user.UserSession;
+import cn.yyxx.commsdk.platform.user.UserSessionManager;
 
 public class UserAccountLoginFragment extends BaseFragment {
 
@@ -45,8 +52,9 @@ public class UserAccountLoginFragment extends BaseFragment {
 
     private long clickLoginTime = 0L;
 
-    private String login_token;
+    private UserListAdapter userListAdapter;
 
+    private String login_token;
     @Nullable
     @Override
     public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
@@ -83,6 +91,54 @@ public class UserAccountLoginFragment extends BaseFragment {
         tv_fofget_pwd.setOnClickListener(this);
 
 
+        close_btn = view.findViewById(ResourceUtil.getId(getActivity(),"close_btn"));
+        close_btn.setOnClickListener(this);
+
+        if (getData() != null){
+
+            userListAdapter  = new UserListAdapter(getActivity(),getData());
+            account_listview.setAdapter(userListAdapter);
+            account_listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+                @Override
+                public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
+                    reg_account_edit.setText(userListAdapter.list.get(i).uname);
+                    reg_pwd_edit.setText(userListAdapter.list.get(i).password);
+                    login_token = userListAdapter.list.get(i).login_token;
+                    hideListView();
+                }
+            });
+
+            reg_account_edit.setText(userListAdapter.list.get(0).uname);
+            reg_pwd_edit.setText(userListAdapter.list.get(0).password);
+        }
+
+
+    }
+
+    private void showListView() {
+        if (getData() == null) {
+            list_text.setVisibility(View.VISIBLE);
+        } else {
+            account_listview.setVisibility(View.VISIBLE);
+            list_text.setVisibility(View.GONE);
+
+        }
+        isShowList = true;
+
+
+    }
+
+    private void hideListView() {
+        account_listview.setVisibility(View.GONE);
+        list_text.setVisibility(View.GONE);
+        isShowList = false;
+        showListView.setImageResource(ResourceUtil.getMipmapId(getActivity(), "hnyy_arrow_normal"));
+    }
+
+    private ArrayList<UserSession> getData() {
+
+        return UserSessionManager.getInstance().getLocalSession();
+
     }
 
     @Override
@@ -99,18 +155,35 @@ public class UserAccountLoginFragment extends BaseFragment {
 
         }else if(id == ResourceUtil.getId(getActivity(), "down_btn")){
             /*	显示缓存账号	*/
+            if (!isShowList) {
+                showListView.setImageResource(ResourceUtil.getMipmapId(getActivity(), "hnyy_arrow_select"));
+                showListView();
+            } else {
 
-        }else if(id == ResourceUtil.getId(getActivity(), "iv_show_pwd")){
-
+                showListView.setImageResource(ResourceUtil.getMipmapId(getActivity(), "hnyy_arrow_normal"));
+                hideListView();
+            }
 
+        }else if(id == ResourceUtil.getId(getActivity(), "iv_show_pwd")){
 
-        }else if(id == ResourceUtil.getId(getActivity(), "btn_account_login")){
+            if (!isShowPwd) {
+                isShowPwd = true;
+                reg_pwd_edit.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
+                iv_show_pwd.setImageResource(ResourceUtil.getMipmapId(getActivity(), "hnyy_open_eye"));
+            } else {
+                isShowPwd = false;
+                reg_pwd_edit.setTransformationMethod(PasswordTransformationMethod.getInstance());
+                iv_show_pwd.setImageResource(ResourceUtil.getMipmapId(getActivity(), "hnyy_close_eye"));
+            }
 
 
         }else if(id == ResourceUtil.getId(getActivity(), "close_btn")){
 
+            loginImpl.switchFragment(HNYYLoginFragmentTag.PAGE_PHONE_LOGIN,null);
+
         }else if(id == ResourceUtil.getId(getActivity(), "tv_fofget_pwd")){
 
+            loginImpl.switchFragment(HNYYLoginFragmentTag.PAGE_RETRIEVE_PASSWORD,null);
 
         }
 
@@ -144,6 +217,23 @@ public class UserAccountLoginFragment extends BaseFragment {
         }
 
 
+        loginImpl.loginViewModel.accountLogin(getActivity(), account, pwd, login_token, new ICallback() {
+            @Override
+            public void onResult(int code, String result) {
+                if (code == ResultInfo.CODE_SUCCESS){
+
+                    if (!getActivity().isFinishing()) {
+                        getActivity().finish();
+                    }
+
+                 }else{
+                    new TosUtil(getActivity(),TosUtil.TOAST_ERROR, result).show();
+
+                }
+            }
+        });
+
+
 
     }
 

+ 65 - 32
library_platform/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/fragment/UserPhoneLoginFragment.java → library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserPhoneLoginFragment.java

@@ -1,10 +1,9 @@
-package cn.yyxx.commsdk.platform.hnyy.fragment.fragment;
+package cn.yyxx.commsdk.platform.hnyy.fragment;
 
 
-import static cn.yyxx.commsdk.core.constants.Constants.CLICK_INTERVAL;
+import static cn.yyxx.commsdk.base.constants.Constants.CLICK_INTERVAL;
 
 import android.app.Activity;
-import android.app.Fragment;
 import android.os.Bundle;
 import android.os.CountDownTimer;
 import android.support.annotation.NonNull;
@@ -18,7 +17,14 @@ import android.widget.CheckBox;
 import android.widget.EditText;
 import android.widget.TextView;
 
+import cn.yyxx.commsdk.base.entity.ResultInfo;
+import cn.yyxx.commsdk.base.internal.ICallback;
+import cn.yyxx.commsdk.base.internal.PhoneLoginCallBack;
 import cn.yyxx.commsdk.core.utils.ResourceUtil;
+import cn.yyxx.commsdk.platform.hnyy.HNYYLoginFragmentTag;
+import cn.yyxx.commsdk.platform.hnyy.dialog.WvPageListDialog;
+import cn.yyxx.commsdk.platform.hnyy.fragment.widget.TosUtil;
+import cn.yyxx.commsdk.platform.hnyy.impl.SdkPlatformImpl;
 
 
 public class UserPhoneLoginFragment extends BaseFragment {
@@ -27,17 +33,15 @@ public class UserPhoneLoginFragment extends BaseFragment {
     private EditText et_user_phone,et_user_code;
     private CheckBox cb_register;
     private TextView tv_tip,tv_private_policy;
-    private Button btn_get_code,btn_account_login,btn_guest_login,btn_reg_compete;
+    private Button btn_get_code,btn_account_login,btn_guest_register,btn_reg_compete;
     private CodeVerifyTimeCount codeVerifyTimeCount;
     private long clickLoginTime = 0L;
+
     @Nullable
     @Override
     public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
         View view = inflater.inflate(ResourceUtil.getLayoutId(getActivity(),"hnyy_phone_login"), container, false);
         view.setClickable(true);
-
-
-
         return view;
     }
 
@@ -56,8 +60,8 @@ public class UserPhoneLoginFragment extends BaseFragment {
         btn_get_code.setOnClickListener(this);
         btn_account_login = view.findViewById(ResourceUtil.getId(getActivity(),"btn_account_login"));
         btn_account_login.setOnClickListener(this);
-        btn_guest_login = view.findViewById(ResourceUtil.getId(getActivity(),"btn_guest_login"));
-        btn_guest_login.setOnClickListener(this);
+        btn_guest_register = view.findViewById(ResourceUtil.getId(getActivity(),"btn_guest_register"));
+        btn_guest_register.setOnClickListener(this);
         btn_reg_compete = view.findViewById(ResourceUtil.getId(getActivity(),"btn_reg_compete"));
         btn_reg_compete.setOnClickListener(this);
 
@@ -72,10 +76,11 @@ public class UserPhoneLoginFragment extends BaseFragment {
         int id = v.getId();
         if(id == ResourceUtil.getId(getActivity(), "tv_tip")){
 
-
+            new WvPageListDialog(getActivity(),ResourceUtil.getStyleId(getActivity(),"hnyy_base_dialog"), SdkPlatformImpl.initConfig.agreement_user).show();
 
         }else if(id == ResourceUtil.getId(getActivity(), "tv_private_policy")){
 
+            new WvPageListDialog(getActivity(),ResourceUtil.getStyleId(getActivity(),"hnyy_base_dialog"), SdkPlatformImpl.initConfig.agreement_privacy).show();
 
 
         }else if(id == ResourceUtil.getId(getActivity(), "btn_reg_compete")){
@@ -86,7 +91,7 @@ public class UserPhoneLoginFragment extends BaseFragment {
             }
             clickLoginTime = System.currentTimeMillis();
 
-            registerWithPhone(getActivity());
+            phoneLoginWithSms(getActivity());
 
         }else if(id == ResourceUtil.getId(getActivity(), "btn_get_code")){
 
@@ -94,19 +99,22 @@ public class UserPhoneLoginFragment extends BaseFragment {
 
             if (phone.length() < 10) {
 
+                new TosUtil(getActivity(),TosUtil.TOAST_ERROR, getString(ResourceUtil.getStringId(getActivity(), "hnyy_pls_input_right_phone"))).show();
 
                 return;
+
             }
             getPhoneCaptcha(getActivity(),phone,"register");
 
         }else if(id == ResourceUtil.getId(getActivity(), "btn_account_login")){
 
-            Fragment accountLoginFragment = FragmentUtils.getSdkFragment(getActivity(),FragmentUtils.SDK_LOGIN_TAG);
-            replaceFragmentToActivity(getFragmentManager(),accountLoginFragment,ResourceUtil.getId(getActivity(),"hnyy_content"));
+            loginImpl.switchFragment(HNYYLoginFragmentTag.PAGE_ACCOUNT_LOGIN,null);
+
+
+        }else if(id == ResourceUtil.getId(getActivity(), "btn_guest_register")){
+
+            loginImpl.switchFragment(HNYYLoginFragmentTag.PAGE_ACCOUNT_REGISTER,null);
 
-        }else if(id == ResourceUtil.getId(getActivity(), "btn_guest_login")){
-            Fragment accountLoginFragment = FragmentUtils.getSdkFragment(getActivity(),FragmentUtils.SDK_REGISTER_TAG);
-            replaceFragmentToActivity(getFragmentManager(),accountLoginFragment,ResourceUtil.getId(getActivity(),"hnyy_content"));
 
         }
 
@@ -121,13 +129,14 @@ public class UserPhoneLoginFragment extends BaseFragment {
 
     }
 
-    private void registerWithPhone(final Activity activity){
+    private void phoneLoginWithSms(final Activity activity){
         final String code = et_user_code.getText().toString();
         final String account = et_user_phone.getText().toString();
 
 
         if(account.length() < 10 || TextUtils.isEmpty(account))
         {
+            new TosUtil(getActivity(),TosUtil.TOAST_ERROR,getString(ResourceUtil.getStringId(getActivity(), "hnyy_pls_input_right_phone"))).show();
 
             return;
         }
@@ -135,24 +144,61 @@ public class UserPhoneLoginFragment extends BaseFragment {
         if(code.length() < 4 || TextUtils.isEmpty(code))
         {
 
+            new TosUtil(getActivity(),TosUtil.TOAST_ERROR, getString(ResourceUtil.getStringId(getActivity(), "hnyy_pls_input_right_code"))).show();
+
             return;
         }
 
         if (!cb_register.isChecked()){
 
+            new TosUtil(getActivity(), TosUtil.TOAST_ERROR,getString(ResourceUtil.getStringId(getActivity(), "hnyy_pls_checked_reg_tip"))).show();
 
             return;
 
         }
 
+        loginImpl.loginViewModel.phoneLoginWithSms(getActivity(), account, code, new PhoneLoginCallBack() {
 
+            @Override
+            public void onPhoneLoginSuccess(String msg) {
 
 
-    }
+                    if (!getActivity().isFinishing()) {
+                        getActivity().finish();
+                }
 
+            }
+
+            @Override
+            public void onPhoneLoginFailed(String msg) {
 
-    private void  getPhoneCaptcha(Activity activity, String phone, String action){
+                new TosUtil(getActivity(), TosUtil.TOAST_ERROR, msg).show();
 
+            }
+
+            @Override
+            public void onPhoneNewLogin() {
+                Bundle bundle = new Bundle();
+                bundle.putString("account",account);
+                bundle.putString("code",code);
+                loginImpl.switchFragment(HNYYLoginFragmentTag.PAGE_POHONE_SET_PASSWORD,bundle);
+            }
+        });
+
+    }
+
+
+    private void  getPhoneCaptcha(Activity activity, String phoneNum, String action){
+        loginImpl.loginViewModel.getPhoneCaptcha(activity, phoneNum, action, new ICallback() {
+            @Override
+            public void onResult(int code, String result) {
+                if (code == ResultInfo.CODE_SUCCESS){
+                    getCodeSuccess();
+                }else{
+                    new TosUtil(getActivity(), TosUtil.TOAST_ERROR, result).show();
+                }
+            }
+        });
     }
     private void getCodeSuccess() {
         btn_get_code.setEnabled(false);
@@ -186,22 +232,9 @@ public class UserPhoneLoginFragment extends BaseFragment {
 
     }
 
-    public interface CaptchaCallback {
 
-        void onGetSuccess(String msg);
-        void onGetFailed(String msg);
 
 
-    }
-
-    public interface PhoneLoginCallback {
-
-        void onPhoneLoginSuccess(String msg);
-        void onPhoneLoginFailed(String msg);
-        void onPhoneNewLogin();
-
-    }
-
 
 
 

+ 35 - 12
library_platform/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/fragment/UserPhoneLoginSetpwdFragment.java → library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserPhoneLoginSetpwdFragment.java

@@ -1,10 +1,9 @@
-package cn.yyxx.commsdk.platform.hnyy.fragment.fragment;
+package cn.yyxx.commsdk.platform.hnyy.fragment;
 
 
-import static cn.yyxx.commsdk.core.constants.Constants.CLICK_INTERVAL;
+import static cn.yyxx.commsdk.base.constants.Constants.CLICK_INTERVAL;
 
 import android.app.Activity;
-import android.app.Fragment;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
@@ -18,9 +17,14 @@ import android.widget.EditText;
 import android.widget.ImageButton;
 import android.widget.TextView;
 
-
-
+import cn.yyxx.commsdk.base.entity.ResultInfo;
+import cn.yyxx.commsdk.base.internal.ICallback;
+import cn.yyxx.commsdk.base.utils.Logger;
 import cn.yyxx.commsdk.core.utils.ResourceUtil;
+import cn.yyxx.commsdk.platform.hnyy.HNYYLoginFragmentTag;
+import cn.yyxx.commsdk.platform.hnyy.dialog.WvPageListDialog;
+import cn.yyxx.commsdk.platform.hnyy.fragment.widget.TosUtil;
+import cn.yyxx.commsdk.platform.hnyy.impl.SdkPlatformImpl;
 
 
 public class UserPhoneLoginSetpwdFragment extends BaseFragment {
@@ -74,16 +78,18 @@ public class UserPhoneLoginSetpwdFragment extends BaseFragment {
         int id = v.getId();
         if(id == ResourceUtil.getId(getActivity(), "tv_tip")){
 
-
+            new WvPageListDialog(getActivity(),ResourceUtil.getStyleId(getActivity(),"hnyy_base_dialog"), SdkPlatformImpl.initConfig.agreement_user).show();
 
         }else if(id == ResourceUtil.getId(getActivity(), "tv_private_policy")){
 
-
+            new WvPageListDialog(getActivity(),ResourceUtil.getStyleId(getActivity(),"hnyy_base_dialog"), SdkPlatformImpl.initConfig.agreement_privacy).show();
 
         }else if(id == ResourceUtil.getId(getActivity(), "reg_compete_btn")){
 
             if (System.currentTimeMillis() - clickLoginTime < CLICK_INTERVAL) {
 
+                Logger.i("调用登录接口太频繁,拦截此次操作");
+
                 return;
             }
             clickLoginTime = System.currentTimeMillis();
@@ -92,9 +98,7 @@ public class UserPhoneLoginSetpwdFragment extends BaseFragment {
 
         }else if(id == ResourceUtil.getId(getActivity(), "close_btn")){
 
-            Fragment accountLoginFragment = FragmentUtils.getSdkFragment(getActivity(),FragmentUtils.SDK_PHONE_REGISTER_TAG);
-            replaceFragmentToActivity(getFragmentManager(),accountLoginFragment,ResourceUtil.getId(getActivity(),"hnyy_content"));
-
+            loginImpl.switchFragment(HNYYLoginFragmentTag.PAGE_PHONE_LOGIN,null);
 
         }
 
@@ -108,34 +112,53 @@ public class UserPhoneLoginSetpwdFragment extends BaseFragment {
 
         final String pwd = reg_pwd_edit.getText().toString();
 
-        String userInfo ="";
 
         if(account.length() < 10 || TextUtils.isEmpty(account))
         {
 
+            new TosUtil(getActivity(), TosUtil.TOAST_ERROR,getString(ResourceUtil.getStringId(getActivity(), "qj_pls_input_right_phone"))).show();
 
             return;
         }
         if(pwd.length() < 6 || TextUtils.isEmpty(pwd))
         {
 
-
+            new TosUtil(getActivity(),TosUtil.TOAST_ERROR, getString(ResourceUtil.getStringId(getActivity(), "qj_pwd_limit_6"))).show();
 
             return;
         }
         if(code.length() < 4 || TextUtils.isEmpty(code))
         {
+            new TosUtil(getActivity(),TosUtil.TOAST_ERROR, getString(ResourceUtil.getStringId(getActivity(), "qj_pls_input_right_code"))).show();
 
             return;
         }
 
         if (!cb_register.isChecked()){
 
+            new TosUtil(getActivity(), TosUtil.TOAST_ERROR,getString(ResourceUtil.getStringId(getActivity(), "qj_pls_checked_reg_tip"))).show();
+
 
             return;
 
         }
 
+        loginImpl.loginViewModel.setPassword(activity, account, pwd, code, new ICallback() {
+            @Override
+            public void onResult(int code, String result) {
+                if (code == ResultInfo.CODE_SUCCESS){
+                    if (!getActivity().isFinishing()) {
+                        getActivity().finish();
+                    }
+
+                }else{
+
+                    new TosUtil(getActivity(),TosUtil.TOAST_ERROR, result).show();
+
+                }
+
+            }
+        });
 
     }
 

+ 68 - 18
library_platform/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/fragment/UserRegisterFragment.java → library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserRegisterFragment.java

@@ -1,10 +1,9 @@
-package cn.yyxx.commsdk.platform.hnyy.fragment.fragment;
+package cn.yyxx.commsdk.platform.hnyy.fragment;
 
 
 
-import static cn.yyxx.commsdk.core.constants.Constants.CLICK_INTERVAL;
+import static cn.yyxx.commsdk.base.constants.Constants.CLICK_INTERVAL;
 
-import android.app.Fragment;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
@@ -21,15 +20,22 @@ import android.widget.ImageButton;
 import android.widget.ImageView;
 import android.widget.TextView;
 
+import java.util.Random;
+
+import cn.yyxx.commsdk.base.entity.ResultInfo;
+import cn.yyxx.commsdk.base.internal.ICallback;
 import cn.yyxx.commsdk.core.utils.ResourceUtil;
-import cn.yyxx.commsdk.platform.hnyy.fragment.fragment.widget.TosUtil;
+import cn.yyxx.commsdk.platform.hnyy.HNYYLoginFragmentTag;
+import cn.yyxx.commsdk.platform.hnyy.dialog.WvPageListDialog;
+import cn.yyxx.commsdk.platform.hnyy.fragment.widget.TosUtil;
+import cn.yyxx.commsdk.platform.hnyy.impl.SdkPlatformImpl;
 
 
 public class UserRegisterFragment extends BaseFragment {
     private EditText reg_account_edit,reg_pwd_edit;
     private ImageView iv_clear_text,iv_show_pwd;
     private TextView tv_tip,tv_private_policy;
-    private Button reg_compete_btn,btn_account_login,btn_guest_login;
+    private Button reg_compete_btn,btn_phone_register,btn_account_login;
     private ImageButton close_btn;
     private CheckBox cb_register;
     private boolean isShowPwd = true;
@@ -49,9 +55,14 @@ public class UserRegisterFragment extends BaseFragment {
         super.onViewCreated(view, savedInstanceState);
 
         reg_account_edit = view.findViewById(ResourceUtil.getId(getActivity(),"reg_account_edit"));
+
+
         reg_pwd_edit= view.findViewById(ResourceUtil.getId(getActivity(),"reg_pwd_edit"));
 
 
+        reg_account_edit.setText("yyz" + getRandom(7));
+
+        reg_pwd_edit.setText(getRandom(7));
 
 
         cb_register= view.findViewById(ResourceUtil.getId(getActivity(),"cb_register"));
@@ -71,12 +82,12 @@ public class UserRegisterFragment extends BaseFragment {
         reg_compete_btn = view.findViewById(ResourceUtil.getId(getActivity(),"reg_compete_btn"));
         reg_compete_btn.setOnClickListener(this);
 
+        btn_phone_register = view.findViewById(ResourceUtil.getId(getActivity(),"btn_phone_register"));
+        btn_phone_register.setOnClickListener(this);
+
         btn_account_login = view.findViewById(ResourceUtil.getId(getActivity(),"btn_account_login"));
         btn_account_login.setOnClickListener(this);
 
-        btn_guest_login = view.findViewById(ResourceUtil.getId(getActivity(),"btn_guest_login"));
-        btn_guest_login.setOnClickListener(this);
-
 
         close_btn = view.findViewById(ResourceUtil.getId(getActivity(),"close_btn"));
         close_btn.setOnClickListener(this);
@@ -89,7 +100,6 @@ public class UserRegisterFragment extends BaseFragment {
         int id = v.getId();
         if (id == ResourceUtil.getId(getActivity(), "reg_compete_btn")){
             if (System.currentTimeMillis() - clickLoginTime < CLICK_INTERVAL) {
-
                 return;
             }
             clickLoginTime = System.currentTimeMillis();
@@ -114,23 +124,26 @@ public class UserRegisterFragment extends BaseFragment {
         }else if(id == ResourceUtil.getId(getActivity(), "tv_tip")){
 
 
+            new WvPageListDialog(getActivity(),ResourceUtil.getStyleId(getActivity(),"hnyy_base_dialog"), SdkPlatformImpl.initConfig.agreement_user).show();
 
 
         }else if(id == ResourceUtil.getId(getActivity(), "tv_private_policy")){
 
+            new WvPageListDialog(getActivity(),ResourceUtil.getStyleId(getActivity(),"hnyy_base_dialog"), SdkPlatformImpl.initConfig.agreement_privacy).show();
 
 
+        }else if(id == ResourceUtil.getId(getActivity(), "btn_phone_register")){
+
+            loginImpl.switchFragment(HNYYLoginFragmentTag.PAGE_PHONE_LOGIN,null);
+
         }else if(id == ResourceUtil.getId(getActivity(), "btn_account_login")){
 
-            Fragment accountLoginFragment = FragmentUtils.getSdkFragment(getActivity(),FragmentUtils.SDK_PHONE_REGISTER_TAG);
-            replaceFragmentToActivity(getFragmentManager(),accountLoginFragment,ResourceUtil.getId(getActivity(),"hnyy_content"));
+            loginImpl.switchFragment(HNYYLoginFragmentTag.PAGE_ACCOUNT_LOGIN,null);
 
-        }else if(id == ResourceUtil.getId(getActivity(), "btn_guest_login")){
-            Fragment accountLoginFragment = FragmentUtils.getSdkFragment(getActivity(),FragmentUtils.SDK_LOGIN_TAG);
-            replaceFragmentToActivity(getFragmentManager(),accountLoginFragment,ResourceUtil.getId(getActivity(),"hnyy_content"));
         }else if(id == ResourceUtil.getId(getActivity(), "close_btn")){
-            Fragment accountLoginFragment = FragmentUtils.getSdkFragment(getActivity(),FragmentUtils.SDK_PHONE_REGISTER_TAG);
-            replaceFragmentToActivity(getFragmentManager(),accountLoginFragment,ResourceUtil.getId(getActivity(),"hnyy_content"));
+
+                loginImpl.switchFragment(HNYYLoginFragmentTag.PAGE_PHONE_LOGIN,null);
+
         }
     }
 
@@ -138,7 +151,7 @@ public class UserRegisterFragment extends BaseFragment {
 
 
 
-    private void startRegister(final String account, final String pwd) {
+    private void startRegister( String account,  String pwd) {
         if (!cb_register.isChecked()){
 
 
@@ -154,9 +167,13 @@ public class UserRegisterFragment extends BaseFragment {
 
         if (TextUtils.isEmpty(pwd)){
             new TosUtil(getActivity(),TosUtil.TOAST_ERROR,  getActivity().getString(ResourceUtil.getStringId(getActivity(), "hnyy_band_need_pwd"))).show();
+            return;
+        }
 
-
+        if (isNumeric(account)){
+            new TosUtil(getActivity(),TosUtil.TOAST_ERROR,  getActivity().getString(ResourceUtil.getStringId(getActivity(), "hnyy_acount_not_only_number"))).show();
             return;
+
         }
 
         if (account.length() < 6 || pwd.length() > 20) {
@@ -172,7 +189,40 @@ public class UserRegisterFragment extends BaseFragment {
             return;
         }
 
+        loginImpl.loginViewModel.accountRegister(getActivity(), account, pwd, new ICallback() {
+            @Override
+            public void onResult(int code, String result) {
+                if (code == ResultInfo.CODE_SUCCESS){
 
+                    if (!getActivity().isFinishing()) {
+                        getActivity().finish();
+                    }
+
+                }else{
+                    new TosUtil(getActivity(), TosUtil.TOAST_ERROR, result).show();
+                }
+            }
+        });
+
+
+    }
+
+      String getRandom(int length) {
+        String val = "";
+        Random random = new Random();
+        for (int i = 0; i < length; i++) {
+            val += String.valueOf(random.nextInt(10));
+        }
+        return val;
+    }
+
+     boolean isNumeric(String str){
+        for (int i = str.length();--i>=0;){
+            if (!Character.isDigit(str.charAt(i))){
+                return false;
+            }
+        }
+        return true;
     }
 
 }

+ 34 - 10
library_platform/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/fragment/UserRetrievePwdFragment.java → library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserRetrievePwdFragment.java

@@ -1,7 +1,6 @@
-package cn.yyxx.commsdk.platform.hnyy.fragment.fragment;
+package cn.yyxx.commsdk.platform.hnyy.fragment;
 
 import android.app.Activity;
-import android.app.Fragment;
 import android.os.Bundle;
 import android.os.CountDownTimer;
 import android.support.annotation.NonNull;
@@ -15,10 +14,13 @@ import android.widget.EditText;
 import android.widget.ImageButton;
 import android.widget.TextView;
 
-
-
+import cn.yyxx.commsdk.base.entity.ResultInfo;
+import cn.yyxx.commsdk.base.internal.ICallback;
 import cn.yyxx.commsdk.core.utils.ResourceUtil;
-import cn.yyxx.commsdk.platform.hnyy.fragment.fragment.widget.TosUtil;
+import cn.yyxx.commsdk.platform.hnyy.HNYYLoginFragmentTag;
+import cn.yyxx.commsdk.platform.hnyy.dialog.WvPageListDialog;
+import cn.yyxx.commsdk.platform.hnyy.fragment.widget.TosUtil;
+import cn.yyxx.commsdk.platform.hnyy.impl.SdkPlatformImpl;
 
 public class UserRetrievePwdFragment extends BaseFragment {
 
@@ -99,18 +101,28 @@ public class UserRetrievePwdFragment extends BaseFragment {
 
         }else if (id == ResourceUtil.getId(getActivity(), "close_btn")) {
 
-            Fragment accountLoginFragment = FragmentUtils.getSdkFragment(getActivity(),FragmentUtils.SDK_LOGIN_TAG);
-            replaceFragmentToActivity(getFragmentManager(),accountLoginFragment,ResourceUtil.getId(getActivity(),"hnyy_content"));
+            loginImpl.switchFragment(HNYYLoginFragmentTag.PAGE_ACCOUNT_LOGIN,null);
 
         }else if (id == ResourceUtil.getId(getActivity(), "tv_tip_2")) {
 
+            new WvPageListDialog(getActivity(),ResourceUtil.getStyleId(getActivity(),"hnyy_half_black_dialog"), SdkPlatformImpl.initConfig.service_center).show();
+
         }
 
     }
 
 
-    private void  getPhoneCaptcha(Activity activity, String phone, String action){
-
+    private void  getPhoneCaptcha(Activity activity, String phoneNum, String action){
+        loginImpl.loginViewModel.getPhoneCaptcha(activity, phoneNum, action, new ICallback() {
+            @Override
+            public void onResult(int code, String result) {
+                if (code == ResultInfo.CODE_SUCCESS){
+                    getCodeSuccess();
+                }else{
+                    new TosUtil(getActivity(), TosUtil.TOAST_ERROR, result).show();
+                }
+            }
+        });
     }
 
 
@@ -152,8 +164,20 @@ public class UserRetrievePwdFragment extends BaseFragment {
 
     }
 
-    private void resetPwdWithPhone(final Activity activity, final String phone, String code, final String pwd) {
+    private void resetPwdWithPhone(final Activity activity, final String phoneNum, String code, final String pwd) {
+        loginImpl.loginViewModel.resetPassword(activity,phoneNum,code,pwd, new ICallback() {
+            @Override
+            public void onResult(int code, String result) {
+                if (code == ResultInfo.CODE_SUCCESS){
+
+                    new TosUtil(getActivity(),TosUtil.TOAST_GREEN,  result).show();
 
+                    loginImpl.switchFragment(HNYYLoginFragmentTag.PAGE_ACCOUNT_LOGIN,null);
+                }else{
+                    new TosUtil(getActivity(),TosUtil.TOAST_ERROR,  result).show();
+                }
+            }
+        });
     }
 
 

+ 202 - 0
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/UserSwitchAccountLoginFragment.java

@@ -0,0 +1,202 @@
+package cn.yyxx.commsdk.platform.hnyy.fragment;
+
+
+import static cn.yyxx.commsdk.base.constants.Constants.CLICK_INTERVAL;
+
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import java.util.ArrayList;
+
+import cn.yyxx.commsdk.base.entity.ResultInfo;
+import cn.yyxx.commsdk.base.internal.ICallback;
+import cn.yyxx.commsdk.core.utils.ResourceUtil;
+import cn.yyxx.commsdk.platform.hnyy.HNYYLoginFragmentTag;
+import cn.yyxx.commsdk.platform.hnyy.fragment.widget.AccountLoginListView;
+import cn.yyxx.commsdk.platform.hnyy.fragment.widget.TosUtil;
+import cn.yyxx.commsdk.platform.user.UserSession;
+import cn.yyxx.commsdk.platform.user.UserSessionManager;
+
+public class UserSwitchAccountLoginFragment extends BaseFragment{
+
+    private TextView ib_edit_account,tv_other_login_type;
+
+    private AccountLoginListView all_item_1,all_item_2,all_item_3;
+
+
+    private boolean isEditStatus = false;
+
+    private long clickLoginTime = 0L;
+
+    @Nullable
+    @Override
+    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
+        View view = inflater.inflate(ResourceUtil.getLayoutId(getActivity(),"hnyy_switch_account_login"), container, false);
+        view.setClickable(true);
+        return view;
+
+    }
+
+    @Override
+    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
+        super.onViewCreated(view, savedInstanceState);
+        ib_edit_account = view.findViewById(ResourceUtil.getId(getActivity(),"ib_edit_account"));
+
+
+        all_item_1 = view.findViewById(ResourceUtil.getId(getActivity(),"all_item_1"));
+        all_item_2 = view.findViewById(ResourceUtil.getId(getActivity(),"all_item_2"));
+        all_item_3 = view.findViewById(ResourceUtil.getId(getActivity(),"all_item_3"));
+        all_item_1.setOnClickListener(this);
+        all_item_2.setOnClickListener(this);
+        all_item_3.setOnClickListener(this);
+        all_item_3.btn_common_use.setVisibility(View.GONE);
+
+
+        ib_edit_account.setOnClickListener(this);
+
+        tv_other_login_type = view.findViewById(ResourceUtil.getId(getActivity(),
+                "tv_other_login_type"));
+        tv_other_login_type.setOnClickListener(this);
+
+        getTopThirdUserInfo();
+
+    }
+
+    @Override
+    public void onClick(View v) {
+        super.onClick(v);
+        int id = v.getId();
+        if (id == ResourceUtil.getId(getActivity(), "ib_edit_account")) {
+            if (isEditStatus){
+
+                Drawable nav_up=getResources().getDrawable(ResourceUtil.getMipmapId(getActivity(),"hnyy_edit_account"));
+                nav_up.setBounds(0, 0, nav_up.getMinimumWidth(), nav_up.getMinimumHeight());
+                ib_edit_account.setCompoundDrawables(null, null, nav_up, null);
+                ib_edit_account.setText("");
+                isEditStatus = false;
+
+                all_item_1.btn_common_use.setVisibility(View.VISIBLE);
+                all_item_2.btn_common_use.setVisibility(View.VISIBLE);
+
+                all_item_1.btn_delete.setVisibility(View.GONE);
+                all_item_2.btn_delete.setVisibility(View.GONE);
+                all_item_3.btn_delete.setVisibility(View.GONE);
+
+
+                all_item_1.setClickable(true);
+                all_item_2.setClickable(true);
+                all_item_3.setClickable(true);
+
+            }else{
+                ib_edit_account.setCompoundDrawables(null, null, null, null);
+
+
+                ib_edit_account.setText(ResourceUtil.getStringId(getActivity(),"hnyy_commit_edit"));
+                isEditStatus = true;
+                all_item_1.btn_delete.setVisibility(View.VISIBLE);
+                all_item_2.btn_delete.setVisibility(View.VISIBLE);
+                all_item_3.btn_delete.setVisibility(View.VISIBLE);
+
+                all_item_1.btn_common_use.setVisibility(View.GONE);
+                all_item_2.btn_common_use.setVisibility(View.GONE);
+
+
+                all_item_1.setClickable(false);
+                all_item_2.setClickable(false);
+                all_item_3.setClickable(false);
+            }
+
+        }else  if (id == ResourceUtil.getId(getActivity(), "all_item_1")) {
+
+            startLogin(all_item_1.tv_account.getText().toString(),all_item_1.password,all_item_1.login_token);
+
+
+        }else  if (id == ResourceUtil.getId(getActivity(), "all_item_2")) {
+
+            startLogin(all_item_2.tv_account.getText().toString(),all_item_2.password,all_item_2.login_token);
+
+        }else  if (id == ResourceUtil.getId(getActivity(), "all_item_3")) {
+
+            startLogin(all_item_3.tv_account.getText().toString(),all_item_3.password,all_item_3.login_token);
+
+        }else  if (id == ResourceUtil.getId(getActivity(), "tv_other_login_type")) {
+            loginImpl.switchFragment(HNYYLoginFragmentTag.PAGE_PHONE_LOGIN,null);
+        }
+    }
+
+    private void startLogin(final String account, final String pwd,final String login_token){
+        if (System.currentTimeMillis() - clickLoginTime < CLICK_INTERVAL) {
+
+            return;
+        }
+        clickLoginTime = System.currentTimeMillis();
+
+        loginImpl.loginViewModel.accountLogin(getActivity(),account, pwd,login_token, new ICallback(){
+            @Override
+            public void onResult(int code, String result) {
+                if (code == ResultInfo.CODE_SUCCESS){
+                    if (!getActivity().isFinishing()) {
+                        getActivity().finish();
+                    }
+
+                }else{
+
+                    new TosUtil(getActivity(),TosUtil.TOAST_ERROR, result).show();
+
+                }
+            }
+        });
+
+    }
+
+    private void getTopThirdUserInfo() {
+
+        ArrayList<UserSession> sessions =  UserSessionManager.getInstance().getLocalSessionLimit3();
+
+        for (int i=0;i<sessions.size();i++){
+
+            if (i == 0){
+
+                setAccountLoginListView(all_item_1,sessions.get(i));
+
+            }else if(i == 1){
+
+                setAccountLoginListView(all_item_2,sessions.get(i));
+
+
+            }else if(i == 2){
+
+                setAccountLoginListView(all_item_3,sessions.get(i));
+
+            }
+        }
+
+    }
+
+    private void setAccountLoginListView(AccountLoginListView accountLoginListView,UserSession user){
+        accountLoginListView.setVisibility(View.VISIBLE);
+        accountLoginListView.tv_account.setText(user.uname);
+        accountLoginListView.password = user.password;
+        accountLoginListView.login_token = user.login_token;
+        if (isNumeric(user.uname)){
+            accountLoginListView.tv_account_type.setText(ResourceUtil.getStringId(getActivity(),"hnyy_phone_login_user"));
+            accountLoginListView.iv_account_icon.setImageResource(ResourceUtil.getMipmapId(getActivity(), "hnyy_phone_user"));
+        }
+
+    }
+
+
+    boolean isNumeric(String str){
+        for (int i = str.length();--i>=0;){
+            if (!Character.isDigit(str.charAt(i))){
+                return false;
+            }
+        }
+        return true;
+    }
+}

+ 91 - 0
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/widget/AccountLoginListView.java

@@ -0,0 +1,91 @@
+package cn.yyxx.commsdk.platform.hnyy.fragment.widget;
+
+import android.content.Context;
+import android.content.DialogInterface;
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import cn.yyxx.commsdk.core.utils.ResourceUtil;
+import cn.yyxx.commsdk.platform.hnyy.dialog.CustomExitGameDialog;
+import cn.yyxx.commsdk.platform.user.UserSessionManager;
+
+
+public class AccountLoginListView extends RelativeLayout {
+
+    public ImageView iv_account_icon;
+    public TextView tv_account_type,tv_account;
+    public Button btn_common_use,btn_delete;
+    public String password,login_token;
+    public AccountLoginListView(Context context) {
+        super(context);
+        intView(context);
+    }
+
+    public AccountLoginListView(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        intView(context);
+    }
+
+    public AccountLoginListView(Context context, AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+        intView(context);
+    }
+
+    void intView(final Context context){
+
+        LayoutInflater.from(context).inflate(ResourceUtil.getLayoutId(context,"hnyy_login_list"), this);
+        iv_account_icon = findViewById(ResourceUtil.getId(context,
+                "iv_account_icon"));
+        tv_account_type = findViewById(ResourceUtil.getId(context,
+                "tv_account_type"));
+        tv_account = findViewById(ResourceUtil.getId(context,
+                "tv_account"));
+        btn_common_use = findViewById(ResourceUtil.getId(context,
+                "btn_common_use"));
+        btn_delete = findViewById(ResourceUtil.getId(context,
+                "btn_delete"));
+        btn_delete.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+
+                CustomExitGameDialog.Builder builder = new CustomExitGameDialog.Builder(context);
+                builder.Create().show();
+                builder.setPositiveButton(new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialog, int which) {
+
+                        deleteItem(tv_account.getText().toString(),context);
+                        removeAllViews();
+
+
+                        dialog.dismiss();
+                    }
+                });
+                builder.setnegativeButton(new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialog, int which) {
+
+                        dialog.dismiss();
+                    }
+                });
+
+                builder.setTitle( context.getString(ResourceUtil.getStringId(context, "hnyy_delete_account_tip")) + tv_account.getText().toString());
+
+            }
+        });
+
+    }
+
+    private void deleteItem(String uname,Context context){
+
+
+        UserSessionManager.getInstance().removeSession(uname);
+
+    }
+
+}

+ 1 - 1
library_platform/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/fragment/widget/TosUtil.java → library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/fragment/widget/TosUtil.java

@@ -1,4 +1,4 @@
-package cn.yyxx.commsdk.platform.hnyy.fragment.fragment.widget;
+package cn.yyxx.commsdk.platform.hnyy.fragment.widget;
 
 import android.content.Context;
 import android.view.Gravity;

+ 193 - 0
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/impl/SdkPlatformImpl.java

@@ -0,0 +1,193 @@
+package cn.yyxx.commsdk.platform.hnyy.impl;
+
+import android.app.Activity;
+import android.app.Application;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.res.Configuration;
+import android.os.Bundle;
+
+import cn.yyxx.commsdk.base.entity.ResultInfo;
+import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
+import cn.yyxx.commsdk.base.entity.bean.InitBean;
+import cn.yyxx.commsdk.base.internal.ICallback;
+import cn.yyxx.commsdk.base.internal.feature.IApplication;
+import cn.yyxx.commsdk.base.internal.feature.IFeature;
+import cn.yyxx.commsdk.base.internal.feature.ILifeCycle;
+import cn.yyxx.commsdk.core.entity.SdkLoginInfo;
+import cn.yyxx.commsdk.core.utils.ResourceUtil;
+import cn.yyxx.commsdk.platform.PlatformSdk;
+import cn.yyxx.commsdk.platform.hnyy.HNYYLoginActivity;
+import cn.yyxx.commsdk.platform.hnyy.dialog.CustomExitGameDialog;
+import cn.yyxx.commsdk.platform.hnyy.floating.FloatViewManager;
+
+public class SdkPlatformImpl implements IFeature, ILifeCycle, IApplication {
+    public static InitBean initConfig = null ;
+
+    private static SdkPlatformImpl manager;
+
+
+    private  ICallback logoutCallback;
+
+    private Context context;
+
+    private static Activity activity;
+    public SdkPlatformImpl(Context context){
+        this.context = context;
+    }
+
+
+    @Override
+    public void attachBaseContext(Application application, Context context) {
+
+    }
+
+    @Override
+    public void initApplication(Application application) {
+
+    }
+
+    @Override
+    public void initialize(Activity activity, ICallback callback) {
+        this.activity = activity;
+    }
+
+    @Override
+    public void initializeSuccess() {
+    }
+
+    @Override
+    public void setLogoutListener(Activity activity, ICallback callback) {
+        logoutCallback = callback;
+    }
+
+    @Override
+    public void login(final Activity activity, InitBean initBean, final ICallback callback) {
+        initConfig  = initBean;
+        HNYYLoginActivity.start(activity,callback);
+    }
+
+    @Override
+    public void logout() {
+        SdkLoginInfo.getInstance().reset();
+        hideFloat();
+    }
+
+    @Override
+    public void charge(Activity activity, SdkChargeInfo chargeInfo, ICallback callback) {
+
+    }
+
+    @Override
+    public boolean hasExitView(Activity activity) {
+        return true;
+    }
+
+    @Override
+    public void openExitView(final Activity activity, final ICallback callback) {
+        if (hasExitView(activity)){
+
+            CustomExitGameDialog.Builder builder = new CustomExitGameDialog.Builder(activity);
+            builder.setPositiveButton(new DialogInterface.OnClickListener() {
+                @Override
+                public void onClick(DialogInterface dialog, int which) {
+
+                    callback.onResult(ResultInfo.CODE_SUCCESS,activity.getString(ResourceUtil.getStringId(activity,"hnyy_exit_game")));
+                    dialog.dismiss();
+                }
+            });
+            builder.setnegativeButton(new DialogInterface.OnClickListener() {
+                @Override
+                public void onClick(DialogInterface dialog, int which) {
+
+                    callback.onResult(ResultInfo.CODE_FAIL,activity.getString(ResourceUtil.getStringId(activity,"hnyy_continue_game")));
+
+                    dialog.dismiss();
+                }
+            });
+
+            builder.Create().show();
+        }else{
+            callback.onResult(ResultInfo.CODE_SUCCESS,activity.getString(ResourceUtil.getStringId(activity,"hnyy_open_cp_exit_view")));
+        }
+    }
+
+
+    public static SdkPlatformImpl getInstance(Context context){
+        if (manager == null) {
+            synchronized (PlatformSdk.class) {
+                if (manager == null) {
+                    manager = new SdkPlatformImpl(context);
+                }
+            }
+        }
+        return manager;
+    }
+
+    @Override
+    public void onStart(Activity activity) {
+
+    }
+
+    @Override
+    public void onResume(Activity activity) {
+
+    }
+
+    @Override
+    public void onReStart(Activity activity) {
+
+    }
+
+    @Override
+    public void onPause(Activity activity) {
+
+    }
+
+    @Override
+    public void onStop(Activity activity) {
+
+    }
+
+    @Override
+    public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
+
+    }
+
+    @Override
+    public void onNewIntent(Activity activity, Intent intent) {
+
+    }
+
+    @Override
+    public void onConfigurationChanged(Activity activity, Configuration newconfig) {
+
+    }
+
+    @Override
+    public void onWindowFocusChanged(Activity activity, boolean hasFocus) {
+
+    }
+
+    @Override
+    public void onDestroy(Activity activity) {
+        releaseFloat();
+    }
+
+    @Override
+    public void onCreate(Activity activity, Bundle savedInstanceState) {
+
+    }
+
+
+    public void showFloat(){
+        FloatViewManager.getInstance(activity).showFloat();
+    }
+    public void hideFloat(){
+        FloatViewManager.getInstance(activity).hideFloat();
+    }
+    public void releaseFloat(){
+        FloatViewManager.getInstance(activity).releaseFloat();
+    }
+}

+ 0 - 0
library_platform/src/main/res/anim/hnyy_rotate_anim.xml → library_platform/platform_hnyy/src/main/res/anim/hnyy_rotate_anim.xml


+ 0 - 0
library_platform/src/main/res/drawable/hnyy_btn_account_bg.xml → library_platform/platform_hnyy/src/main/res/drawable/hnyy_btn_account_bg.xml


+ 0 - 0
library_platform/src/main/res/drawable/hnyy_btn_exit_bg.xml → library_platform/platform_hnyy/src/main/res/drawable/hnyy_btn_exit_bg.xml


+ 0 - 0
library_platform/src/main/res/drawable/hnyy_btn_guest_bg.xml → library_platform/platform_hnyy/src/main/res/drawable/hnyy_btn_guest_bg.xml


+ 0 - 0
library_platform/src/main/res/drawable/hnyy_checkbox_select.xml → library_platform/platform_hnyy/src/main/res/drawable/hnyy_checkbox_select.xml


+ 0 - 0
library_platform/src/main/res/drawable/hnyy_color_white_40.xml → library_platform/platform_hnyy/src/main/res/drawable/hnyy_color_white_40.xml


+ 0 - 0
library_platform/src/main/res/drawable/hnyy_color_white_70.xml → library_platform/platform_hnyy/src/main/res/drawable/hnyy_color_white_70.xml


+ 0 - 0
library_platform/src/main/res/drawable/hnyy_common_wv_bg.xml → library_platform/platform_hnyy/src/main/res/drawable/hnyy_common_wv_bg.xml


+ 0 - 0
library_platform/src/main/res/drawable/hnyy_dialog_ios_bg.xml → library_platform/platform_hnyy/src/main/res/drawable/hnyy_dialog_ios_bg.xml


+ 0 - 0
library_platform/src/main/res/drawable/hnyy_edittext_bg.xml → library_platform/platform_hnyy/src/main/res/drawable/hnyy_edittext_bg.xml


+ 4 - 1
library_platform/src/main/res/drawable/hnyy_exit_bg.xml → library_platform/platform_hnyy/src/main/res/drawable/hnyy_exit_bg.xml

@@ -5,5 +5,8 @@
 
     <corners android:radius="2.5dp" />
 
-
+    <stroke
+        android:width="0.1dp"
+        android:color="@color/hnyy_edittext_bg_gray"
+        />
 </shape>

+ 0 - 0
library_platform/src/main/res/drawable/hnyy_game_float_menu_bg.xml → library_platform/platform_hnyy/src/main/res/drawable/hnyy_game_float_menu_bg.xml


+ 0 - 0
library_platform/src/main/res/drawable/hnyy_hide_float_view_bg.xml → library_platform/platform_hnyy/src/main/res/drawable/hnyy_hide_float_view_bg.xml


+ 0 - 0
library_platform/src/main/res/drawable/hnyy_login_bg.xml → library_platform/platform_hnyy/src/main/res/drawable/hnyy_login_bg.xml


Vissa filer visades inte eftersom för många filer har ändrats