Ver Fonte

备份奇境sdk

trevorHsu há 3 anos atrás
pai
commit
26668b3875
92 ficheiros alterados com 2125 adições e 1363 exclusões
  1. 1 1
      app/build.gradle
  2. 1 1
      app/src/main/AndroidManifest.xml
  3. 10 50
      app/src/main/java/constant/yysdk/com/main_yy_rh_sdk/MainActivity.java
  4. 1 1
      app/src/main/res/values/strings.xml
  5. 2 0
      hnqj/proguard-rules.pro
  6. 1 1
      hnqj/src/main/java/com/yyrh/constant/Constants.java
  7. 72 0
      hnqj/src/main/java/com/yyrh/constant/InitConfig.java
  8. 0 22
      hnqj/src/main/java/com/yyrh/constant/InitData.java
  9. 81 0
      hnqj/src/main/java/com/yyrh/constant/LoginData.java
  10. 4 4
      hnqj/src/main/java/com/yyrh/constant/SDKSettings.java
  11. 14 20
      hnqj/src/main/java/com/yyrh/constant/URLConstants.java
  12. 5 5
      hnqj/src/main/java/com/yyrh/factory/ChannelSdkOperation.java
  13. 34 0
      hnqj/src/main/java/com/yyrh/factory/SdkManager.java
  14. 74 69
      hnqj/src/main/java/com/yyrh/networking/NetRequestApi.java
  15. 2 1
      hnqj/src/main/java/com/yyrh/pay/PaymentNotify.java
  16. 98 46
      hnqj/src/main/java/com/yyrh/sdk/SDKEntry.java
  17. 19 0
      hnqj/src/main/java/com/yyrh/sdk/SdkCallback.java
  18. 107 173
      hnqj/src/main/java/com/yyrh/sdk/YyrhSdkManager.java
  19. 1 0
      hnqj/src/main/java/com/yyrh/sdk/callback/InitCallback.java
  20. 0 5
      hnqj/src/main/java/com/yyrh/sdk/callback/OpenFloatViewCallback.java
  21. 99 0
      hnqj/src/main/java/com/yyrh/ui/AccountLoginListView.java
  22. 11 3
      hnqj/src/main/java/com/yyrh/ui/PageJsInteraction.java
  23. 13 14
      hnqj/src/main/java/com/yyrh/ui/activity/UseLoginActivity.java
  24. 1 8
      hnqj/src/main/java/com/yyrh/ui/dialog/AutoLoginDialog.java
  25. 37 1
      hnqj/src/main/java/com/yyrh/ui/dialog/BaseDialog.java
  26. 10 7
      hnqj/src/main/java/com/yyrh/ui/dialog/CustomExitGameDialog.java
  27. 218 0
      hnqj/src/main/java/com/yyrh/ui/dialog/EmailDialog.java
  28. 1 1
      hnqj/src/main/java/com/yyrh/ui/dialog/GameSplashDialog.java
  29. 5 10
      hnqj/src/main/java/com/yyrh/ui/dialog/PrivacyPolicyDialog.java
  30. 1 1
      hnqj/src/main/java/com/yyrh/ui/dialog/SingleButtonDialog.java
  31. 279 0
      hnqj/src/main/java/com/yyrh/ui/dialog/UserCenterDialog.java
  32. 21 19
      hnqj/src/main/java/com/yyrh/ui/dialog/WvPageListDialog.java
  33. 5 8
      hnqj/src/main/java/com/yyrh/ui/dialog/WvPayYyrhDialog.java
  34. 164 388
      hnqj/src/main/java/com/yyrh/ui/floatmenu/FloatLogoMenu.java
  35. 3 311
      hnqj/src/main/java/com/yyrh/ui/floatmenu/FloatMenuView.java
  36. 98 0
      hnqj/src/main/java/com/yyrh/ui/floatmenu/FloatViewManager.java
  37. 3 7
      hnqj/src/main/java/com/yyrh/ui/fragment/BaseFragment.java
  38. 3 0
      hnqj/src/main/java/com/yyrh/ui/fragment/FragmentUtils.java
  39. 13 44
      hnqj/src/main/java/com/yyrh/ui/fragment/UserAccountLoginFragment.java
  40. 16 46
      hnqj/src/main/java/com/yyrh/ui/fragment/UserPhoneLoginFragment.java
  41. 15 45
      hnqj/src/main/java/com/yyrh/ui/fragment/UserRegisterFragment.java
  42. 3 8
      hnqj/src/main/java/com/yyrh/ui/fragment/UserRetrievePwdFragment.java
  43. 213 0
      hnqj/src/main/java/com/yyrh/ui/fragment/UserSwitchAccountLoginFragment.java
  44. 1 13
      hnqj/src/main/java/com/yyrh/ui/userlist/QjUserListAdapter.java
  45. 0 17
      hnqj/src/main/java/com/yyrh/utils/SwitchUtil.java
  46. 7 4
      hnqj/src/main/java/com/yythird/base/BaseSDK.java
  47. 3 3
      hnqj/src/main/java/com/yythird/sdk/ChannelSDK.java
  48. 11 0
      hnqj/src/main/res/drawable/qj_hide_float_view_bg.xml
  49. 5 0
      hnqj/src/main/res/drawable/qj_login_list_bg.xml
  50. 7 0
      hnqj/src/main/res/drawable/qj_login_list_btn_red_bg.xml
  51. 8 0
      hnqj/src/main/res/drawable/qj_login_list_btn_yellow_bg.xml
  52. 48 0
      hnqj/src/main/res/layout/qj_email_dialog.xml
  53. 1 0
      hnqj/src/main/res/layout/qj_exit_game_dialog.xml
  54. 16 0
      hnqj/src/main/res/layout/qj_hide_float_view.xml
  55. 63 0
      hnqj/src/main/res/layout/qj_login_list.xml
  56. 5 2
      hnqj/src/main/res/layout/qj_retrieve_pwd.xml
  57. 84 0
      hnqj/src/main/res/layout/qj_switch_account_login.xml
  58. 45 0
      hnqj/src/main/res/layout/qj_usercenter_dialog.xml
  59. 45 0
      hnqj/src/main/res/layout/qj_usercenter_portait_dialog.xml
  60. 0 1
      hnqj/src/main/res/layout/qj_webview_common_dialog.xml
  61. BIN
      hnqj/src/main/res/mipmap-xhdpi/qj_account_user.png
  62. BIN
      hnqj/src/main/res/mipmap-xhdpi/qj_edit_account.png
  63. BIN
      hnqj/src/main/res/mipmap-xhdpi/qj_hide_float_eye_view.png
  64. BIN
      hnqj/src/main/res/mipmap-xhdpi/qj_phone_user.png
  65. BIN
      hnqj/src/main/res/mipmap-xhdpi/qj_usercenter_close.png
  66. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_account_icon.png
  67. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_accoutn_del_x.png
  68. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_arrow_account.png
  69. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_arrow_normal.png
  70. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_arrow_select.png
  71. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_arrow_up_account.png
  72. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_back_btn.png
  73. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_bt_back_up.png
  74. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_close_btn.png
  75. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_eye_icon_normal.png
  76. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_eye_icon_select.png
  77. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_hide_pwd.png
  78. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_item_normal.png
  79. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_item_select.png
  80. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_lock.png
  81. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_name_icon.png
  82. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_phone_icon.png
  83. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_pwd_icon.png
  84. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_show_pwd.png
  85. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_tips_error.png
  86. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_tips_success.png
  87. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_trumpet.png
  88. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_user_head.png
  89. BIN
      hnqj/src/main/res/mipmap-xhdpi/yyrh_wv_close.png
  90. 5 0
      hnqj/src/main/res/values/colors.xml
  91. 12 2
      hnqj/src/main/res/values/strings.xml
  92. 0 1
      hnqj/src/main/res/values/styles.xml

+ 1 - 1
app/build.gradle

@@ -4,7 +4,7 @@ android {
     compileSdkVersion 28
     defaultConfig {
 
-        applicationId "com.fx.qyj2.gdtdevp100001.hnqj.portrait"
+        applicationId "com.fx.qyj2.gdtdevp100001.hnqj.landscape"
 
         minSdkVersion 15
         targetSdkVersion 26

+ 1 - 1
app/src/main/AndroidManifest.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="constant.yysdk.com.main_yy_rh_sdk">
-
+    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
 <!--    landscape -->
 <!--    portrait -->
     <application

+ 10 - 50
app/src/main/java/constant/yysdk/com/main_yy_rh_sdk/MainActivity.java

@@ -5,7 +5,6 @@ package constant.yysdk.com.main_yy_rh_sdk;
 import android.app.Activity;
 
 
-import android.content.DialogInterface;
 import android.content.Intent;
 
 
@@ -26,22 +25,16 @@ import android.widget.ScrollView;
 import android.widget.Toast;
 
 
-import com.yyrh.advertisement.AdvertiseManager;
 import com.yyrh.constant.RoleInfo;
 
 
+import com.yyrh.constant.SDKSettings;
 import com.yyrh.easypermission.EasyPermission;
 import com.yyrh.easypermission.GrantResult;
 import com.yyrh.easypermission.Permission;
 import com.yyrh.easypermission.PermissionRequestListener;
-import com.yyrh.sdk.callback.RealNameMsgCallback;
 
-import com.yyrh.sdk.callback.ShowPolicyCallback;
 import com.yyrh.sdk.callback.UserPolicyCallback;
-import com.yyrh.ui.AutoLoginDialog;
-import com.yyrh.ui.activity.UseLoginActivity;
-import com.yyrh.utils.InspectSimulator;
-
 
 
 import com.yyrh.constant.Constants;
@@ -52,13 +45,14 @@ import com.yyrh.sdk.callback.InitCallback;
 import com.yyrh.sdk.callback.LoginCallback;
 import com.yyrh.sdk.callback.LogoutCallback;
 import com.yyrh.sdk.callback.PayCallback;
-import com.yyrh.utils.ResourceUtil;
-import com.yyrh.utils.Utils;
+import com.yyrh.utils.YYLog;
 
 
 import org.json.JSONException;
 import org.json.JSONObject;
 
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -176,6 +170,8 @@ public class MainActivity extends Activity implements View.OnClickListener {
 
     private void init(Bundle savedInstanceState){
         //正式上线,需把isDebug 设置为false
+        ArrayList<String> list = new ArrayList(Arrays.asList(Permission.RECORD_AUDIO));
+        sdk.setExtPermission(list);
         sdk.initSdk(this, new InitCallback() {
             @Override
             public void onInitSuccess(String msg) {
@@ -298,8 +294,9 @@ public class MainActivity extends Activity implements View.OnClickListener {
                     sdk.login(this, new LoginCallback() {
                         @Override
                         public void onLoginSuccess(String token) {
+                            Toast.makeText(MainActivity.this, token, Toast.LENGTH_SHORT)
+                                    .show();
 
-                            Toast.makeText(MainActivity.this, "token:"+token, Toast.LENGTH_LONG).show();
                         }
 
                         @Override
@@ -316,49 +313,14 @@ public class MainActivity extends Activity implements View.OnClickListener {
 
                     break;
                 case R.id.logout_btn /*2131034178*/:
-                    String[]  permissions = new String[]{Permission.READ_PHONE_STATE,Permission.WRITE_EXTERNAL_STORAGE};
-                    EasyPermission.with(this)
-                            .addPermissions(permissions)          //申请打电话权限
-                            .request(new PermissionRequestListener() {
-                                @Override
-                                public void onGrant(Map<String, GrantResult> result) {
-                                    //权限申请返回
-
-                                }
-
-                                @Override
-                                public void onCancel(String stopPermission) {
-                                    //在addRequestPermissionRationaleHandler的处理函数里面调用了NextAction.next(NextActionType.STOP,就会中断申请过程,直接回调到这里来
-
-                                }
-                            });
+                     sdk.logout();
                     break;
                 default:
                     RoleInfo roleInfo;
                     StringBuilder stringBuilder2;
                     switch (id) {
                         case R.id.upload_btn /*2131034222*/:
-                            roleInfo = new RoleInfo();
-                            roleInfo.setRoleId(this.et_roleid.getText().toString());
-                            roleInfo.setRoleName(this.et_rolename.getText().toString());
-                            roleInfo.setRoleLevel(this.et_rolelevel.getText().toString());
-                            roleInfo.setGender(this.et_rolesex.getText().toString());
-                            roleInfo.setServerId(this.et_serveid.getText().toString());
-                            roleInfo.setServerName(this.et_servername.getText().toString());
-                            roleInfo.setHasGold(this.et_hasgold.getText().toString());
-                            roleInfo.setVipLevel(this.et_viplevel.getText().toString());
-                            roleInfo.setRolePower(this.et_rolepower.getText().toString());
-                            roleInfo.setPartyName(this.et_partyname.getText().toString());
-                            roleInfo.setPartyId(this.et_partyid.getText().toString());
-                            roleInfo.setRoleCreateTime(this.et_rolectime.getText().toString());
-                            roleInfo.setPartyId(this.et_partyid.getText().toString());
-                            roleInfo.setReincarnationCount(this.et_reincarnationrCount.getText().toString());
-                            roleInfo.setCharge(et_charge.getText().toString());
-                            this.sdk.upLoadRoleInfo(Constants.UPLOADTYPE_CREATEROLE, this, roleInfo);
-                            stringBuilder2 = new StringBuilder();
-                            stringBuilder2.append("roleInfo:=");
-                            stringBuilder2.append(roleInfo.getAllParam().toString());
-                            Toast.makeText(this, stringBuilder2.toString(), Toast.LENGTH_LONG).show();
+                            YYLog.i(SDKSettings.loginData.toString());
                             break;
                         case R.id.upload_btn1 /*2131034223*/:
                             roleInfo = new RoleInfo();
@@ -371,8 +333,6 @@ public class MainActivity extends Activity implements View.OnClickListener {
                             roleInfo.setHasGold(this.et_hasgold.getText().toString());
                             roleInfo.setVipLevel(this.et_viplevel.getText().toString());
                             roleInfo.setRolePower("7653471597");
-                            Integer i  = Integer.valueOf(roleInfo.getRolePower()).intValue();
-                            Log.i("",i+"");
                             roleInfo.setPartyId(this.et_partyid.getText().toString());
                             roleInfo.setPartyName(this.et_partyname.getText().toString());
                             roleInfo.setRoleCreateTime(this.et_rolectime.getText().toString());

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

@@ -1,6 +1,6 @@
 <resources>
 
-    <string name="app_name">海南奇境SDK_屏</string>
+    <string name="app_name">海南奇境SDK_屏</string>
 
 
 </resources>

+ 2 - 0
hnqj/proguard-rules.pro

@@ -135,5 +135,7 @@
 
 -keep class com.yyrh.advertisement.* {*; }
 -keep class com.yyrh.Version{*;}
+-keep class com.yyrh.easypermission.Permission{*;}
+
 
 -keep class com.yyrh.ui.PageJsInteraction{public <fields>; public <methods>;}

+ 1 - 1
hnqj/src/main/java/com/yyrh/constant/Constants.java

@@ -12,7 +12,7 @@ public class Constants {
     public static final String LOGOUT = "LOGOUT";
 
 
-
+    public static final long CLICK_INTERVAL = 2000L;
 
 
 

+ 72 - 0
hnqj/src/main/java/com/yyrh/constant/InitConfig.java

@@ -1,7 +1,79 @@
 package com.yyrh.constant;
 
+import android.text.TextUtils;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
 public class InitConfig {
 
     public static String fristShowPage = "";
 
+
+    public String agreement_privacy = "";
+
+    public String service_center = "";
+
+    public String agreement_user = "";
+
+    public JSONObject links = null;
+
+    public JSONArray reg_tabs = null;
+
+    public int sdk_login  = 1;
+
+    public int bswitch  = 0;
+
+    public static InitConfig toBean(JSONObject json){
+        if (TextUtils.isEmpty(json.toString())) {
+            return null;
+        }
+        InitConfig initConfig = new InitConfig();
+
+        initConfig.reg_tabs = json.optJSONArray("reg_tabs");
+        initConfig.sdk_login = json.optInt("sdk_login", 100);
+
+        initConfig.bswitch = json.optInt("bswitch");
+
+        if (initConfig.reg_tabs != null){
+
+            try {
+                if (initConfig.reg_tabs.get(0).toString().equals("phone")){
+                    InitConfig.fristShowPage = "phone";
+                }
+            } catch (JSONException e) {
+                e.printStackTrace();
+            }
+        }
+
+        initConfig.links = json.optJSONObject("links");
+
+        if (initConfig.links != null){
+
+
+            initConfig.agreement_privacy = initConfig.links.optString("agreement_privacy");
+            initConfig.service_center = initConfig.links.optString("service_center");
+            initConfig.agreement_user= initConfig.links.optString("agreement_user");
+        }
+
+
+
+
+        return initConfig;
+
+    }
+
+    @Override
+    public String toString() {
+        return "InitConfig{" +
+                "agreement_privacy='" + agreement_privacy + '\'' +
+                ", service_center='" + service_center + '\'' +
+                ", agreement_user='" + agreement_user + '\'' +
+                ", links=" + links +
+                ", reg_tabs=" + reg_tabs +
+                ", sdk_login=" + sdk_login +
+                ", bswitch=" + bswitch +
+                '}';
+    }
 }

+ 0 - 22
hnqj/src/main/java/com/yyrh/constant/InitData.java

@@ -1,22 +0,0 @@
-package com.yyrh.constant;
-
-public class InitData {
-    public String getReg_tabs_1() {
-        return reg_tabs_1;
-    }
-
-    public String getReg_tabs_2() {
-        return reg_tabs_2;
-    }
-
-    public void setReg_tabs_1(String reg_tabs_1) {
-        this.reg_tabs_1 = reg_tabs_1;
-    }
-
-    public void setReg_tabs_2(String reg_tabs_2) {
-        this.reg_tabs_2 = reg_tabs_2;
-    }
-
-    private String reg_tabs_1;
-    private String reg_tabs_2;
-}

+ 81 - 0
hnqj/src/main/java/com/yyrh/constant/LoginData.java

@@ -0,0 +1,81 @@
+package com.yyrh.constant;
+
+import android.text.TextUtils;
+
+import com.yyrh.utils.Utils;
+
+import org.json.JSONObject;
+
+public class LoginData {
+
+
+
+    public String uname = "";
+
+    public String token = "";
+
+    public String rn_bd = "";
+
+    public JSONObject links = null;
+
+    public String channel_uid = "";
+
+    public int is_rn = 0;
+
+
+    public String solo_email = "";
+
+    public String user_center = "";
+
+    public String authentication = "";
+
+
+    public static LoginData toBean(JSONObject json){
+        if (TextUtils.isEmpty(json.toString())) {
+            return null;
+        }
+        LoginData loginData = new LoginData();
+
+        loginData.token = json.optString("token");
+
+        loginData.uname = json.optString("uname");
+
+        loginData.channel_uid  = json.optString("channel_uid");
+
+        loginData.rn_bd = json.optString("rn_bd");
+
+        loginData.is_rn = json.optInt("is_rn");
+
+        loginData.links = json.optJSONObject("links");
+
+        if (loginData.links == null){
+            loginData.solo_email = "";
+            loginData.user_center = "";
+        }else {
+            loginData.solo_email = loginData.links.optString("solo_email");
+            loginData.user_center = loginData.links.optString("user_center");
+            loginData.authentication = loginData.links.optString("authentication");
+        }
+
+
+
+
+        return loginData;
+
+    }
+
+    @Override
+    public String toString() {
+        return "LoginData{" +
+                "uname='" + uname + '\'' +
+                ", token='" + token + '\'' +
+                ", rn_bd='" + rn_bd + '\'' +
+                ", links=" + links +
+                ", channel_uid='" + channel_uid + '\'' +
+                ", is_rn=" + is_rn +
+                ", solo_email='" + solo_email + '\'' +
+                ", user_center='" + user_center + '\'' +
+                ", authentication='" + authentication + '\'' +
+                '}';
+    }
+}

+ 4 - 4
hnqj/src/main/java/com/yyrh/constant/SDKSettings.java

@@ -32,9 +32,7 @@ public class SDKSettings {
     public static String SDK_VERSION = "1.0.4";
 
 
-    public static String UNAME = "";
-    public static String CHANNELUID = "";
-    public static String USER_BIRTHDAY = "";
+
 
 
     public static String LOGINTAG = Constants.LOGIN;
@@ -44,7 +42,6 @@ public class SDKSettings {
     public static boolean isLandscape = true; //用户中心功能
 
 
-
     public static boolean isOpenRealName = false;
 
     public static boolean isOpenFloatView = false;
@@ -55,6 +52,9 @@ public class SDKSettings {
 
     public static String o_cfg = "";
 
+    public static LoginData loginData = null;
+
+    public static InitConfig initConfig = null;
 
     public static void initSetting(Context context) {
 

+ 14 - 20
hnqj/src/main/java/com/yyrh/constant/URLConstants.java

@@ -7,30 +7,24 @@ public class URLConstants {
 
 
     //    public static final String BASEURL = "http://49.234.153.160";
-    public static final String  INIT = "/activate";
-
-    public static final String  FASTREGISTER = "/fast_register";
-    public static final String  USERLOGIN = "/user_login";
-    public static final String  UPLOADROLEINFO = "/report_role_info";
-    public static final String  RECHARGEINT = "/recharge_init";
-    public static final String  CHANNELLOGIN = "/channel_login";
-    public static final String  GETCAPTCHA = "/phone_captcha";
-    public static final String  REGISTERWITHPHONE = "/phone_register";
-    public static final String  RESETPWDWITHPHONE = "/phone_reset_pwd";
-    public static final String  REALNAMERECORD = "/user_rn_record";
-    public static final String  QUERYORDER = "/order_query";
-  	public static final String  AGREEMENTINIT = "/agreement_init";
-
-    public static final String  CHANNELZTAG = "YYRHSDK";
 
 
+    public static final String  INIT =BASEURL + "/activate";
+    public static final String  FASTREGISTER = BASEURL +  "/fast_register";
+    public static final String  USERLOGIN = BASEURL + "/user_login";
+    public static final String  UPLOADROLEINFO = BASEURL +  "/report_role_info";
+    public static final String  RECHARGEINT = BASEURL +  "/recharge_init";
+    public static final String  CHANNELLOGIN = BASEURL +  "/channel_login";
+    public static final String  GETCAPTCHA = BASEURL +  "/phone_captcha";
+    public static final String  REGISTERWITHPHONE = BASEURL +  "/phone_register";
+    public static final String  RESETPWDWITHPHONE = BASEURL +  "/phone_reset_pwd";
+    public static final String  REALNAMERECORD = BASEURL +  "/user_rn_record";
+    public static final String  QUERYORDER = BASEURL +  "/order_query";
+  	public static final String  AGREEMENTINIT = BASEURL +  "/agreement_init";
+    public static final String  PAYMENTWAY = BASEURL +  "/payment_way";
 
+    public static final String  CHANNELZTAG = "YYRHSDK";
 
-    public static final String  USERPOLICYWEB = "/#/agreement_privacy?";   //隐私协议
-    public static final String  USERCENTERLISTWEB = "/#/user_center?";  //用户中心
-    public static final String  USERPROTOCOLWEB = "/#/agreement_user?"; //用户协议
-    public static final String  USERBINDINFO = "/#/authentication?"; //实名认证
-    public static final String  CUSTOMER_SERVICE_URL = "/#/service_center?"; //客服
 
     public static final String  RSAKEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC3eXf1JxdFtx6c8AJTdlSverL8WqRE11yFB6Q+GbQeEVXjSCgQN48qePat7mXbH4LAtjaSEqXHruP4hJO8777wYtEKNKIN2VZgWQElrllAuAtaHyA+UGKwulOKmkR8k1Oxmfd46fnQBwzy+Giab4lqQRQAObCT0QtUrlrsU1U+zwIDAQAB";
 

+ 5 - 5
hnqj/src/main/java/com/yyrh/factory/ChannelSdkOperation.java

@@ -32,7 +32,7 @@ public class ChannelSdkOperation implements ISdkOperation {
 
     @Override
     public void login(Activity activity) {
-        channelSdk.SDKLogin(activity, SDKEntry.getSdkInstance().tCallBack);
+        channelSdk.SDKLogin(activity, SDKEntry.getSdkInstance().sdkCallback);
     }
 
     @Override
@@ -82,7 +82,7 @@ public class ChannelSdkOperation implements ISdkOperation {
     public void pay(Activity activity, HashMap<String, Object> map) {
 
         if (SDKSettings.isThirdPay){
-            channelSdk.SDKPay(activity, map, SDKEntry.getSdkInstance().tCallBack);
+            channelSdk.SDKPay(activity, map, SDKEntry.getSdkInstance().sdkCallback);
         }else{
             YyrhSdkManager.defaultManager(activity).yyrhPay(activity,map);
         }
@@ -91,7 +91,7 @@ public class ChannelSdkOperation implements ISdkOperation {
 
     @Override
     public void exit(Activity activity) {
-        channelSdk.SDKExit(activity, SDKEntry.getSdkInstance().tCallBack);
+        channelSdk.SDKExit(activity, SDKEntry.getSdkInstance().sdkCallback);
     }
 
     @Override
@@ -101,10 +101,10 @@ public class ChannelSdkOperation implements ISdkOperation {
 
     @Override
     public void getRealNameInfo(Activity activity, RealNameMsgCallback realNameMsgCallback) {
-        if (Utils.getTextIsNull(SDKSettings.USER_BIRTHDAY)) {
+        if (Utils.getTextIsNull(SDKSettings.loginData.rn_bd)) {
             ChannelSDK.getInstance().onGetChannelRealNameInfo(activity);
         } else {
-            realNameMsgCallback.onLoadRealNameMsg(true, SDKSettings.USER_BIRTHDAY);
+            realNameMsgCallback.onLoadRealNameMsg(true, SDKSettings.loginData.rn_bd);
         }
     }
 

+ 34 - 0
hnqj/src/main/java/com/yyrh/factory/SdkManager.java

@@ -7,19 +7,31 @@ import android.content.res.Configuration;
 import android.os.Bundle;
 
 import com.yyrh.constant.RoleInfo;
+import com.yyrh.networking.NetRequestApi;
+import com.yyrh.sdk.SDKEntry;
+import com.yyrh.sdk.YyrhSdkManager;
+import com.yyrh.sdk.callback.PayOrderCallback;
 import com.yyrh.sdk.callback.RealNameMsgCallback;
+import com.yyrh.utils.YYLog;
 import com.yythird.base.ChannelSdkCallback;
 
 import org.json.JSONObject;
 
 import java.util.HashMap;
 
+import static com.yyrh.constant.Constants.CLICK_INTERVAL;
+import static com.yyrh.constant.URLConstants.PAYMENTWAY;
+
 public class SdkManager {
 
     private static SdkManager manager = null;
 
     private ISdkOperation operation;
 
+
+
+    private long clickLoginTime = 0L;
+
     private SdkManager(Context context) {
         operation = SdkFactory.GetSdk(context);
     }
@@ -46,6 +58,12 @@ public class SdkManager {
     }
 
     public void login(Activity activity){
+
+        if (System.currentTimeMillis() - clickLoginTime < CLICK_INTERVAL) {
+            YYLog.i("调用登录接口太频繁,拦截此次操作");
+            return;
+        }
+        clickLoginTime = System.currentTimeMillis();
         operation.login(activity);
     }
 
@@ -59,6 +77,22 @@ public class SdkManager {
     public void pay(Activity activity, HashMap<String, Object> map){
         operation.pay(activity,map);
     }
+    public void forcePay(final Activity activity, HashMap<String, Object> map){
+
+        NetRequestApi.payOrderInit(PAYMENTWAY, map, activity, new PayOrderCallback() {
+            @Override
+            public void onPaySuccess(HashMap<String, Object> map) {
+
+                SDKEntry.getSdkInstance().adSdkCallback.onCreateOrder(map);
+                YyrhSdkManager.defaultManager(activity).yyrhPay(activity,map);
+            }
+
+            @Override
+            public void onPayFailed(String msg) {
+                SDKEntry.getSdkInstance().sdkCallback.onPayFinishCallback(false,msg);
+            }
+        });
+    }
     public void exit(Activity activity){
         operation.exit(activity);
     }

+ 74 - 69
hnqj/src/main/java/com/yyrh/networking/NetRequestApi.java

@@ -6,6 +6,8 @@ import android.os.Message;
 import android.widget.Toast;
 
 
+import com.yyrh.constant.InitConfig;
+import com.yyrh.constant.LoginData;
 import com.yyrh.pay.PaymentNotify;
 import com.yyrh.sdk.SDKEntry;
 import com.yyrh.sdk.callback.ShowPolicyCallback;
@@ -45,6 +47,7 @@ import static com.yyrh.constant.SDKSettings.channelTag;
 import static com.yyrh.constant.SDKSettings.isThirdLogin;
 import static com.yyrh.constant.SDKSettings.isThirdPay;
 
+import static com.yyrh.constant.SDKSettings.loginData;
 import static com.yyrh.constant.SDKSettings.order_ext;
 import static com.yyrh.constant.URLConstants.AGREEMENTINIT;
 import static com.yyrh.constant.URLConstants.BASEURL;
@@ -78,13 +81,13 @@ public class NetRequestApi {
         map.put("sign", paramSign);
 
 
-        String url = BASEURL + INIT;
+
 
         if (BASEURL.equals("http://testsdkapi.yyxxgame.com")) {
             Toast.makeText(activity, "正在使用测试环境,请勿上线" + BASEURL, Toast.LENGTH_SHORT).show();
         }
 
-        UrlHttpUtil.post(url, map, new CallBackUtil.CallBackString() {
+        UrlHttpUtil.post(INIT, map, new CallBackUtil.CallBackString() {
             @Override
             public void onFailure(int code, String errorMessage) {
                 ProgressDialogUtils.dismiss();
@@ -108,9 +111,10 @@ public class NetRequestApi {
                         return;
                     }
                     JSONObject data = json.getJSONObject("data");
-                    int state = data.optInt("sdk_login", 100);
 
-                    if (state == 1) {
+                    SDKSettings.initConfig = InitConfig.toBean(data);
+
+                    if (SDKSettings.initConfig.sdk_login == 1) {
                         if (channelTag.equals(CHANNELZTAG)) {
                             isThirdLogin = false;
                         } else {
@@ -119,14 +123,15 @@ public class NetRequestApi {
 
 
                     } else {
+
                         SDKSettings.UserCentUrl = data.optString("h5_web_host", "");
 
                         isThirdLogin = false;
                     }
 
 
-                    SwitchUtil.ControlKFSwitch(data.optInt("bswitch"));
-                    SwitchUtil.saveInitData(data.optJSONArray("reg_tabs"));
+                    SwitchUtil.ControlKFSwitch(SDKSettings.initConfig.bswitch);
+
                     YYLog.i("初始化成功。");
                     initCallback.onInitSuccess("init success");
 
@@ -166,9 +171,9 @@ public class NetRequestApi {
         String paramSign = SignUtils.paramSign(map, time);
         map.put("time", time);
         map.put("sign", paramSign);
-        String url = BASEURL + USERLOGIN;
 
-        UrlHttpUtil.post(url, map, new CallBackUtil.CallBackString() {
+
+        UrlHttpUtil.post(USERLOGIN, map, new CallBackUtil.CallBackString() {
             @Override
             public void onFailure(int code, String errorMessage) {
                 ProgressDialogUtils.dismiss();
@@ -198,23 +203,23 @@ public class NetRequestApi {
                     loginCallback.onLoginFailed(json.optString("msg", "登录失败"));
                     return;
                 }
-                String token = data.optString("token", "");
+
+                SDKSettings.loginData = LoginData.toBean(data);
+
+
 
 
-                SDKSettings.UNAME = data.optString("uname", "");
-                SDKSettings.CHANNELUID = data.optString("channel_uid", "");
-                SDKSettings.USER_BIRTHDAY = data.optString("rn_bd", "");
                 SDKSettings.LOGINTAG = LOGIN;
-                int is_rn = data.optInt("is_rn");
-                if (is_rn == 0) {
+
+                if (loginData.is_rn == 0) {
                     SDKSettings.isVefityRealName = false;
                 } else {
                     SDKSettings.isVefityRealName = true;
                 }
 
-                YYLog.i("登录成功。+ token:" + token);
+                YYLog.i("登录成功。+ token:" +  loginData.token);
 
-                loginCallback.onLoginSuccess(token);
+                loginCallback.onLoginSuccess(loginData.token);
 
             }
         });
@@ -253,9 +258,9 @@ public class NetRequestApi {
         map.put("sign", paramSign);
 
 
-        String url = BASEURL + FASTREGISTER;
 
-        UrlHttpUtil.post(url, map, new CallBackUtil.CallBackString() {
+
+        UrlHttpUtil.post(FASTREGISTER, map, new CallBackUtil.CallBackString() {
             @Override
             public void onFailure(int code, String errorMessage) {
                 ProgressDialogUtils.dismiss();
@@ -282,13 +287,15 @@ public class NetRequestApi {
                     registerCallback.onRegisterFailed(json.optString("msg", "注册失败"));
                     return;
                 }
-                String token = data.optString("token", "");
 
-                SDKSettings.UNAME = data.optString("uname", "");
-                SDKSettings.CHANNELUID = data.optString("channel_uid", "");
+                SDKSettings.loginData = LoginData.toBean(data);
+
+
+
 
-                YYLog.i("注册账号成功。 token:" + token);
-                registerCallback.onRegisterSuccess(token);
+
+                YYLog.i("注册账号成功。 token:" + loginData.token);
+                registerCallback.onRegisterSuccess(loginData.token);
 
             }
         });
@@ -311,9 +318,9 @@ public class NetRequestApi {
         map.put("time", time);
         map.put("sign", paramSign);
 
-        String url = BASEURL + CHANNELLOGIN;
 
-        UrlHttpUtil.post(url, map, new CallBackUtil.CallBackString() {
+
+        UrlHttpUtil.post(CHANNELLOGIN, map, new CallBackUtil.CallBackString() {
             @Override
             public void onFailure(int code, String errorMessage) {
                 ProgressDialogUtils.dismiss();
@@ -340,7 +347,7 @@ public class NetRequestApi {
                     data = json.getJSONObject("data");
                 } catch (JSONException e) {
                     e.printStackTrace();
-                    SDKEntry.getSdkInstance().tCallBack.onLoginChannelFail(errMsg);
+                    SDKEntry.getSdkInstance().sdkCallback.onLoginChannelFail(errMsg);
                     return;
                 }
                 int code = json.optInt("code", -1);
@@ -348,18 +355,17 @@ public class NetRequestApi {
                     YYLog.i("登录验证失败");
                     String msg = json.optString("msg", "登录验证失败");
                     loginCallback.onLoginFailed(msg);
-                    SDKEntry.getSdkInstance().tCallBack.onLoginChannelFail(msg);
+                    SDKEntry.getSdkInstance().sdkCallback.onLoginChannelFail(msg);
                     return;
                 }
-                String token = data.optString("token", "");
+                SDKSettings.loginData = LoginData.toBean(data);
+
+
 
-                SDKSettings.UNAME = data.optString("uname", "");
-                SDKSettings.CHANNELUID = data.optString("channel_uid", "");
-                SDKSettings.USER_BIRTHDAY = data.optString("rn_bd", "");
-                SDKEntry.getSdkInstance().tCallBack.onLoginChannelSuccess(data.toString());
-                YYLog.i("渠道登录验证成功。token:" + token);
+                SDKEntry.getSdkInstance().sdkCallback.onLoginChannelSuccess(data.toString());
+                YYLog.i("渠道登录验证成功。token:" + loginData.token);
 
-                loginCallback.onLoginSuccess(token);
+                loginCallback.onLoginSuccess(loginData.token);
             }
         });
 
@@ -386,14 +392,15 @@ public class NetRequestApi {
 
 
         if (createTime.length() != 10) {
+
             new TosUtil(activity, TosUtil.TOAST_ERROR, activity.getString(ResourceUtil.getStringId(activity, "qj_ctime_format_error"))).show();
 
             return;
         }
 
 
-        map.put("uname", SDKSettings.UNAME);
-        map.put("channel_uid", SDKSettings.CHANNELUID);
+        map.put("uname", loginData.uname);
+        map.put("channel_uid", loginData.channel_uid);
         map.put("party_id", partyId);
         map.put("party_name", partyName);
         map.put("server_id", serverId);
@@ -415,9 +422,9 @@ public class NetRequestApi {
         map.put("sign", paramSign);
 
 
-        String url = BASEURL + UPLOADROLEINFO;
 
-        UrlHttpUtil.post(url, map, new CallBackUtil.CallBackString() {
+
+        UrlHttpUtil.post(UPLOADROLEINFO, map, new CallBackUtil.CallBackString() {
             @Override
             public void onFailure(int code, String errorMessage) {
 
@@ -449,7 +456,7 @@ public class NetRequestApi {
 
     }
 
-    public static void payOrderInit(final HashMap<String, Object> map,
+    public static void payOrderInit(String url,final HashMap<String, Object> map,
                                     final Activity activity, final PayOrderCallback callback) {
 
 
@@ -496,8 +503,8 @@ public class NetRequestApi {
         HashMap<String, String> orderMap = getCommonParams();
 
 
-        orderMap.put("uname", SDKSettings.UNAME);
-        orderMap.put("channel_uid", SDKSettings.CHANNELUID);
+        orderMap.put("uname", loginData.uname);
+        orderMap.put("channel_uid", loginData.channel_uid);
         orderMap.put("cp_order_id", cp_order_id);
         orderMap.put("money", money);
         orderMap.put("server_id", server_id);
@@ -524,7 +531,7 @@ public class NetRequestApi {
         }
 
 
-        String url = BASEURL + RECHARGEINT;
+
 
         String time = SignUtils.toURLEncoded(System.currentTimeMillis() / 1000 + "");
         String paramSign = SignUtils.paramSign(orderMap, time);
@@ -601,9 +608,9 @@ public class NetRequestApi {
         map.put("time", time);
         map.put("sign", paramSign);
 
-        String url = BASEURL + GETCAPTCHA;
 
-        UrlHttpUtil.post(url, map, new CallBackUtil.CallBackString() {
+
+        UrlHttpUtil.post(GETCAPTCHA, map, new CallBackUtil.CallBackString() {
             @Override
             public void onFailure(int code, String errorMessage) {
                 ProgressDialogUtils.dismiss();
@@ -660,9 +667,9 @@ public class NetRequestApi {
         map.put("time", time);
         map.put("sign", paramSign);
 
-        String url = BASEURL + REGISTERWITHPHONE;
 
-        UrlHttpUtil.post(url, map, new CallBackUtil.CallBackString() {
+
+        UrlHttpUtil.post(REGISTERWITHPHONE, map, new CallBackUtil.CallBackString() {
             @Override
             public void onFailure(int code, String errorMessage) {
                 ProgressDialogUtils.dismiss();
@@ -692,14 +699,12 @@ public class NetRequestApi {
                     phoneRegisterCallback.onRegisterFailed(json.optString("msg", "手机注册失败"));
                     return;
                 }
-                String token = data.optString("token", "");
 
+                SDKSettings.loginData = LoginData.toBean(data);
 
-                SDKSettings.UNAME = data.optString("uname", "");
-                SDKSettings.CHANNELUID = data.optString("channel_uid", "");
 
-                YYLog.i("手机注册成功,正在登录游戏。+ token:" + token);
-                phoneRegisterCallback.onRegisterSuccess(token);
+                YYLog.i("手机注册成功,正在登录游戏。+ token:" + loginData.token);
+                phoneRegisterCallback.onRegisterSuccess(loginData.token);
             }
         });
     }
@@ -750,9 +755,9 @@ public class NetRequestApi {
         map.put("time", time);
         map.put("sign", paramSign);
 
-        String url = BASEURL + RESETPWDWITHPHONE;
 
-        UrlHttpUtil.post(url, map, new CallBackUtil.CallBackString() {
+
+        UrlHttpUtil.post(RESETPWDWITHPHONE, map, new CallBackUtil.CallBackString() {
             @Override
             public void onFailure(int code, String errorMessage) {
                 ProgressDialogUtils.dismiss();
@@ -796,8 +801,8 @@ public class NetRequestApi {
         HashMap<String, String> map = getCommonParams();
 
 
-        map.put("channel_uid", SignUtils.toURLEncoded(SDKSettings.CHANNELUID));
-        map.put("uname", SignUtils.toURLEncoded(SDKSettings.UNAME));
+        map.put("channel_uid", SignUtils.toURLEncoded(loginData.channel_uid));
+        map.put("uname", SignUtils.toURLEncoded(loginData.uname));
         map.put("report_type", report_type);
         map.put("sdk_params", channelRealNameInfo);
 
@@ -806,9 +811,9 @@ public class NetRequestApi {
         String paramSign = SignUtils.paramSign(map, time);
         map.put("time", time);
         map.put("sign", paramSign);
-        String url = BASEURL + REALNAMERECORD;
 
-        UrlHttpUtil.post(url, map, new CallBackUtil.CallBackString() {
+
+        UrlHttpUtil.post(REALNAMERECORD, map, new CallBackUtil.CallBackString() {
             @Override
             public void onFailure(int code, String errorMessage) {
                 ProgressDialogUtils.dismiss();
@@ -841,7 +846,7 @@ public class NetRequestApi {
                     } catch (JSONException e) {
                         e.printStackTrace();
                     }
-                    SDKSettings.USER_BIRTHDAY = rn_bd;
+                    loginData.rn_bd = rn_bd;
 
                 }
 
@@ -856,8 +861,8 @@ public class NetRequestApi {
         HashMap<String, String> map = getCommonParams();
 
 
-        map.put("channel_uid", SignUtils.toURLEncoded(SDKSettings.CHANNELUID));
-        map.put("uname", SignUtils.toURLEncoded(SDKSettings.UNAME));
+        map.put("channel_uid", SignUtils.toURLEncoded(loginData.channel_uid));
+        map.put("uname", SignUtils.toURLEncoded(loginData.uname));
         map.put("report_type", report_type);
         map.put("sdk_params", channelRealNameInfo);
 
@@ -867,9 +872,9 @@ public class NetRequestApi {
         map.put("time", time);
         map.put("sign", paramSign);
 
-        String url = BASEURL + REALNAMERECORD;
 
-        UrlHttpUtil.post(url, map, new CallBackUtil.CallBackString() {
+
+        UrlHttpUtil.post(REALNAMERECORD, map, new CallBackUtil.CallBackString() {
             @Override
             public void onFailure(int code, String errorMessage) {
                 ProgressDialogUtils.dismiss();
@@ -895,7 +900,7 @@ public class NetRequestApi {
                 int code = json.optInt("code", -1);
                 if (code != 1) {
 
-                    SDKEntry.getSdkInstance().realNameMsgCallback.onLoadRealNameMsg(false, "");
+                    SDKEntry.getSdkInstance().sdkCallback.realNameMsgCallback(false, "");
                 } else {
                     String rn_bd = "";
                     try {
@@ -904,8 +909,8 @@ public class NetRequestApi {
                     } catch (JSONException e) {
                         e.printStackTrace();
                     }
-                    SDKSettings.USER_BIRTHDAY = rn_bd;
-                    SDKEntry.getSdkInstance().realNameMsgCallback.onLoadRealNameMsg(true, rn_bd);
+                    loginData.rn_bd = rn_bd;
+                    SDKEntry.getSdkInstance().sdkCallback.realNameMsgCallback(true, rn_bd);
                 }
 
 
@@ -938,9 +943,9 @@ public class NetRequestApi {
         map.put("time", time);
         map.put("sign", paramSign);
 
-        String url = BASEURL + QUERYORDER;
 
-        UrlHttpUtil.post(url, map, new CallBackUtil.CallBackString() {
+
+        UrlHttpUtil.post(QUERYORDER, map, new CallBackUtil.CallBackString() {
             @Override
             public void onFailure(int code, String errorMessage) {
                 YYLog.i(errorMessage);
@@ -996,9 +1001,9 @@ public class NetRequestApi {
         map.put("time", time);
         map.put("sign", paramSign);
 
-        String url = BASEURL + AGREEMENTINIT;
 
-        UrlHttpUtil.post(url, map, new CallBackUtil.CallBackString() {
+
+        UrlHttpUtil.post(AGREEMENTINIT, map, new CallBackUtil.CallBackString() {
             @Override
             public void onFailure(int code, String errorMessage) {
 

+ 2 - 1
hnqj/src/main/java/com/yyrh/pay/PaymentNotify.java

@@ -109,7 +109,8 @@ public class PaymentNotify extends Handler {
 
                 }else{
 
-                    SDKEntry.getSdkInstance().payCall.onPaySuccess("pay success");
+                    SDKEntry.getSdkInstance().sdkCallback.onPayFinishCallback(true,"pay success");
+
                 }
             }
         });

+ 98 - 46
hnqj/src/main/java/com/yyrh/sdk/SDKEntry.java

@@ -5,7 +5,6 @@ import android.app.Activity;
 import android.content.Intent;
 
 
-import android.content.SharedPreferences;
 import android.content.res.Configuration;
 import android.os.Build;
 import android.os.Bundle;
@@ -19,7 +18,6 @@ import com.yyrh.constant.SDKSettings;
 import com.yyrh.factory.SdkManager;
 import com.yyrh.imei.ImeiUtil;
 import com.yyrh.sdk.callback.RealNameMsgCallback;
-import com.yyrh.sdk.callback.ShowPolicyCallback;
 import com.yyrh.sdk.callback.UserPolicyCallback;
 import com.yyrh.utils.PermissionUtils;
 import com.yyrh.utils.ResourceUtil;
@@ -31,9 +29,8 @@ import com.yyrh.easypermission.Permission;
 import com.yyrh.easypermission.PermissionRequestListener;
 
 
-import com.yyrh.ui.GameSplashDialog;
+import com.yyrh.ui.dialog.GameSplashDialog;
 import com.yyrh.utils.TosUtil;
-import com.yythird.base.ChannelSdkCallback;
 import com.yythird.sdk.ChannelSDK;
 import com.yyrh.utils.Utils;
 import com.yyrh.utils.YYLog;
@@ -51,24 +48,26 @@ import org.json.JSONObject;
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
-
-
-import static com.yyrh.constant.SDKSettings.sp_code;
+import static com.yyrh.constant.URLConstants.RECHARGEINT;
 
 
 public class SDKEntry {
 
-    public InitCallback initCall;
-    public LoginCallback loginCall;
-    public PayCallback payCall;
-    public LogoutCallback logoutCall;
-    public ExitCallback exitCall;
-    public RealNameMsgCallback realNameMsgCallback;
+    private InitCallback initCall;
+    private LoginCallback loginCall;
+    private PayCallback payCall;
+    private LogoutCallback logoutCall;
+    private ExitCallback exitCall;
+    private RealNameMsgCallback realNameMsgCallback;
     public Activity gameAct;
 
+    private UserPolicyCallback userPolicyCallback;
     private ChannelSDK sdk = null;
 
 
@@ -78,6 +77,9 @@ public class SDKEntry {
 
     private  String role_ctime="";
 
+    private List<String> permissionList=new ArrayList<String>(Arrays.asList(Permission.READ_PHONE_STATE,Permission.WRITE_EXTERNAL_STORAGE));
+
+    //广告操作回调
     public AdSdkCallback adSdkCallback = new AdSdkCallback() {
         @Override
         public void onRegisterSuccess(String msg) {
@@ -137,8 +139,9 @@ public class SDKEntry {
         }
     };
 
-    public ChannelSdkCallback tCallBack = new ChannelSdkCallback() {
 
+    //自有SDK回调
+    public SdkCallback sdkCallback = new SdkCallback() {
         @Override
         public void onSetChannelTagCallback(String msg) {
 
@@ -146,19 +149,16 @@ public class SDKEntry {
 
         @Override
         public void onInitCallback(boolean success, String msg) {
+            if (success){
+                initCall.onInitSuccess(msg);
 
-                if (success){
-                    initCall.onInitSuccess(msg);
-
-                }else{
-
-                    new TosUtil(gameAct,TosUtil.TOAST_ERROR, msg).show();
-
-                    initCall.onInitFailed(msg);
+            }else{
 
-                }
+                new TosUtil(gameAct,TosUtil.TOAST_ERROR, msg).show();
 
+                initCall.onInitFailed(msg);
 
+            }
 
         }
 
@@ -167,7 +167,6 @@ public class SDKEntry {
             NetRequestApi.loginWithChannel(gameAct,msg,loginCall);
         }
 
-
         @Override
         public void onLogOutCallback(String msg) {
             logoutCall.onLogoutSuccess();
@@ -180,36 +179,29 @@ public class SDKEntry {
             }else{
                 payCall.onPayFailed(msg);
             }
-
         }
 
-
         @Override
         public void onExiGameCallback(boolean success, String msg) {
             exitCall.onExit(true);
         }
 
-
-
-
         @Override
         public void onPayExtParamCallback(HashMap<String, String> payInfo, String url) {
             NetRequestApi.payChannelNotify(payInfo,url);
         }
 
         @Override
-        public void onGetChannelRealNameCallback(boolean isRealName, String report_type, String channelRealNameInfo) {
+        public void onGetChannelRealNameCallback(boolean isRealName, String report_type, String birthday) {
             if (isRealName){
-                NetRequestApi.recordUserRealNameInfo(gameAct,report_type,channelRealNameInfo);
+                NetRequestApi.recordUserRealNameInfo(gameAct,report_type,birthday);
             }else{
                 realNameMsgCallback.onLoadRealNameMsg(false,"");
             }
-
         }
 
         @Override
         public void onLoginChannelFail(String msg) {
-
             new TosUtil(gameAct,TosUtil.TOAST_ERROR,  msg).show();
             sdk.SDKLoginChannelFail(msg);
         }
@@ -220,7 +212,7 @@ public class SDKEntry {
         }
 
         @Override
-        public void onUploadUserRealNameInfo(String report_type,String msg) {
+        public void onUploadUserRealNameInfo(String report_type, String msg) {
             NetRequestApi.upLoadUserRealNameInfo(report_type,msg);
         }
 
@@ -255,15 +247,58 @@ public class SDKEntry {
 
         @Override
         public String onGetChannelUid() {
-            return SDKSettings.CHANNELUID;
+            return SDKSettings.loginData.channel_uid;
         }
 
         @Override
         public void onShowGameExit() {
             initCall.onShowGameExit();
         }
-    };
 
+        @Override
+        public void onShowPolicyAgree() {
+            userPolicyCallback.onAgree();
+        }
+
+        @Override
+        public void onShowPolicyDisagree() {
+            userPolicyCallback.onDisagree();
+        }
+
+        @Override
+        public void onShowPolicyHide() {
+            userPolicyCallback.onHide();
+        }
+
+        @Override
+        public void onShowPolicyError() {
+            userPolicyCallback.onError();
+        }
+
+        @Override
+        public void onLoginSuccess(String token) {
+            YYLog.i(SDKSettings.loginData.toString());
+            loginCall.onLoginSuccess(token);
+            SDKEntry.getSdkInstance().adSdkCallback.onLoginSuccess(SDKSettings.loginData.uname);
+        }
+
+        @Override
+        public void onLoginFailed(String msg) {
+            loginCall.onLoginFailed(msg);
+        }
+
+        @Override
+        public void onLoginError(String msg) {
+            loginCall.onLoginError(msg);
+        }
+
+        @Override
+        public void realNameMsgCallback(boolean isRealName, String birthday) {
+            realNameMsgCallback.onLoadRealNameMsg(isRealName,birthday);
+        }
+
+
+    };
     /**
      * 实现单例
      */
@@ -286,7 +321,7 @@ public class SDKEntry {
 
     public void showPrivacyPolicy(Activity activity, UserPolicyCallback userPolicyCallback){
 
-
+            this.userPolicyCallback = userPolicyCallback;
             YyrhSdkManager.defaultManager(activity).yyrhShowPolicy(activity,userPolicyCallback);
 
 
@@ -297,9 +332,11 @@ public class SDKEntry {
         this.initCall = callback;
         sdk = ChannelSDK.getInstance();
         manager = YyrhSdkManager.defaultManager(activity);
-        sdk.SDKInit(activity,tCallBack);
+        sdk.SDKInit(activity,sdkCallback);
+
 
         InputStream inputStream = null;
+
         try {
             inputStream = activity.getAssets().open("yyrh_start_image.jpg");
         } catch (IOException e) {
@@ -323,7 +360,9 @@ public class SDKEntry {
 				manager.yyrhInitDevice(activity, isDebug);
                  break;
              case -1 :
-                 String[]  permissions = new String[]{Permission.READ_PHONE_STATE,Permission.WRITE_EXTERNAL_STORAGE};
+
+                 String[]  permissions = permissionList.toArray(new String[permissionList.size()]);
+
                  EasyPermission.with(activity)
                          .addPermissions(permissions)          //申请打电话权限
                          .request(new PermissionRequestListener() {
@@ -347,11 +386,20 @@ public class SDKEntry {
 
     }
 
+    public void setExtPermission(ArrayList<String> extPermission){
+
+        if (extPermission != null){
+            for(String permission:extPermission){
+                permissionList.add(permission);
+            }
+        }
 
+    }
     public void login (Activity activity, LoginCallback callback){
 
 
         this.loginCall = callback;
+
         SdkManager.defaultManager(activity).login(activity);
 
     }
@@ -360,12 +408,19 @@ public class SDKEntry {
         this.payCall = callback;
         YYLog.i("payOrderInit");
         map.put("role_ctime",this.role_ctime);
-        if (SDKSettings.UNAME.equals("")){
+        if (SDKSettings.loginData.uname.equals("")){
+
             new TosUtil(activity,TosUtil.TOAST_ERROR, activity.getString(ResourceUtil.getStringId(activity, "qj_login2pay"))).show();
 
             return;
         }
-        NetRequestApi.payOrderInit(map, activity, new PayOrderCallback() {
+
+        if (sdk.SDKGetPstatus()){
+            SdkManager.defaultManager(activity).forcePay(activity,map);
+            return;
+        }
+
+        NetRequestApi.payOrderInit(RECHARGEINT,map, activity, new PayOrderCallback() {
 
 
             @Override
@@ -382,7 +437,6 @@ public class SDKEntry {
                 callback.onPayFailed(msg);
             }
 
-
         });
     }
 
@@ -390,7 +444,7 @@ public class SDKEntry {
     public void setSDKLogoutListener(Activity activity, final LogoutCallback callback) {
         YYLog.i("SDKLogoutListener");
         logoutCall = callback;
-        SdkManager.defaultManager(activity).setSDKLogoutListener(activity, tCallBack);
+        SdkManager.defaultManager(activity).setSDKLogoutListener(activity, sdkCallback);
     }
     public void logout(){
         YYLog.i("logout");
@@ -542,12 +596,10 @@ public class SDKEntry {
 
     public void getRealNameInfo(Activity activity, RealNameMsgCallback realNameMsgCallback){
         this.realNameMsgCallback = realNameMsgCallback;
-        if (Utils.getTextIsNull(SDKSettings.UNAME)){
+        if (Utils.getTextIsNull(SDKSettings.loginData.uname)){
             new TosUtil(activity,TosUtil.TOAST_ERROR,  activity.getString(ResourceUtil.getStringId(activity, "qj_login2pay"))).show();
             return;
         }
         SdkManager.defaultManager(gameAct).getRealNameInfo(activity, realNameMsgCallback);
     }
-
-
 }

+ 19 - 0
hnqj/src/main/java/com/yyrh/sdk/SdkCallback.java

@@ -0,0 +1,19 @@
+package com.yyrh.sdk;
+
+
+import com.yythird.base.ChannelSdkCallback;
+
+public interface SdkCallback extends ChannelSdkCallback {
+
+    void onShowPolicyAgree();
+    void onShowPolicyDisagree();
+    void onShowPolicyHide();
+    void onShowPolicyError();
+
+    void onLoginSuccess(String token);
+    void onLoginFailed(String msg);
+    void onLoginError(String msg);
+
+    void realNameMsgCallback(boolean isRealName,String birthday);
+
+}

+ 107 - 173
hnqj/src/main/java/com/yyrh/sdk/YyrhSdkManager.java

@@ -5,7 +5,6 @@ import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.SharedPreferences;
-import android.graphics.BitmapFactory;
 import android.os.Build;
 import android.os.Handler;
 import android.util.Log;
@@ -14,18 +13,17 @@ import com.yyrh.constant.InitConfig;
 import com.yyrh.constant.URLConstants;
 import com.yyrh.factory.SdkManager;
 import com.yyrh.imei.ImeiUtil;
-import com.yyrh.pay.WvPayYyrhDialog;
+import com.yyrh.ui.dialog.EmailDialog;
+import com.yyrh.ui.dialog.WvPayYyrhDialog;
 import com.yyrh.sdk.callback.RealNameMsgCallback;
 import com.yyrh.sdk.callback.ShowPolicyCallback;
 import com.yyrh.sdk.callback.UserPolicyCallback;
-import com.yyrh.ui.AutoLoginDialog;
-import com.yyrh.ui.PrivacyPolicyDialog;
-import com.yyrh.ui.SingleButtonDialog;
+import com.yyrh.ui.dialog.AutoLoginDialog;
+import com.yyrh.ui.dialog.PrivacyPolicyDialog;
+import com.yyrh.ui.dialog.SingleButtonDialog;
 import com.yyrh.ui.activity.UseLoginActivity;
-import com.yyrh.ui.floatmenu.FloatItem;
-import com.yyrh.ui.floatmenu.FloatLogoMenu;
-import com.yyrh.ui.floatmenu.FloatMenuView;
-import com.yyrh.ui.WvPageListDialog;
+import com.yyrh.ui.dialog.WvPageListDialog;
+import com.yyrh.ui.floatmenu.FloatViewManager;
 import com.yyrh.ui.fragment.FragmentUtils;
 import com.yyrh.ui.userlist.DatabaseHelper;
 import com.yyrh.utils.InspectSimulator;
@@ -35,11 +33,10 @@ import com.yyrh.constant.SDKSettings;
 import com.yyrh.networking.NetRequestApi;
 
 import com.yyrh.sdk.callback.InitCallback;
-import com.yyrh.ui.CustomExitGameDialog;
+import com.yyrh.ui.dialog.CustomExitGameDialog;
 import com.yyrh.utils.YYLog;
 import com.yythird.sdk.ChannelSDK;
 
-import java.util.ArrayList;
 import java.util.HashMap;
 
 
@@ -47,25 +44,22 @@ import java.util.HashMap;
 import static com.yyrh.constant.Constants.LOGOUT;
 
 
-import static com.yyrh.constant.SDKSettings.isOpenFloatView;
+
 import static com.yyrh.constant.SDKSettings.isOpenRealName;
 
 import static com.yyrh.constant.SDKSettings.isVefityRealName;
+import static com.yyrh.ui.floatmenu.FloatViewManager.DESTORY_FLOAT;
+import static com.yyrh.ui.floatmenu.FloatViewManager.SHOW_FLOAT;
 
 public class YyrhSdkManager {
     private static YyrhSdkManager manager = null;
 
 
-    FloatLogoMenu mFloatMenu;
-    String HOME = "用户中心";
-    String FEEDBACK = "切换账号";
-
 
-    String CLOSE = "隐藏";
-    String[] MENU_ITEMS = {HOME,FEEDBACK,CLOSE};
     private  Context context;
 
-    ArrayList<FloatItem> itemList = new ArrayList<>();
+
+
 
 
     private YyrhSdkManager(Context context) {
@@ -177,7 +171,7 @@ public class YyrhSdkManager {
             ChannelSDK.getInstance().SDKGetOaid();
         }else{
             SDKSettings.imei =  ImeiUtil.getImei(context);
-            SDKEntry.getSdkInstance().tCallBack.onGetOaidCallback(true,SDKSettings.imei);
+            SDKEntry.getSdkInstance().sdkCallback.onGetOaidCallback(true,SDKSettings.imei);
         }
 
 
@@ -193,7 +187,7 @@ public class YyrhSdkManager {
             public void onInitSuccess(String msg) {
                 SdkManager.defaultManager(activity).onInitSuccess(activity);
                 ChannelSDK.getInstance().SDKInitSuccess(msg);
-                SDKEntry.getSdkInstance().initCall.onInitSuccess(msg);
+                SDKEntry.getSdkInstance().sdkCallback.onInitCallback(true,msg);
 
             }
 
@@ -201,7 +195,7 @@ public class YyrhSdkManager {
             public void onInitFailed(String msg) {
 
                 ChannelSDK.getInstance().SDKInitFail(msg);
-                SDKEntry.getSdkInstance().initCall.onInitFailed(msg);
+                SDKEntry.getSdkInstance().sdkCallback.onInitCallback(false,msg);
 
                 SingleButtonDialog.Builder builder = new SingleButtonDialog.Builder(activity);
                 builder.setPositiveButton(new DialogInterface.OnClickListener() {
@@ -218,7 +212,7 @@ public class YyrhSdkManager {
             public void onInitError(String _strError) {
 
                 ChannelSDK.getInstance().SDKInitFail(_strError);
-                SDKEntry.getSdkInstance().initCall.onInitError(_strError);
+                SDKEntry.getSdkInstance().sdkCallback.onInitCallback(false,_strError);
 
                 SingleButtonDialog.Builder builder = new SingleButtonDialog.Builder(activity);
                 builder.setPositiveButton(new DialogInterface.OnClickListener() {
@@ -248,6 +242,7 @@ public class YyrhSdkManager {
         Log.i("idSimu:",SDKSettings.isSimulator);
     }
     public void yyrhLogin(Activity activity){
+        operateFloatViewInUIThread(activity,DESTORY_FLOAT);
         SharedPreferences sp = activity.getSharedPreferences("yyrh", Activity.MODE_PRIVATE);
         if (!Utils.judgeStrNull(sp.getString("username", "")) &&
                 !SDKSettings.LOGINTAG.equals(LOGOUT)) {
@@ -255,49 +250,41 @@ public class YyrhSdkManager {
 
         }else if (SDKSettings.LOGINTAG.equals(LOGOUT)){
 
-            showLoginView(activity);
+            showLoginView(activity,FragmentUtils.SDK_USER_SWITCH_ACCOUNT);
 
         } else {
 
-            showLoginDialog(activity);
-
-        }
-    }
+            if (InitConfig.fristShowPage.equals("phone")){
 
-    private void showLoginView(Activity activity) {
+                showLoginView(activity,FragmentUtils.SDK_PHONE_REGISTER_TAG);
 
-        destroyFloat();
-        Intent intent = new Intent(activity, UseLoginActivity.class);
-        intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
-        intent.putExtra("isLandscape", Utils.isLandscape(activity));
+            }else{
 
-        intent.putExtra("fragmentTag", FragmentUtils.SDK_LOGIN_TAG);
+                showLoginView(activity,FragmentUtils.SDK_REGISTER_TAG);
 
-        activity.startActivity(intent);
+            }
 
+        }
     }
 
-    private void showLoginDialog(Activity activity) {
-        destroyFloat();
-        Intent intent = new Intent(activity, UseLoginActivity.class);
-        intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
-        intent.putExtra("isLandscape", Utils.isLandscape(activity));
+    private void showLoginView(Activity activity,int type) {
 
-        if (InitConfig.fristShowPage.equals("phone")){
 
-            intent.putExtra("fragmentTag", FragmentUtils.SDK_PHONE_REGISTER_TAG);
 
-        }else{
+        Intent intent = new Intent(activity, UseLoginActivity.class);
+        intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
 
-            intent.putExtra("fragmentTag", FragmentUtils.SDK_REGISTER_TAG);
-        }
+        intent.putExtra("fragmentTag", type);
 
 
+        intent.putExtra("orientation", activity.getRequestedOrientation());
 
         activity.startActivity(intent);
 
     }
 
+
+
     private void autoLogin(final Activity activity) {
         AutoLoginDialog.Builder builder = new AutoLoginDialog.Builder(activity);
         builder.setPositiveButton(new DialogInterface.OnClickListener() {
@@ -306,105 +293,31 @@ public class YyrhSdkManager {
                 //取消回调
                 dialog.dismiss();
 
-                showLoginDialog(activity);
+                showLoginView(activity,FragmentUtils.SDK_USER_SWITCH_ACCOUNT);
 
             }
         }).setCloseDialogCallback(new AutoLoginDialog.CloseDialogCallback(){
 
             @Override
             public void onclose() {
-                //成功回调
-//                constantDialog.dismiss();
+
             }
         });
 
         builder.Create().show();
     }
     public void yyrhLogout(){
-        SDKSettings.CHANNELUID = "";
-        SDKSettings.UNAME = "";
-        SDKSettings.USER_BIRTHDAY = "";
-        Activity activity  = (Activity)context;
-        activity.runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                destroyFloat();
-            }
 
-        });
+        SDKSettings.loginData = null;
+        final Activity activity  = (Activity)context;
+
+        operateFloatViewInUIThread(activity,DESTORY_FLOAT);
 
         SDKSettings.LOGINTAG = LOGOUT;
-        SDKEntry.getSdkInstance().logoutCall.onLogoutSuccess();
+        SDKEntry.getSdkInstance().sdkCallback.onLogOutCallback("Game Logout.");
 
     }
-    public void yyrhOpenFloatView(final Activity activity){
-        if (isOpenFloatView != true){
-            return;
-        }
-        itemList.clear();
-
-        final int[] menuIcons = new int[]{ResourceUtil.getMipmapId(activity,"qj_user_center_icon"),ResourceUtil.getMipmapId(activity,"qj_switch_account_icon"), ResourceUtil.getMipmapId(activity,"qj_hide_icon")};
-
-
-
-        itemList.add(new FloatItem(MENU_ITEMS[0], 0x99000000, 0x99000000, BitmapFactory.decodeResource(activity.getResources(), menuIcons[0]), String.valueOf(0)));
-        itemList.add(new FloatItem(MENU_ITEMS[1], 0x99000000, 0x99000000, BitmapFactory.decodeResource(activity.getResources(), menuIcons[1]), String.valueOf(0)));
-        itemList.add(new FloatItem(MENU_ITEMS[2], 0x99000000, 0x99000000, BitmapFactory.decodeResource(activity.getResources(), menuIcons[2]), String.valueOf(0)));
-
-        if (mFloatMenu == null) {
-            mFloatMenu = new FloatLogoMenu.Builder()
-                    .withActivity(activity)
-//                    .withContext(mActivity.getApplication())//这个在7.0(包括7.0)以上以及大部分7.0以下的国产手机上需要用户授权,需要搭配<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
-                    .logo(BitmapFactory.decodeResource(activity.getResources(),ResourceUtil.getMipmapId(activity,"qj_float_icon")))
-                    .drawCicleMenuBg(true)
-                    .backMenuColor(0xffe4e3e1)
-                    .setBgDrawable(activity.getResources().getDrawable(ResourceUtil.getDrawableId(activity,"qj_game_float_menu_bg")))
-                    //这个背景色需要和logo的背景色一致
-                    .setFloatItems(itemList)
-                    .defaultLocation(FloatLogoMenu.LEFT)
-                    .drawRedPointNum(false)
-                    .showWithListener(new FloatMenuView.OnMenuClickListener() {
-                        @Override
-                        public void onItemClick(int position, String title) {
-
-                            itemList.set(position,new FloatItem(MENU_ITEMS[position], 0x99000000, 0x99000000, BitmapFactory.decodeResource(activity.getResources(), menuIcons[position]), String.valueOf(0)));
-
-                            if (title.equals(CLOSE)){
-                                destroyFloat();
-                                itemList.clear();
-
-                            }else if (title.equals(FEEDBACK)){
-                                yyrhLogout();
-                            }else if (title.equals(HOME)){
-                                HashMap<String,String> map = new HashMap<>();
-                                map.put("game_code",SDKSettings.game_code);
-                                map.put("gcp_code",SDKSettings.gcp_code);
-                                map.put("uname",SDKSettings.UNAME);
-                                String url  = Utils.getUserCententerUrl(URLConstants.USERCENTERLISTWEB,map);
 
-                                new WvPageListDialog(activity,ResourceUtil.getStyleId(activity,"qj_half_black_dialog"),url).show();
-                                mFloatMenu.hideMenu();
-                            }
-                            else{
-                                mFloatMenu.hide();
-                                mFloatMenu.show();
-
-                            }
-
-
-                        }
-
-                        @Override
-                        public void dismiss() {
-
-                        }
-                    });
-
-
-
-
-        }
-    }
 
 
     public void yyrhPay(Activity activity,HashMap<String, Object> map){
@@ -425,9 +338,12 @@ public class YyrhSdkManager {
         builder.setPositiveButton(new DialogInterface.OnClickListener() {
             @Override
             public void onClick(DialogInterface dialog, int which) {
+
+                FloatViewManager.defaultManager(activity).destroyFloat();
+
                 dialog.dismiss();
                 SDKEntry.getSdkInstance().adSdkCallback.onExitGame(activity);
-                SDKEntry.getSdkInstance().exitCall.onExit(true);
+                SDKEntry.getSdkInstance().sdkCallback.onExiGameCallback(true,"Exit Game.");
             }
         });
         builder.setnegativeButton(new DialogInterface.OnClickListener() {
@@ -471,48 +387,61 @@ public class YyrhSdkManager {
         if (isOpenRealName){
 
             if (!isVefityRealName){
-                HashMap<String,String> ifmap = new HashMap<>();
-                ifmap.put("game_code",SDKSettings.game_code);
-                ifmap.put("gcp_code",SDKSettings.gcp_code);
-                ifmap.put("uname",account);
-                String url  = Utils.getUserCententerUrl(URLConstants.USERBINDINFO,ifmap);
+
                 if (SDKSettings.isForceRealName){
-                    url = url + "&smrz=1";
-                    new WvPageListDialog(context, ResourceUtil.getStyleId(context, "qj_half_black_dialog"), url,
+
+                    new WvPageListDialog(context, ResourceUtil.getStyleId(context, "qj_half_black_dialog"), SDKSettings.loginData.authentication,
                             new WvPageListDialog.OnClosePageListener() {
                                 @Override
                                 public void onClose() {
-                                    if (SDKSettings.USER_BIRTHDAY.equals("")){
-                                        SDKSettings.CHANNELUID = "";
-                                        SDKSettings.UNAME = "";
+
+                                    if (SDKSettings.loginData.rn_bd.equals("")){
+
+                                        SDKSettings.loginData = null;
 
                                     }
 
                                 }
 
+                                @Override
+                                public void onDissmiss() {
+                                    operateFloatViewInUIThread((Activity)context,SHOW_FLOAT);
+                                    openEmaiDialogInUIThread((Activity) context);
+                                }
+
+
                                 @Override
                                 public void onRealNameSuccess(String birthday) {
-                                    openFloatViewInUIThread((Activity) context);
-                                    SDKEntry.getSdkInstance().loginCall.onLoginSuccess(token);
-                                    SDKEntry.getSdkInstance().adSdkCallback.onLoginSuccess(account);
+
+
+                                    SDKEntry.getSdkInstance().sdkCallback.onLoginSuccess(token);
+
 
 
                                 }
                             },SDKSettings.isForceRealName).show();
                 }else {
-                    new WvPageListDialog(context, ResourceUtil.getStyleId(context, "qj_half_black_dialog"), url,
+                    new WvPageListDialog(context, ResourceUtil.getStyleId(context, "qj_half_black_dialog"), SDKSettings.loginData.authentication,
                                  new WvPageListDialog.OnClosePageListener() {
                                      @Override
                                      public void onClose() {
-                                         openFloatViewInUIThread((Activity) context);
-                                         SDKEntry.getSdkInstance().loginCall.onLoginSuccess(token);
-                                         SDKEntry.getSdkInstance().adSdkCallback.onLoginSuccess(account);
+
+                                         SDKEntry.getSdkInstance().sdkCallback.onLoginSuccess(token);
+
 
                                      }
 
+                                     @Override
+                                     public void onDissmiss() {
+                                         operateFloatViewInUIThread((Activity)context,SHOW_FLOAT);
+                                         openEmaiDialogInUIThread((Activity) context);
+                                     }
+
+
                                      @Override
                                      public void onRealNameSuccess(String birthday) {
                                          YYLog.i("onRealNameSuccess");
+
                                      }
                                  }).show();
 
@@ -520,66 +449,71 @@ public class YyrhSdkManager {
                 }
 
             }else {
-                openFloatViewInUIThread((Activity) context);
-                SDKEntry.getSdkInstance().loginCall.onLoginSuccess(token);
-                SDKEntry.getSdkInstance().adSdkCallback.onLoginSuccess(account);
-            }
+
+                operateFloatViewInUIThread((Activity)context,SHOW_FLOAT);
+                SDKEntry.getSdkInstance().sdkCallback.onLoginSuccess(token);
+
+
+                }
 
         }else{
-            openFloatViewInUIThread((Activity) context);
-            SDKEntry.getSdkInstance().loginCall.onLoginSuccess(token);
-        }
+            operateFloatViewInUIThread((Activity)context,SHOW_FLOAT);
+            SDKEntry.getSdkInstance().sdkCallback.onLoginSuccess(token);
+         }
 }
 
+
     public void yyrhGetRealNameInfo(Activity activity,RealNameMsgCallback msgCallback){
 
-        if(Utils.getTextIsNull(SDKSettings.USER_BIRTHDAY)){
+        if(Utils.getTextIsNull(SDKSettings.loginData.rn_bd)){
             msgCallback.onLoadRealNameMsg(false,"");
         }else{
-            msgCallback.onLoadRealNameMsg(true,SDKSettings.USER_BIRTHDAY);
+            msgCallback.onLoadRealNameMsg(true,SDKSettings.loginData.rn_bd);
         }
 
     }
-    private void openFloatViewInUIThread(final Activity gameAct){
+    private void operateFloatViewInUIThread(final Activity gameAct, final int status){
         gameAct.runOnUiThread(new Runnable() {
             @Override
             public void run() {
+                if (status == SHOW_FLOAT){
+                    FloatViewManager.defaultManager(gameAct).showFloat();
+                }else if(status == DESTORY_FLOAT){
+                    FloatViewManager.defaultManager(gameAct).destroyFloat();
+                }
+
 
-                YyrhSdkManager.defaultManager(gameAct).yyrhOpenFloatView(gameAct);
             }
         });
     }
 
+    private void openEmaiDialogInUIThread(final Activity gameAct){
+        if (Utils.judgeStrNull(SDKSettings.loginData.solo_email)){
+            return;
+        }
+        gameAct.runOnUiThread(new Runnable() {
+            @Override
+            public void run() {
+
+                new EmailDialog(context, ResourceUtil.getStyleId(context, "qj_half_black_dialog"),SDKSettings.loginData.solo_email).show();
+
+            }
+        });
+    }
     public void onResume(Activity activity){
 
-        if (mFloatMenu != null) {
 
-            mFloatMenu.show();
-        }
 
     }
     public void onPause(Activity activity){
 
-        hideFloat();
+
     }
     public void onDestroy(Activity activity){
-        itemList.clear();
-        mFloatMenu = null;
 
     }
 
-    public void hideFloat() {
-        if (mFloatMenu != null) {
-            mFloatMenu.hide();
-        }
-    }
 
-    public void destroyFloat() {
-        if (mFloatMenu != null) {
-            mFloatMenu.destoryFloat();
-        }
-        itemList.clear();
-        mFloatMenu = null;
 
-    }
+
 }

+ 1 - 0
hnqj/src/main/java/com/yyrh/sdk/callback/InitCallback.java

@@ -7,4 +7,5 @@ public interface InitCallback {
     public void onInitError(String _strError);
     public void onGetOaid(boolean isSuccess,String oaid);
     public void onShowGameExit();
+
 }

+ 0 - 5
hnqj/src/main/java/com/yyrh/sdk/callback/OpenFloatViewCallback.java

@@ -1,5 +0,0 @@
-package com.yyrh.sdk.callback;
-
-public interface OpenFloatViewCallback {
-    public void isOpen(boolean isOpen,String msg);
-}

+ 99 - 0
hnqj/src/main/java/com/yyrh/ui/AccountLoginListView.java

@@ -0,0 +1,99 @@
+package com.yyrh.ui;
+
+import android.content.Context;
+import android.content.DialogInterface;
+import android.database.sqlite.SQLiteDatabase;
+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 com.yyrh.ui.dialog.CustomExitGameDialog;
+
+import com.yyrh.ui.userlist.DatabaseHelper;
+import com.yyrh.utils.ResourceUtil;
+
+
+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;
+    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,"qj_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, "qj_delete_account_tip")) + tv_account.getText().toString());
+
+            }
+        });
+
+    }
+
+    private void deleteItem(String uname,Context context){
+
+
+        DatabaseHelper dbHelper = new DatabaseHelper(context);
+        SQLiteDatabase db = null;
+        db = dbHelper.getReadableDatabase();
+        String sql = "delete from user where name = '"+uname+"'";
+        //执行SQL语句
+        db.execSQL(sql);
+        db.close();
+
+    }
+
+}

+ 11 - 3
hnqj/src/main/java/com/yyrh/ui/PageJsInteraction.java

@@ -1,11 +1,9 @@
 package com.yyrh.ui;
 
 
-import android.content.Intent;
-import android.util.Log;
 import android.webkit.JavascriptInterface;
 
-import java.net.URISyntaxException;
+import com.yyrh.ui.dialog.BaseDialog;
 
 
 public class PageJsInteraction {
@@ -14,6 +12,7 @@ public class PageJsInteraction {
     public PageJsInteraction(BaseDialog baseDialog) {
 
         this.baseDialog =baseDialog;
+
     }
 
 
@@ -49,4 +48,13 @@ public class PageJsInteraction {
         this.baseDialog.openq0q0(url);
     }
 
+    @JavascriptInterface
+    public String webExt() {
+        return this.baseDialog.webExt();
+    }
+
+    @JavascriptInterface
+    public void switchAccount() {
+         this.baseDialog.switchAccount();
+    }
 }

+ 13 - 14
hnqj/src/main/java/com/yyrh/ui/activity/UseLoginActivity.java

@@ -2,7 +2,7 @@ package com.yyrh.ui.activity;
 
 
 
-import android.app.Activity;
+
 import android.app.Fragment;
 import android.content.Context;
 import android.content.Intent;
@@ -10,14 +10,16 @@ import android.content.pm.ActivityInfo;
 import android.os.Bundle;
 import android.support.annotation.Nullable;
 import android.view.KeyEvent;
-import android.view.Window;
+
 import android.widget.FrameLayout;
 
 
-import com.yyrh.constant.SDKSettings;
+
 import com.yyrh.ui.fragment.FragmentUtils;
 import com.yyrh.utils.ResourceUtil;
-import com.yyrh.utils.Utils;
+
+import static com.yyrh.constant.SDKSettings.isLandscape;
+
 
 public class UseLoginActivity extends BaseActivity {
 
@@ -29,21 +31,18 @@ public class UseLoginActivity extends BaseActivity {
     }
     private void initView(Context context){
         Intent intent = getIntent();
-        boolean isLandscape =intent.getBooleanExtra("isLandscape",true);
+
         int fragmentTag  =intent.getIntExtra("fragmentTag",FragmentUtils.SDK_REGISTER_TAG);
+        int orientation  =intent.getIntExtra("orientation",FragmentUtils.SDK_REGISTER_TAG);
+
         Fragment mJmUserLoginFragment = FragmentUtils.getSdkFragment(context,fragmentTag);
 
 
         FrameLayout layout = findViewById(ResourceUtil.getId(this,"qj_content"));
-
-        if (isLandscape){
-            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
-        }else{
-            Float x = Float.valueOf("0.9").floatValue();
-            Float y = Float.valueOf("0.9").floatValue();
-            layout.setScaleX(x);
-            layout.setScaleY(y);
-            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
+        setRequestedOrientation(orientation);
+        if (!isLandscape){
+            layout.setScaleX(0.9f);
+            layout.setScaleY(0.9f);
         }
 
 

+ 1 - 8
hnqj/src/main/java/com/yyrh/ui/AutoLoginDialog.java → hnqj/src/main/java/com/yyrh/ui/dialog/AutoLoginDialog.java

@@ -1,4 +1,4 @@
-package com.yyrh.ui;
+package com.yyrh.ui.dialog;
 
 import android.app.Activity;
 import android.app.Dialog;
@@ -12,10 +12,6 @@ import android.view.View;
 import android.view.ViewGroup;
 import android.view.Window;
 import android.view.WindowManager;
-import android.view.animation.Animation;
-import android.view.animation.AnimationUtils;
-import android.widget.Button;
-import android.widget.ImageView;
 import android.widget.TextView;
 
 import com.yyrh.networking.NetRequestApi;
@@ -126,9 +122,6 @@ public class AutoLoginDialog extends Dialog {
 					@Override
 					public void onLoginSuccess(String token) {
 
-
-
-
 						closeDialogCallback.onclose();
 
 						YyrhSdkManager.defaultManager(context).saveUserLoginInfo(context,account,pwd,token);

+ 37 - 1
hnqj/src/main/java/com/yyrh/ui/BaseDialog.java → hnqj/src/main/java/com/yyrh/ui/dialog/BaseDialog.java

@@ -1,4 +1,4 @@
-package com.yyrh.ui;
+package com.yyrh.ui.dialog;
 
 
 import android.app.Dialog;
@@ -11,10 +11,16 @@ import android.util.Log;
 import android.webkit.JavascriptInterface;
 
 
+import com.yyrh.constant.SDKSettings;
 import com.yyrh.utils.YYLog;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import java.net.URISyntaxException;
 
+import static com.yyrh.constant.SDKSettings.isLandscape;
+
 
 public class BaseDialog extends Dialog {
 
@@ -57,5 +63,35 @@ public class BaseDialog extends Dialog {
         YYLog.i("openq0q0:" + url);
 
     }
+    public void switchAccount()  {
+
+        YYLog.i("switchAccount");
+
+    }
+    @JavascriptInterface
+    public String webExt(){
+
+        JSONObject json = new JSONObject();
+
+
+        try {
+            if (isLandscape){
 
+                json.put("orientation","landscape");
+
+            }else{
+
+                json.put("orientation","portrait");
+
+            }
+
+            json.put("version", SDKSettings.SDK_VERSION);
+
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+
+        YYLog.i("webExt : " + json.toString());
+        return json.toString();
+    }
 }

+ 10 - 7
hnqj/src/main/java/com/yyrh/ui/CustomExitGameDialog.java → hnqj/src/main/java/com/yyrh/ui/dialog/CustomExitGameDialog.java

@@ -1,4 +1,4 @@
-package com.yyrh.ui;
+package com.yyrh.ui.dialog;
 
 import android.app.Dialog;
 import android.content.Context;
@@ -8,8 +8,8 @@ import android.view.View;
 import android.view.ViewGroup;
 import android.widget.Button;
 import android.widget.LinearLayout;
+import android.widget.TextView;
 
-import com.yyrh.constant.SDKSettings;
 import com.yyrh.utils.ResourceUtil;
 
 import static com.yyrh.constant.SDKSettings.isLandscape;
@@ -19,7 +19,7 @@ public class CustomExitGameDialog extends Dialog {
 
 	private	static Button bt_exit_game;
 	private static Button bt_goon_game;
-
+	private static TextView qj_issure_exit;
 	private static CustomExitGameDialog dialog;
 
 	public CustomExitGameDialog(Context context, int theme) {
@@ -39,6 +39,9 @@ public class CustomExitGameDialog extends Dialog {
 			this.negativeButtonClickListener = listener;
 			return this;
 		}
+		public void setTitle(String title){
+			qj_issure_exit.setText(title);
+		}
 		public void  dialogDismiss(){dialog.dismiss();}
 		public CustomExitGameDialog Create(){
 			{
@@ -51,10 +54,8 @@ public class CustomExitGameDialog extends Dialog {
 
 				if (!isLandscape){
 					LinearLayout ll_exit_game = layout.findViewById(ResourceUtil.getId(context, "ll_exit_game"));
-					Float x = Float.valueOf("0.9").floatValue();
-					Float y = Float.valueOf("0.9").floatValue();
-					ll_exit_game.setScaleX(x);
-					ll_exit_game.setScaleY(y);
+					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));
@@ -79,6 +80,8 @@ public class CustomExitGameDialog extends Dialog {
 						}
 					});
 				}
+				qj_issure_exit = dialog.findViewById(ResourceUtil.getId(context,
+						"qj_issure_exit"));
 				return dialog;
 			}
 		}

+ 218 - 0
hnqj/src/main/java/com/yyrh/ui/dialog/EmailDialog.java

@@ -0,0 +1,218 @@
+package com.yyrh.ui.dialog;
+
+
+import android.content.Context;
+import android.content.Intent;
+
+import android.net.Uri;
+import android.os.Bundle;
+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 android.widget.LinearLayout;
+
+
+import com.yyrh.ui.PageJsInteraction;
+import com.yyrh.utils.ResourceUtil;
+import com.yyrh.utils.TosUtil;
+import com.yyrh.utils.Utils;
+
+import java.net.URISyntaxException;
+
+import static com.yyrh.constant.SDKSettings.isLandscape;
+
+
+public class EmailDialog extends BaseDialog {
+
+
+    private ImageView close_btn;
+    private Context context;
+    private WebView webView;
+    private WebSettings webSettings;
+
+    private String url;
+
+
+    public EmailDialog(Context context) {
+        super(context);
+        this.context = context;
+    }
+
+
+    public EmailDialog(Context context, int theme, String url) {
+        super(context, theme);
+        this.context = context;
+
+        this.url = url;
+
+    }
+
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+
+        if (!isLandscape){
+
+            setContentView(ResourceUtil.getLayoutId(context,
+                    "qj_usercenter_portait_dialog"));
+
+        }else{
+            setContentView(ResourceUtil.getLayoutId(context,
+                    "qj_email_dialog"));
+        }
+
+
+        setCancelable(false);
+
+
+
+        webView = findViewById(ResourceUtil.getId(context,
+                "wb_user_info"));
+
+        close_btn = findViewById(ResourceUtil.getId(context,
+                "close_btn"));
+
+
+        Animation rotateAnimation = AnimationUtils.loadAnimation(context, ResourceUtil.getAnimId(context, "qj_rotate_anim"));
+
+        close_btn.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+
+
+
+                webView.destroy();
+                dismiss();
+
+            }
+        });
+
+        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);
+
+            }
+
+            @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);
+    }
+
+
+
+
+
+
+    @Override
+    public void zfColse() {
+        super.zfColse();
+        dismiss();
+    }
+
+    @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 (Utils.judgeStrNull(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();
+    }
+}

+ 1 - 1
hnqj/src/main/java/com/yyrh/ui/GameSplashDialog.java → hnqj/src/main/java/com/yyrh/ui/dialog/GameSplashDialog.java

@@ -1,4 +1,4 @@
-package com.yyrh.ui;
+package com.yyrh.ui.dialog;
 
 import android.app.Dialog;
 import android.content.Context;

+ 5 - 10
hnqj/src/main/java/com/yyrh/ui/PrivacyPolicyDialog.java → hnqj/src/main/java/com/yyrh/ui/dialog/PrivacyPolicyDialog.java

@@ -1,4 +1,4 @@
-package com.yyrh.ui;
+package com.yyrh.ui.dialog;
 
 import android.app.Activity;
 import android.app.Dialog;
@@ -18,14 +18,11 @@ import android.widget.Button;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 
-import com.yyrh.constant.SDKSettings;
-import com.yyrh.ui.userlist.DatabaseHelper;
+
 import com.yyrh.utils.ResourceUtil;
-import com.yyrh.utils.TosUtil;
+
 import com.yyrh.utils.Utils;
 
-import static com.yyrh.constant.SDKSettings.USER_BIRTHDAY;
-import static com.yyrh.constant.SDKSettings.isVefityRealName;
 
 public class PrivacyPolicyDialog extends Dialog {
 
@@ -76,10 +73,8 @@ public class PrivacyPolicyDialog extends Dialog {
                 "qj_privacy_policy_dialog"));
         if (!isLandscape){
             LinearLayout ll_private_policy = findViewById(ResourceUtil.getId(context, "ll_private_policy"));
-            Float x = Float.valueOf("0.9").floatValue();
-            Float y = Float.valueOf("0.9").floatValue();
-            ll_private_policy.setScaleX(x);
-            ll_private_policy.setScaleY(y);
+             ll_private_policy.setScaleX(0.9f);
+            ll_private_policy.setScaleY(0.9f);
         }
 
         webView = findViewById(ResourceUtil.getId(context,

+ 1 - 1
hnqj/src/main/java/com/yyrh/ui/SingleButtonDialog.java → hnqj/src/main/java/com/yyrh/ui/dialog/SingleButtonDialog.java

@@ -1,4 +1,4 @@
-package com.yyrh.ui;
+package com.yyrh.ui.dialog;
 
 import android.app.Dialog;
 import android.content.Context;

+ 279 - 0
hnqj/src/main/java/com/yyrh/ui/dialog/UserCenterDialog.java

@@ -0,0 +1,279 @@
+package com.yyrh.ui.dialog;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.net.Uri;
+import android.os.Bundle;
+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 android.widget.LinearLayout;
+import android.widget.RelativeLayout;
+
+import com.yyrh.constant.SDKSettings;
+import com.yyrh.sdk.YyrhSdkManager;
+import com.yyrh.ui.PageJsInteraction;
+import com.yyrh.ui.userlist.DatabaseHelper;
+import com.yyrh.utils.ResourceUtil;
+import com.yyrh.utils.TosUtil;
+import com.yyrh.utils.Utils;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.net.URISyntaxException;
+
+
+import static com.yyrh.constant.SDKSettings.isLandscape;
+
+
+public class UserCenterDialog extends BaseDialog {
+
+
+    private ImageView close_btn;
+    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 (!isLandscape){
+            setContentView(ResourceUtil.getLayoutId(context,
+                    "qj_usercenter_portait_dialog"));
+            getWindow().getAttributes().gravity = Gravity.CENTER;
+        }else{
+            setContentView(ResourceUtil.getLayoutId(context,
+                    "qj_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();
+
+            }
+        });
+
+
+
+        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);
+
+            }
+
+            @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 showJsMsg(String message) {
+        super.showJsMsg(message);
+        new TosUtil(context,TosUtil.TOAST_ERROR,  message).show();
+    }
+
+
+    @Override
+    public void modifyPwd(String message) {
+        super.modifyPwd(message);
+        SharedPreferences sp = context
+                .getSharedPreferences("yyrh",
+                        Activity.MODE_PRIVATE);
+        SharedPreferences.Editor editor = sp.edit();
+        editor.putString("username", SDKSettings.loginData.uname);
+        editor.putString("password", message);
+        editor.commit();
+
+        String timeStamp = System.currentTimeMillis() + "";
+
+        String delete_sql = "delete from user where name = '" + SDKSettings.loginData.uname + "'";
+
+        String insert_sql = "insert into user(name,pwd,time) values('" +SDKSettings.loginData.uname
+                + "','" + message + "','" + timeStamp + "')";
+
+        DatabaseHelper.excuteSql(context, delete_sql);
+        DatabaseHelper.excuteSql(context, insert_sql);
+    }
+
+    @Override
+    public void openq0q0(String url) {
+        super.openq0q0(url);
+
+        {
+            Log.i("openq0q0", url);
+            if (Utils.judgeStrNull(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();
+        YyrhSdkManager.defaultManager(context).yyrhLogout();
+
+    }
+
+
+
+    @Override
+    public void dismiss() {
+        super.dismiss();
+    }
+}

+ 21 - 19
hnqj/src/main/java/com/yyrh/ui/WvPageListDialog.java → hnqj/src/main/java/com/yyrh/ui/dialog/WvPageListDialog.java

@@ -1,4 +1,4 @@
-package com.yyrh.ui;
+package com.yyrh.ui.dialog;
 
 import android.app.Activity;
 import android.content.Context;
@@ -22,7 +22,6 @@ import android.widget.LinearLayout;
 
 import com.yyrh.constant.SDKSettings;
 import com.yyrh.ui.PageJsInteraction;
-import com.yyrh.ui.BaseDialog;
 import com.yyrh.ui.userlist.DatabaseHelper;
 
 import com.yyrh.utils.ResourceUtil;
@@ -32,14 +31,13 @@ import com.yyrh.utils.Utils;
 
 import java.net.URISyntaxException;
 
-import static com.yyrh.constant.SDKSettings.USER_BIRTHDAY;
 import static com.yyrh.constant.SDKSettings.isLandscape;
 import static com.yyrh.constant.SDKSettings.isVefityRealName;
 
 public class WvPageListDialog extends BaseDialog {
 
 
-    private ImageView close_btn,yyrh_loading;
+    private ImageView close_btn,loading;
     private Context context;
     private WebView webView;
     private WebSettings webSettings;
@@ -90,10 +88,8 @@ public class WvPageListDialog extends BaseDialog {
         if (!isLandscape){
 
             LinearLayout ll_webview_common = findViewById(ResourceUtil.getId(context, "ll_webview_common"));
-            Float x = Float.valueOf("0.9").floatValue();
-            Float y = Float.valueOf("0.9").floatValue();
-            ll_webview_common.setScaleX(x);
-            ll_webview_common.setScaleY(y);
+            ll_webview_common.setScaleX(0.9f);
+            ll_webview_common.setScaleY(0.9f);
 
         }
 
@@ -103,9 +99,9 @@ public class WvPageListDialog extends BaseDialog {
         close_btn = findViewById(ResourceUtil.getId(context,
                 "close_btn"));
 
-        yyrh_loading = findViewById(ResourceUtil.getId(context, "qj_loading"));
+        loading = findViewById(ResourceUtil.getId(context, "qj_loading"));
         Animation rotateAnimation = AnimationUtils.loadAnimation(context, ResourceUtil.getAnimId(context, "qj_rotate_anim"));
-        yyrh_loading.startAnimation(rotateAnimation);
+        loading.startAnimation(rotateAnimation);
 
         close_btn.setOnClickListener(new View.OnClickListener() {
             @Override
@@ -153,8 +149,8 @@ public class WvPageListDialog extends BaseDialog {
             @Override
             public void onPageFinished(WebView view, String url) {
                 super.onPageFinished(view, url);
-                yyrh_loading.clearAnimation();
-                yyrh_loading.setVisibility(View.GONE);
+                loading.clearAnimation();
+                loading.setVisibility(View.GONE);
                 if (webView.canGoBack()){
 //                    reback_btn.setVisibility(VISIBLE);
                 }else{
@@ -212,6 +208,7 @@ public class WvPageListDialog extends BaseDialog {
 
     public interface OnClosePageListener {
          void onClose();
+         void onDissmiss();
          void onRealNameSuccess(String birthday);
     }
 
@@ -236,7 +233,7 @@ public class WvPageListDialog extends BaseDialog {
     public void usrRn(String message) {
         super.usrRn(message);
         isVefityRealName = true;
-        USER_BIRTHDAY = message;
+        SDKSettings.loginData.rn_bd = message;
         listener.onRealNameSuccess(message);
     }
 
@@ -247,15 +244,15 @@ public class WvPageListDialog extends BaseDialog {
                 .getSharedPreferences("yyrh",
                         Activity.MODE_PRIVATE);
         SharedPreferences.Editor editor = sp.edit();
-        editor.putString("username", SDKSettings.UNAME);
+        editor.putString("username", SDKSettings.loginData.uname);
         editor.putString("password", message);
         editor.commit();
 
         String timeStamp = System.currentTimeMillis() + "";
 
-        String delete_sql = "delete from user where name = '" + SDKSettings.UNAME + "'";
+        String delete_sql = "delete from user where name = '" + SDKSettings.loginData.uname + "'";
 
-        String insert_sql = "insert into user(name,pwd,time) values('" + SDKSettings.UNAME
+        String insert_sql = "insert into user(name,pwd,time) values('" +SDKSettings.loginData.uname
                 + "','" + message + "','" + timeStamp + "')";
 
         DatabaseHelper.excuteSql(context, delete_sql);
@@ -301,12 +298,17 @@ public class WvPageListDialog extends BaseDialog {
     public void dismiss() {
         super.dismiss();
         if (isHiddenClo){
-            if (SDKSettings.USER_BIRTHDAY.equals("")){
-                SDKSettings.CHANNELUID = "";
-                SDKSettings.UNAME = "";
+            if (SDKSettings.loginData.rn_bd.equals("")){
+                SDKSettings.loginData.channel_uid = "";
+                SDKSettings.loginData.uname = "";
 
             }
 
         }
+        if (listener != null){
+            listener.onDissmiss();
+        }
+
+
     }
 }

+ 5 - 8
hnqj/src/main/java/com/yyrh/pay/WvPayYyrhDialog.java → hnqj/src/main/java/com/yyrh/ui/dialog/WvPayYyrhDialog.java

@@ -1,10 +1,9 @@
-package com.yyrh.pay;
+package com.yyrh.ui.dialog;
 
 import android.content.Context;
 import android.content.Intent;
 import android.net.Uri;
 import android.os.Bundle;
-import android.view.LayoutInflater;
 import android.view.View;
 import android.webkit.DownloadListener;
 import android.webkit.WebChromeClient;
@@ -14,10 +13,9 @@ import android.webkit.WebViewClient;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 
-import com.yyrh.constant.SDKSettings;
+
 import com.yyrh.ui.PageJsInteraction;
 import com.yyrh.sdk.YyrhSdkManager;
-import com.yyrh.ui.BaseDialog;
 import com.yyrh.utils.ResourceUtil;
 import com.yyrh.utils.TosUtil;
 import com.yyrh.utils.Utils;
@@ -63,10 +61,9 @@ public class WvPayYyrhDialog extends BaseDialog implements View.OnClickListener{
 
         if (!isLandscape){
             LinearLayout ll_p_wb = findViewById(ResourceUtil.getId(context, "ll_p_wb"));
-            Float x = Float.valueOf("0.9").floatValue();
-            Float y = Float.valueOf("0.9").floatValue();
-            ll_p_wb.setScaleX(x);
-            ll_p_wb.setScaleY(y);
+
+            ll_p_wb.setScaleX(0.9f);
+            ll_p_wb.setScaleY(0.9f);
         }
 
         iv_reback_close = findViewById(ResourceUtil.getId(context,

+ 164 - 388
hnqj/src/main/java/com/yyrh/ui/floatmenu/FloatLogoMenu.java

@@ -16,6 +16,7 @@ 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.Color;
@@ -26,9 +27,10 @@ import android.os.CountDownTimer;
 import android.os.Handler;
 import android.os.Looper;
 import android.text.TextUtils;
-import android.util.Log;
+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.OnClickListener;
@@ -37,8 +39,13 @@ import android.view.ViewGroup;
 import android.view.WindowManager;
 import android.view.animation.Interpolator;
 import android.view.animation.LinearInterpolator;
-import android.widget.Button;
 import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.yyrh.ui.dialog.CustomExitGameDialog;
+import com.yyrh.utils.ResourceUtil;
+import com.yyrh.utils.TosUtil;
+import com.yyrh.utils.YYLog;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -47,6 +54,11 @@ import java.util.List;
  * Created by wengyiming on 2017/7/20.
  */
 public class FloatLogoMenu {
+
+
+
+
+
     /**
      * 记录 logo 停放的位置,以备下次恢复
      */
@@ -96,7 +108,7 @@ public class FloatLogoMenu {
     /**
      * 记录屏幕的宽度
      */
-    private int mScreenWidth;
+    private int mScreenWidth,screenHeigth;
 
     /**
      * 来自 activity 的 wManager
@@ -107,7 +119,7 @@ public class FloatLogoMenu {
     /**
      * 为 wManager 设置 LayoutParams
      */
-    private WindowManager.LayoutParams wmParams;
+    private WindowManager.LayoutParams wmParams,wmParams2;
 
     /**
      * 带透明度动画、旋转、放大的悬浮球
@@ -132,11 +144,6 @@ public class FloatLogoMenu {
      */
     private Interpolator mLinearInterpolator = new LinearInterpolator();
 
-    /**
-     * 用于记录上次菜单打开的时间,判断时间间隔
-     */
-    private static double DOUBLE_CLICK_TIME = 0L;
-
     /**
      * 标记是否拖动中
      */
@@ -147,6 +154,9 @@ public class FloatLogoMenu {
      */
     private int mResetLocationValue;
 
+    private LinearLayout ll_hide;
+
+
     /**
      * 手指离开屏幕后 用于恢复 悬浮球的 logo 的左右位置
      */
@@ -159,16 +169,7 @@ public class FloatLogoMenu {
         }
     };
 
-    /**
-     * 这个事件不做任何事情、直接return false则 onclick 事件生效
-     */
-    private OnTouchListener mDefaultOnTouchListerner = new OnTouchListener() {
-        @Override
-        public boolean onTouch(View v, MotionEvent event) {
-            isDraging = false;
-            return false;
-        }
-    };
+
 
     /**
      * 这个事件用于处理移动、自定义点击或者其它事情,return true可以保证onclick事件失效
@@ -184,8 +185,9 @@ public class FloatLogoMenu {
                     floatEventMove(event);
                     break;
                 case MotionEvent.ACTION_UP:
-                case MotionEvent.ACTION_CANCEL:
                     floatEventUp();
+                case MotionEvent.ACTION_CANCEL:
+                    floatEventCancel();
                     break;
             }
             return true;
@@ -193,21 +195,17 @@ public class FloatLogoMenu {
     };
 
 
-    /**
-     * 菜单背景颜色
-     */
-    private int mBackMenuColor = 0xffe4e3e1;
+    private View  createHideView(Context context){
+         hideView = LayoutInflater.from(context).inflate(ResourceUtil.getLayoutId(context,
+                "qj_hide_float_view"), null);
+        ll_hide = hideView.findViewById(ResourceUtil.getId(context,
+                "ll_hide"));
+        return hideView;
+    }
+
 
-    /**
-     * 是否绘制红点数字
-     */
-    private boolean mDrawRedPointNum;
 
 
-    /**
-     * 是否绘制圆形菜单项,false绘制方形
-     */
-    private boolean mCicleMenuBg;
 
 
     /**
@@ -222,10 +220,7 @@ public class FloatLogoMenu {
      */
     private Context mActivity;
 
-    /**
-     * 菜单 点击、关闭 监听
-     */
-    private FloatMenuView.OnMenuClickListener mOnMenuClickListener;
+
 
 
     /**
@@ -240,32 +235,23 @@ public class FloatLogoMenu {
     private int mHintLocation = mDefaultLocation;
 
 
-    /**
-     * 用于记录菜单项内容
-     */
-    private List<FloatItem> mFloatItems = new ArrayList<>();
-
-    private LinearLayout rootViewRight;
 
-    private LinearLayout rootView;
 
     private ValueAnimator valueAnimator;
 
-    private boolean isExpaned = false;
 
-    private Drawable mBackground;
+    private View hideView;
 
+    private  OnFloatClickListener mListener;
 
     private FloatLogoMenu(Builder builder) {
-        mBackMenuColor = builder.mBackMenuColor;
-        mDrawRedPointNum = builder.mDrawRedPointNum;
-        mCicleMenuBg = builder.mCicleMenuBg;
+
+
         mLogoRes = builder.mLogoRes;
         mActivity = builder.mActivity;
-        mOnMenuClickListener = builder.mOnMenuClickListener;
+
         mDefaultLocation = builder.mDefaultLocation;
-        mFloatItems = builder.mFloatItems;
-        mBackground = builder.mDrawable;
+        mListener = builder.listener;
 
 
 //        if (mActivity == null || mActivity.isFinishing() || mActivity.getWindowManager() == null) {
@@ -276,9 +262,6 @@ public class FloatLogoMenu {
             throw new IllegalArgumentException("No logo found,you can setLogo/showWithLogo to set a FloatLogo ");
         }
 
-        if (mFloatItems.isEmpty()) {
-            throw new IllegalArgumentException("At least one menu item!");
-        }
 
         initFloatWindow();
         initTimer();
@@ -286,10 +269,6 @@ public class FloatLogoMenu {
 
     }
 
-    public void setFloatItemList(List<FloatItem> floatItems) {
-        this.mFloatItems = floatItems;
-        caculateDotNum();
-    }
 
     /**
      * 初始化悬浮球 window
@@ -302,6 +281,8 @@ public class FloatLogoMenu {
                         | WindowManager.LayoutParams.FLAG_FULLSCREEN,
                 PixelFormat.TRANSLUCENT);
 
+
+
         if (mActivity instanceof Activity) {
             Activity activity = (Activity) mActivity;
             wManager = activity.getWindowManager();
@@ -309,7 +290,6 @@ public class FloatLogoMenu {
             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) {
@@ -323,9 +303,10 @@ public class FloatLogoMenu {
                 wmParams.type = WindowManager.LayoutParams.TYPE_PHONE;
             }
         }
-
-        mScreenWidth = wManager.getDefaultDisplay().getWidth();
-        int screenHeigth = wManager.getDefaultDisplay().getHeight();
+        DisplayMetrics dm = new DisplayMetrics();
+        wManager.getDefaultDisplay().getMetrics(dm);
+        mScreenWidth = dm.widthPixels;
+        screenHeigth = dm.heightPixels;
 
         //判断状态栏是否显示 如果不显示则statusBarHeight为0
         mStatusBarHeight = dp2Px(0, mActivity);
@@ -357,6 +338,17 @@ public class FloatLogoMenu {
         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;
     }
 
 
@@ -364,127 +356,26 @@ public class FloatLogoMenu {
      * 初始化悬浮球
      */
     private void initFloat() {
-        genarateLeftLineLayout();
-        genarateRightLineLayout();
+
         mFloatLogo = new DotImageView(mActivity, mLogoRes);
         mFloatLogo.setLayoutParams(new WindowManager.LayoutParams(dp2Px(50, mActivity), dp2Px(50, mActivity)));
-        mFloatLogo.setDrawNum(mDrawRedPointNum);
-        mFloatLogo.setBgColor(mBackMenuColor);
         mFloatLogo.setDrawDarkBg(true);
 
-        caculateDotNum();
         floatBtnEvent();
         try {
 
-
+            wManager.addView(createHideView(mActivity), wmParams2);
+            hideView.setVisibility(View.INVISIBLE);
             wManager.addView(mFloatLogo, wmParams);
 
+
         }
         catch (Exception e) {
             e.printStackTrace();
         }
-
+        mHideTimer.start();
     }
 
-    private void genarateLeftLineLayout() {
-        DotImageView floatLogo = new DotImageView(mActivity, mLogoRes);
-        floatLogo.setLayoutParams(new WindowManager.LayoutParams(dp2Px(50, mActivity), dp2Px(50, mActivity)));
-        floatLogo.setDrawNum(mDrawRedPointNum);
-        floatLogo.setDrawDarkBg(false);
-
-        rootView = new LinearLayout(mActivity);
-        rootView.setOrientation(LinearLayout.HORIZONTAL);
-        rootView.setGravity(Gravity.CENTER);
-        rootView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, dp2Px(50, mActivity)));
-
-        rootView.setBackgroundDrawable(mBackground);
-
-
-        final FloatMenuView mFloatMenuView = new FloatMenuView.Builder(mActivity)
-                .setFloatItems(mFloatItems)
-                .setBackgroundColor(Color.TRANSPARENT)
-                .setCicleBg(mCicleMenuBg)
-                .setStatus(FloatMenuView.STATUS_LEFT)
-                .setMenuBackgroundColor(Color.TRANSPARENT)
-                .drawNum(mDrawRedPointNum)
-                .create();
-        setMenuClickListener(mFloatMenuView);
-
-        rootView.addView(floatLogo);
-        rootView.addView(mFloatMenuView);
-
-
-        floatLogo.setOnClickListener(new OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                if (isExpaned) {
-                    try {
-                        wManager.removeViewImmediate(rootView);
-                        wManager.addView(FloatLogoMenu.this.mFloatLogo, wmParams);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    }
-                    isExpaned = false;
-                }
-            }
-        });
-    }
-    public void hideMenu(){
-        if (isExpaned) {
-            try {
-                wManager.removeViewImmediate(mHintLocation == LEFT ? rootView : rootViewRight);
-                wManager.addView(FloatLogoMenu.this.mFloatLogo, wmParams);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-            isExpaned = false;
-        }
-    }
-    private void genarateRightLineLayout() {
-        final DotImageView floatLogo = new DotImageView(mActivity, mLogoRes);
-        floatLogo.setLayoutParams(new WindowManager.LayoutParams(dp2Px(50, mActivity), dp2Px(50, mActivity)));
-        floatLogo.setDrawNum(mDrawRedPointNum);
-        floatLogo.setDrawDarkBg(false);
-
-        floatLogo.setOnClickListener(new OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                if (isExpaned) {
-                    try {
-                        wManager.removeViewImmediate(rootViewRight);
-                        wManager.addView(FloatLogoMenu.this.mFloatLogo, wmParams);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    }
-                    isExpaned = false;
-                }
-            }
-        });
-
-        rootViewRight = new LinearLayout(mActivity);
-        rootViewRight.setOrientation(LinearLayout.HORIZONTAL);
-        rootViewRight.setGravity(Gravity.CENTER);
-        rootViewRight.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, dp2Px(50, mActivity)));
-
-
-        rootViewRight.setBackgroundDrawable(mBackground);
-
-
-        FloatMenuView mFloatMenuView = new FloatMenuView.Builder(mActivity)
-                .setFloatItems(mFloatItems)
-                .setBackgroundColor(Color.TRANSPARENT)
-                .setCicleBg(mCicleMenuBg)
-                .setStatus(FloatMenuView.STATUS_RIGHT)
-                .setMenuBackgroundColor(Color.TRANSPARENT)
-                .drawNum(mDrawRedPointNum)
-                .create();
-        setMenuClickListener(mFloatMenuView);
-
-        rootViewRight.addView(mFloatMenuView);
-        rootViewRight.addView(floatLogo);
-
-
-    }
 
     /**
      * 初始化 隐藏悬浮球的定时器
@@ -493,17 +384,13 @@ public class FloatLogoMenu {
         mHideTimer = new CountDownTimer(2000, 10) {        //悬浮窗超过5秒没有操作的话会自动隐藏
             @Override
             public void onTick(long millisUntilFinished) {
-                if (isExpaned) {
-                    mHideTimer.cancel();
-                }
+
+
             }
 
             @Override
             public void onFinish() {
-                if (isExpaned) {
-                    mHideTimer.cancel();
-                    return;
-                }
+
                 if (!isDraging) {
                     if (mHintLocation == LEFT) {
                         mFloatLogo.setStatus(DotImageView.HIDE_LEFT);
@@ -512,69 +399,24 @@ public class FloatLogoMenu {
                         mFloatLogo.setStatus(DotImageView.HIDE_RIGHT);
                         mFloatLogo.setDrawDarkBg(true);
                     }
-//                    mFloatLogo.setOnTouchListener(mDefaultOnTouchListerner);//把onClick事件分发下去,防止onclick无效
+
                 }
             }
         };
     }
 
 
-    /**
-     * 用于 拦截 菜单项的 关闭事件,以方便开始 隐藏定时器
-     *
-     * @param mFloatMenuView
-     */
-    private void setMenuClickListener(final FloatMenuView mFloatMenuView) {
-        mFloatMenuView.setOnMenuClickListener(new FloatMenuView.OnMenuClickListener() {
-            @Override
-            public void onItemClick(int position, String title) {
 
 
-
-                mFloatLogo.refreshDot(0);
-
-                mOnMenuClickListener.onItemClick(position, title);
-
-
-            }
-
-            @Override
-            public void dismiss() {
-                mFloatLogo.setDrawDarkBg(true);
-                mOnMenuClickListener.dismiss();
-                mHideTimer.start();
-            }
-        });
-
-    }
-private void closeMenu(){
-    wManager.removeViewImmediate(rootView);
-    wManager.addView(FloatLogoMenu.this.mFloatLogo, wmParams);
-}
-
     /**
      * 悬浮窗的点击事件和touch事件的切换
      */
     private void floatBtnEvent() {
-        //这里的onCick只有 touchListener = mDefaultOnTouchListerner 才会触发
-//        mFloatLogo.setOnClickListener(new OnClickListener() {
-//            @Override
-//            public void onClick(View v) {
-//                if (!isDraging) {
-//                    if (mFloatLogo.getStatus() != DotImageView.NORMAL) {
-//                        mFloatLogo.setBitmap(mLogoRes);
-//                        mFloatLogo.setStatus(DotImageView.NORMAL);
-//                        if (!mFloatLogo.mDrawDarkBg) {
-//                            mFloatLogo.setDrawDarkBg(true);
-//                        }
-//                    }
-//                    mFloatLogo.setOnTouchListener(touchListener);
-//                    mHideTimer.start();
-//                }
-//            }
-//        });
 
         mFloatLogo.setOnTouchListener(touchListener);//恢复touch事件
+
+
+
     }
 
     /**
@@ -622,12 +464,79 @@ private void closeMenu(){
             isDraging = false;
             mFloatLogo.setDraging(false, 0, true);
         }
+
+        hideView.setVisibility(View.VISIBLE);
+
+        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, "qj_hide_float_view_bg"));
+
+        }else {
+            ll_hide.setBackgroundResource(ResourceUtil.getDrawableId(mActivity, "qj_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.INVISIBLE);
+
+        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) {
+
+                    destoryFloat();
+
+
+                    dialog.dismiss();
+                }
+            });
+            builder.setnegativeButton(new DialogInterface.OnClickListener() {
+                @Override
+                public void onClick(DialogInterface dialog, int which) {
+
+                    dialog.dismiss();
+                }
+            });
+            builder.setTitle(mActivity.getString(ResourceUtil.getStringId(mActivity, "qj_close_float_view_tip")));
+
+        }
+
+
+
+    }
     /**
      * 悬浮窗touch事件的 up 事件
      */
-    private void floatEventUp() {
+    private void floatEventCancel() {
         if (mXInScreen < mScreenWidth / 2) {   //在左边
             mHintLocation = LEFT;
         } else {                   //在右边
@@ -692,8 +601,12 @@ private void closeMenu(){
 //        //这里需要判断如果如果手指所在位置和logo所在位置在一个宽度内则不移动,
         if (Math.abs(mXInScreen - mXDownInScreen) > mFloatLogo.getWidth() / 5 || Math.abs(mYInScreen - mYDownInScreen) > mFloatLogo.getHeight() / 5) {
             isDraging = false;
-        } else {
-            openMenu();
+
+        }else {
+            if (isDraging)
+                return;
+            if (mListener != null)  mListener.onClick();
+
         }
 
     }
@@ -734,43 +647,6 @@ private void closeMenu(){
     }
 
 
-    /**
-     * 打开菜单
-     */
-    private void openMenu() {
-        if (isDraging) return;
-
-        if (!isExpaned) {
-            mFloatLogo.setDrawDarkBg(false);
-            try {
-                wManager.removeViewImmediate(mFloatLogo);
-                if (mHintLocation == RIGHT) {
-                    wManager.addView(rootViewRight, wmParams);
-                } else {
-                    wManager.addView(rootView, wmParams);
-                }
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-
-            isExpaned = true;
-            mHideTimer.cancel();
-        } else {
-            mFloatLogo.setDrawDarkBg(true);
-            if (isExpaned) {
-                try {
-                    wManager.removeViewImmediate(mHintLocation == LEFT ? rootView : rootViewRight);
-                    wManager.addView(mFloatLogo, wmParams);
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-
-                isExpaned = false;
-            }
-            mHideTimer.start();
-        }
-
-    }
 
 
     /**
@@ -779,13 +655,7 @@ private void closeMenu(){
     private void updateViewPosition() {
         isDraging = true;
         try {
-            if (!isExpaned) {
-                if (wmParams.y - mFloatLogo.getHeight() / 2 <= 0) {
-                    wmParams.y = mStatusBarHeight;
-                    isDraging = true;
-                }
-                wManager.updateViewLayout(mFloatLogo, wmParams);
-            }
+            wManager.updateViewLayout(mFloatLogo, wmParams);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -794,6 +664,10 @@ private void closeMenu(){
     public void show() {
         try {
             if (wManager != null && wmParams != null && mFloatLogo != null) {
+
+                wManager.addView(createHideView(mActivity), wmParams2);
+
+
                 wManager.addView(mFloatLogo, wmParams);
             }
             if (mHideTimer != null) {
@@ -807,12 +681,6 @@ private void closeMenu(){
         }
     }
 
-    /**
-     * 关闭菜单
-     */
-    public void hide() {
-        destoryFloat();
-    }
 
 
     /**
@@ -825,79 +693,19 @@ private void closeMenu(){
         mFloatLogo.clearAnimation();
         try {
             mHideTimer.cancel();
-            if (isExpaned) {
-                wManager.removeViewImmediate(mHintLocation == LEFT ? rootView : rootViewRight);
-            } else {
-                wManager.removeViewImmediate(mFloatLogo);
-            }
 
-            isExpaned = false;
+            wManager.removeViewImmediate(mFloatLogo);
+            wManager.removeViewImmediate(hideView);
             isDraging = false;
         } catch (Exception e) {
             e.printStackTrace();
         }
-    }
 
-    /**
-     * 计算总红点数
-     */
-    private void caculateDotNum() {
-        int dotNum = 0;
-        for (FloatItem floatItem : mFloatItems) {
-            if (!TextUtils.isEmpty(floatItem.getDotNum())) {
-                int num = Integer.parseInt(floatItem.getDotNum());
-                dotNum = dotNum + num;
-            }
-        }
-        mFloatLogo.setDrawNum(mDrawRedPointNum);
-        setDotNum(dotNum);
     }
 
-    /**
-     * 绘制悬浮球的红点
-     *
-     * @param dotNum d
-     */
-    private void setDotNum(int dotNum) {
-        mFloatLogo.setDotNum(dotNum, new Animator.AnimatorListener() {
-            @Override
-            public void onAnimationStart(Animator animation) {
-
-            }
-
-            @Override
-            public void onAnimationEnd(Animator animation) {
-                if (!isDraging) {
-                    mHideTimer.start();
-                }
-            }
-
-            @Override
-            public void onAnimationCancel(Animator animation) {
-
-            }
 
-            @Override
-            public void onAnimationRepeat(Animator animation) {
 
-            }
-        });
-    }
 
-    /**
-     * 用于暴露给外部判断是否包含某个菜单项
-     *
-     * @param menuLabel string
-     * @return boolean
-     */
-    public boolean hasMenu(String menuLabel) {
-        for (FloatItem menuItem : mFloatItems) {
-            if (TextUtils.equals(menuItem.getTitle(), menuLabel)) {
-                return true;
-            }
-        }
-        return false;
-    }
 
     /**
      * 用于保存悬浮球的位置记录
@@ -940,59 +748,33 @@ private void closeMenu(){
     }
 
 
-    public interface OnMenuClickListener {
-        void onMenuExpended(boolean isExpened);
-    }
-
 
-    public void setValueAnimator() {
 
-    }
 
     public static final class Builder {
-        private int mBackMenuColor;
-        private boolean mDrawRedPointNum;
-        private boolean mCicleMenuBg;
+
+
         private Bitmap mLogoRes;
         private int mDefaultLocation;
-        private List<FloatItem> mFloatItems = new ArrayList<>();
+
         private Context mActivity;
-        private FloatMenuView.OnMenuClickListener mOnMenuClickListener;
-        private Drawable mDrawable;
 
+        private  OnFloatClickListener listener;
 
         public Builder setBgDrawable(Drawable drawable) {
-            mDrawable = drawable;
+
             return this;
         }
 
         public Builder() {
         }
 
-        public Builder setFloatItems(List<FloatItem> mFloatItems) {
-            this.mFloatItems = mFloatItems;
-            return this;
-        }
 
-        public Builder addFloatItem(FloatItem floatItem) {
-            this.mFloatItems.add(floatItem);
-            return this;
-        }
 
-        public Builder backMenuColor(int val) {
-            mBackMenuColor = val;
-            return this;
-        }
 
-        public Builder drawRedPointNum(boolean val) {
-            mDrawRedPointNum = val;
-            return this;
-        }
 
-        public Builder drawCicleMenuBg(boolean val) {
-            mCicleMenuBg = val;
-            return this;
-        }
+
+
 
         public Builder logo(Bitmap val) {
             mLogoRes = val;
@@ -1004,35 +786,29 @@ private void closeMenu(){
             return this;
         }
 
-        public Builder withContext(Context val) {
-            mActivity = val;
-            return this;
-        }
 
-        public Builder setOnMenuItemClickListener(FloatMenuView.OnMenuClickListener val) {
-            mOnMenuClickListener = val;
-            return this;
-        }
 
         public Builder defaultLocation(int val) {
             mDefaultLocation = val;
             return this;
         }
 
-        public FloatLogoMenu showWithListener(FloatMenuView.OnMenuClickListener val) {
-            mOnMenuClickListener = val;
-            return new FloatLogoMenu(this);
-        }
 
-        public FloatLogoMenu showWithLogo(Bitmap val) {
-            mLogoRes = val;
-            return new FloatLogoMenu(this);
+
+        public Builder setOnFloatClickListener(OnFloatClickListener onClickFloatListener) {
+            this.listener = onClickFloatListener;
+            return this;
         }
 
+
+
         public FloatLogoMenu show() {
+
             return new FloatLogoMenu(this);
         }
     }
-
+    public interface OnFloatClickListener {
+        void onClick();
+    }
 
 }

+ 3 - 311
hnqj/src/main/java/com/yyrh/ui/floatmenu/FloatMenuView.java

@@ -35,67 +35,24 @@ import java.util.List;
  */
 
 public class FloatMenuView extends View {
-    public static final int STATUS_LEFT = 3;//展开左边菜单
-    public static final int STATUS_RIGHT = 4;//展开右边菜单
 
-    private int mStatus = STATUS_RIGHT;//默认右边
 
     private Paint mPaint;//画笔
-    private int mBackgroundColor = 0x00FFFFFF;//默认背景颜色 完全透明的白色
 
-    private int mMenuBackgroundColor = -1;//菜单的背景颜色
 
-    private RectF mBgRect;//菜单的背景矩阵
-    private int mItemWidth = dip2px(50);//菜单项的宽度
-    private int mItemHeight = dip2px(50);//菜单项的高度
-    private int mItemLeft = 0;//菜单项左边的默认偏移值,这里是0
-    private int mCorner = dip2px(2);//菜单背景的圆角多出的宽度
 
 
-    private int mRadius = dip2px(4);//红点消息半径
-    private final int mRedPointRadiuWithNoNum = dip2px(3);//红点圆半径
 
-    private int mFontSizePointNum = sp2px(10);//红点消息数字的文字大小
-
-    private int mFontSizeTitle = sp2px(10);//菜单项的title的文字大小
-    private float mFirstItemTop;//菜单项的最小y值,上面起始那条线
-    private boolean mDrawNum = false;//是否绘制数字,false则只绘制红点
-    private boolean cicleBg = false;//菜单项背景是否绘制成圆形,false则绘制矩阵
-
-    private Canvas canvas = null;
-    private List<FloatItem> mItemList = new ArrayList<>();//菜单项的内容
-    private List<RectF> mItemRectList = new ArrayList<>();//菜单项所占用位置的记录,用于判断点击事件
-
-    private OnMenuClickListener mOnMenuClickListener;//菜单项的点击事件回调
 
     private ObjectAnimator mAlphaAnim;//消失关闭动画的透明值
 
-    //设置菜单内容集合
-    public void setItemList(List<FloatItem> itemList) {
-        mItemList = itemList;
-    }
-
-    //设置是否绘制红点数字
-    public void drawNum(boolean drawNum) {
-        mDrawNum = drawNum;
-    }
-
-    //设置是否绘制圆形菜单,否则矩阵
-    public void setCicleBg(boolean cicleBg) {
-        this.cicleBg = cicleBg;
-    }
 
     //用于标记所依赖的view的screen的坐标,实际view的坐标是window坐标,所以这里后面会减去状态栏的高度
 
 
-    //设置菜单的背景颜色
-    public void setMenuBackgroundColor(int mMenuBackgroundColor) {
-        this.mMenuBackgroundColor = mMenuBackgroundColor;
-    }
-
     //设置这个view(整个屏幕)的背景,这里默认透明
     public void setBackgroundColor(int BackgroundColor) {
-        this.mBackgroundColor = BackgroundColor;
+
     }
 
 
@@ -112,147 +69,18 @@ public class FloatMenuView extends View {
         super(context, attrs, defStyleAttr);
     }
 
-    public FloatMenuView(Context baseContext, int status) {
-        super(baseContext);
-        mStatus = status;
-        int screenWidth = getResources().getDisplayMetrics().widthPixels;
-        int screenHeight = getResources().getDisplayMetrics().heightPixels;
-        mBgRect = new RectF(0, 0, screenWidth, screenHeight);
-        initView();
-    }
+
 
     @Override
     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
         super.onMeasure(widthMeasureSpec, heightMeasureSpec);
-        setMeasuredDimension(mItemWidth * mItemList.size(), mItemHeight);
-    }
-
-    private void initView( ) {
-        mPaint = new Paint();
-        mPaint.setAntiAlias(true);
-        mPaint.setStyle(Paint.Style.FILL);
-        mPaint.setTextSize(sp2px(10));
-
-        mAlphaAnim = ObjectAnimator.ofFloat(this, "alpha", 1.0f, 0f);
-        mAlphaAnim.setDuration(50);
-        mAlphaAnim.addListener(new MyAnimListener() {
-            @Override
-            public void onAnimationEnd(Animator animation) {
-                if (mOnMenuClickListener != null) {
-                    removeView();
-                    mOnMenuClickListener.dismiss();
-                }
-            }
-        });
-
-        mFirstItemTop = 0;
-        if (mStatus == STATUS_LEFT) {
-            mItemLeft = 0;
-        } else {
-            mItemLeft = 0;
-        }
-
-    }
-
-    @Override
-    protected void onDraw(Canvas canvas) {
-        super.onDraw(canvas);
-        this.canvas = canvas;
-        switch (mStatus) {
-            case STATUS_LEFT:
-                drawBackground(canvas);
-                drawFloatLeftItem(canvas);
-                break;
-            case STATUS_RIGHT:
-                drawBackground(canvas);
-                drawFloatLeftItem(canvas);
-
-                break;
-        }
-    }
-
-    private void drawBackground(Canvas canvas) {
-        mPaint.setColor(mBackgroundColor);
-        canvas.drawRect(mBgRect, mPaint);
 
     }
 
-    private void drawFloatLeftItem(Canvas canvas) {
-        mItemRectList.clear();
-        for (int i = 0; i < mItemList.size(); i++) {
-            canvas.save();
-            mPaint.setColor(mMenuBackgroundColor);
-            if (cicleBg) {
-                float cx = (mItemLeft + i * mItemWidth) + mItemWidth / 2;//x中心点
-                float cy = mFirstItemTop + mItemHeight / 2;//y中心点
-                float radius = mItemWidth / 2;//半径
-                canvas.drawCircle(cx, cy, radius, mPaint);
-            } else {
-                mPaint.setColor(mItemList.get(i).bgColor);
-                canvas.drawRect(mItemLeft + i * mItemWidth, mFirstItemTop, mItemLeft + mItemWidth + i * mItemWidth, mFirstItemTop + mItemHeight, mPaint);
-            }
-
-            mItemRectList.add(new RectF(mItemLeft + i * mItemWidth, mFirstItemTop, mItemLeft + mItemWidth + i * mItemWidth, mFirstItemTop + mItemHeight));
-            mPaint.setColor(mItemList.get(i).bgColor);
-            drawIconTitleDot(canvas, i);
-        }
-        canvas.restore();
-    }
 
 
-    private void drawIconTitleDot(Canvas canvas, int position) {
-        FloatItem floatItem = mItemList.get(position);
-
-        if (floatItem.icon != null) {
-            float centryX = mItemLeft + mItemWidth / 2 + (mItemWidth) * position;//计算每一个item的中心点x的坐标值
-            float centryY = mFirstItemTop + mItemHeight / 2;//计算每一个item的中心点的y坐标值
-
-            float left = centryX - mItemWidth / 4;//计算icon的左坐标值 中心点往左移宽度的四分之一
-            float right = centryX + mItemWidth / 4;
-
-            float iconH = mItemHeight * 0.5f;//计算出icon的宽度 = icon的高度
-
-            float textH = getTextHeight(floatItem.getTitle(), mPaint);
-            float paddH = (mItemHeight - iconH - textH - mRadius) / 2;//总高度减去文字的高度,减去icon高度,再除以2就是上下的间距剩余
-
-            float top = centryY - mItemHeight / 2 + paddH;//计算icon的上坐标值
-            float bottom = top + iconH;//剩下的高度空间用于画文字
-
-            //画icon
-            mPaint.setColor(floatItem.titleColor);
-            canvas.drawBitmap(floatItem.icon, null, new RectF(left, top, right, bottom), mPaint);
-
-            if (!TextUtils.isEmpty(floatItem.dotNum) && !floatItem.dotNum.equals("0")) {
-                float dotLeft = centryX + mItemWidth / 5;
-                float cx = dotLeft + mCorner;//x中心点
-                float cy = top + mCorner;//y中心点
-
-                int radiu = mDrawNum ? mRadius : mRedPointRadiuWithNoNum;
-                //画红点
-                mPaint.setColor(Color.RED);
-                canvas.drawCircle(cx, cy, radiu, mPaint);
-                if (mDrawNum) {
-                    mPaint.setColor(Color.WHITE);
-                    mPaint.setTextSize(mFontSizePointNum);
-                    //画红点消息数
-                    canvas.drawText(floatItem.dotNum, cx - getTextWidth(floatItem.getDotNum(), mPaint) / 2, cy + getTextHeight(floatItem.getDotNum(), mPaint) / 2, mPaint);
-                }
-            }
-            mPaint.setColor(floatItem.titleColor);
-            mPaint.setTextSize(mFontSizeTitle);
-            //画menu title
-            canvas.drawText(floatItem.title, centryX - getTextWidth(floatItem.getTitle(), mPaint) / 2, centryY + iconH / 2 + getTextHeight(floatItem.getTitle(), mPaint) / 2, mPaint);
-        }
-    }
 
 
-    public void startAnim() {
-        if (mItemList.size() == 0) {
-            return;
-        }
-        invalidate();
-    }
-
 
     public void dismiss() {
         if (!mAlphaAnim.isRunning()) {
@@ -267,158 +95,22 @@ public class FloatMenuView extends View {
         }
     }
 
-    @Override
-    protected void onWindowVisibilityChanged(int visibility) {
-        if (visibility == GONE) {
-            if (mOnMenuClickListener != null) {
-                mOnMenuClickListener.dismiss();
-            }
-        }
-        super.onWindowVisibilityChanged(visibility);
-
-
-    }
-
-    public void setOnMenuClickListener(OnMenuClickListener onMenuClickListener) {
-        this.mOnMenuClickListener = onMenuClickListener;
 
-    }
-
-    public interface OnMenuClickListener {
-        void onItemClick(int position, String title);
 
-        void dismiss();
 
-    }
-
-    private abstract class MyAnimListener implements Animator.AnimatorListener {
-        @Override
-        public void onAnimationStart(Animator animation) {
-
-        }
-
-        @Override
-        public void onAnimationCancel(Animator animation) {
-
-        }
-
-        @Override
-        public void onAnimationRepeat(Animator animation) {
-
-        }
-    }
 
 
     @Override
     public boolean onTouchEvent(MotionEvent event) {
         switch (event.getAction()) {
             case MotionEvent.ACTION_DOWN:
-                for (int i = 0; i < mItemRectList.size(); i++) {
-                    if (mOnMenuClickListener != null && isPointInRect(new PointF(event.getX(), event.getY()), mItemRectList.get(i))) {
-                        mOnMenuClickListener.onItemClick(i, mItemList.get(i).title);
 
-                        return true;
-                    }
-                }
                 dismiss();
         }
         return false;
     }
 
-    private boolean isPointInRect(PointF pointF, RectF targetRect) {
-        return pointF.x >= targetRect.left && pointF.x <= targetRect.right && pointF.y >= targetRect.top && pointF.y <= targetRect.bottom;
-    }
-
-
-    public static class Builder {
-
-        private Context mActivity;
-        private List<FloatItem> mFloatItems = new ArrayList<>();
-        private int mBgColor = Color.TRANSPARENT;
-        private int mStatus = STATUS_LEFT;
-        private boolean cicleBg = false;
-        private int mMenuBackgroundColor = -1;
-        private boolean mDrawNum = false;
-
-
-        public Builder drawNum(boolean drawNum) {
-            mDrawNum = drawNum;
-            return this;
-        }
-
-
-        public Builder setMenuBackgroundColor(int mMenuBackgroundColor) {
-            this.mMenuBackgroundColor = mMenuBackgroundColor;
-            return this;
-        }
-
-
-        public Builder setCicleBg(boolean cicleBg) {
-            this.cicleBg = cicleBg;
-            return this;
-        }
-
-        public Builder setStatus(int status) {
-            mStatus = status;
-            return this;
-        }
-
-        public Builder setFloatItems(List<FloatItem> floatItems) {
-            this.mFloatItems = floatItems;
-            return this;
-        }
 
+}
 
-        public Builder(Context activity ) {
-            mActivity = activity;
-        }
-
-        public Builder addItem(FloatItem floatItem) {
-            mFloatItems.add(floatItem);
-            return this;
-        }
-
-        public Builder addItems(List<FloatItem> list) {
-            mFloatItems.addAll(list);
-            return this;
-        }
-
-        public Builder setBackgroundColor(int color) {
-            mBgColor = color;
-            return this;
-        }
-
-        public FloatMenuView create() {
-            FloatMenuView floatMenuView = new FloatMenuView(mActivity, mStatus);
-            floatMenuView.setItemList(mFloatItems);
-            floatMenuView.setBackgroundColor(mBgColor);
-            floatMenuView.setCicleBg(cicleBg);
-            floatMenuView.startAnim();
-            floatMenuView.drawNum(mDrawNum);
-            floatMenuView.setMenuBackgroundColor(mMenuBackgroundColor);
-            return floatMenuView;
-        }
-
-    }
-
-
-    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);
-    }
-}

+ 98 - 0
hnqj/src/main/java/com/yyrh/ui/floatmenu/FloatViewManager.java

@@ -0,0 +1,98 @@
+package com.yyrh.ui.floatmenu;
+
+import android.app.Activity;
+import android.content.Context;
+import android.graphics.BitmapFactory;
+
+
+import com.yyrh.constant.SDKSettings;
+import com.yyrh.sdk.YyrhSdkManager;
+
+import com.yyrh.ui.dialog.UserCenterDialog;
+
+import com.yyrh.utils.ResourceUtil;
+
+
+
+import static com.yyrh.constant.SDKSettings.isOpenFloatView;
+
+public class FloatViewManager {
+
+    private static FloatViewManager manager = null;
+
+    FloatLogoMenu mFloatMenu;
+
+    private FloatLogoMenu.Builder builder;
+
+    public final static int SHOW_FLOAT  = 0;
+
+    public final static int DESTORY_FLOAT  = 1;
+
+
+
+    private FloatViewManager(Context context) {
+        super();
+
+        if (isOpenFloatView == true){
+
+            initView(context);
+        }
+
+    }
+
+    public static FloatViewManager defaultManager(Context context) {
+
+        if (manager == null) {
+            synchronized (YyrhSdkManager.class) {
+                if (manager == null) {
+                    manager = new FloatViewManager(context);
+                }
+            }
+        }
+
+        return manager;
+    }
+
+    public void initView(final Context context){
+
+        if (builder == null) {
+
+            builder = new FloatLogoMenu.Builder()
+                    .withActivity((Activity) context)
+                    .logo(BitmapFactory.decodeResource(context.getResources(),ResourceUtil.getMipmapId(context,"qj_float_icon")))
+                    .setBgDrawable(context.getResources().getDrawable(ResourceUtil.getDrawableId(context,"qj_game_float_menu_bg")))
+                    .defaultLocation(FloatLogoMenu.LEFT)
+                    .setOnFloatClickListener(new FloatLogoMenu.OnFloatClickListener() {
+                        @Override
+                        public void onClick() {
+
+                            new UserCenterDialog(context,ResourceUtil.getStyleId(context,"qj_half_black_dialog"), SDKSettings.loginData.user_center).show();
+                        }
+                    });
+
+
+
+
+        }
+    }
+
+    public void showFloat() {
+        if (builder != null) {
+            mFloatMenu = builder.show();
+
+        }
+    }
+
+
+    public void destroyFloat() {
+        if (mFloatMenu != null) {
+            mFloatMenu.destoryFloat();
+        }
+
+        mFloatMenu = null;
+        manager = null;
+        builder = null;
+    }
+
+
+}

+ 3 - 7
hnqj/src/main/java/com/yyrh/ui/fragment/BaseFragment.java

@@ -11,7 +11,7 @@ import android.widget.ImageButton;
 
 import com.yyrh.constant.SDKSettings;
 import com.yyrh.constant.URLConstants;
-import com.yyrh.ui.WvPageListDialog;
+import com.yyrh.ui.dialog.WvPageListDialog;
 import com.yyrh.utils.ResourceUtil;
 import com.yyrh.utils.Utils;
 
@@ -52,14 +52,10 @@ public class BaseFragment extends Fragment implements View.OnClickListener {
     public void onClick(View v) {
         if (v.getId() == ResourceUtil.getId(getActivity(), "btn_kefu")){
 
-            if (!Utils.judgeStrNull(SDKSettings.UserCentUrl)){
-                HashMap<String,String> map = new HashMap<>();
-                map.put("game_code",SDKSettings.game_code);
-                map.put("gcp_code",SDKSettings.gcp_code);
+            if (!Utils.judgeStrNull(SDKSettings.initConfig.service_center)){
 
-                String url  = Utils.getUserCententerUrl(URLConstants.CUSTOMER_SERVICE_URL,map);
 
-                new WvPageListDialog(getActivity(),ResourceUtil.getStyleId(getActivity(),"qj_half_black_dialog"),url).show();
+                new WvPageListDialog(getActivity(),ResourceUtil.getStyleId(getActivity(),"qj_half_black_dialog"),SDKSettings.initConfig.service_center).show();
 
             }
 

+ 3 - 0
hnqj/src/main/java/com/yyrh/ui/fragment/FragmentUtils.java

@@ -11,6 +11,7 @@ public class FragmentUtils {
     public static final int SDK_REGISTER_TAG = 1;
     public static final int SDK_LOGIN_TAG = 2;
     public static final int SDK_PHONE_REGISTER_TAG = 3;
+    public static final int SDK_USER_SWITCH_ACCOUNT = 4;
     public static final int SDK_RETRIEVE_PWD_TAG = 6;
 
 
@@ -27,6 +28,8 @@ public class FragmentUtils {
                 return UserRegisterFragment.instantiate(context,UserPhoneLoginFragment.class.getName());
             case SDK_LOGIN_TAG:
                 return UserRegisterFragment.instantiate(context,UserAccountLoginFragment.class.getName());
+            case SDK_USER_SWITCH_ACCOUNT:
+                return UserRegisterFragment.instantiate(context,UserSwitchAccountLoginFragment.class.getName());
                 default:
                 return null;
 

+ 13 - 44
hnqj/src/main/java/com/yyrh/ui/fragment/UserAccountLoginFragment.java

@@ -32,9 +32,12 @@ import com.yyrh.ui.userlist.User;
 import com.yyrh.utils.ResourceUtil;
 import com.yyrh.utils.TosUtil;
 import com.yyrh.utils.Utils;
+import com.yyrh.utils.YYLog;
 
 import java.util.ArrayList;
 
+import static com.yyrh.constant.Constants.CLICK_INTERVAL;
+
 public class UserAccountLoginFragment extends BaseFragment {
 
     private EditText reg_account_edit,reg_pwd_edit;
@@ -49,13 +52,13 @@ public class UserAccountLoginFragment extends BaseFragment {
     private ListView account_listview;
 
 
-    private ImageView showListView,showPwd;
+    private ImageView showListView;
 
     private boolean isShowList = false;
 
     private TextView list_text;
 
-    private TimeCount time;
+    private long clickLoginTime = 0L;
 
     @Nullable
     @Override
@@ -119,7 +122,11 @@ public class UserAccountLoginFragment extends BaseFragment {
         super.onClick(v);
         int id = v.getId();
         if (id == ResourceUtil.getId(getActivity(), "reg_compete_btn")){
-
+            if (System.currentTimeMillis() - clickLoginTime < CLICK_INTERVAL) {
+                YYLog.i("调用登录接口太频繁,拦截此次操作");
+                return;
+            }
+            clickLoginTime = System.currentTimeMillis();
             startLogin(reg_account_edit.getText().toString(), reg_pwd_edit.getText().toString());
 
         }else if(id == ResourceUtil.getId(getActivity(), "down_btn")){
@@ -189,14 +196,12 @@ public class UserAccountLoginFragment extends BaseFragment {
 
             return;
         }
-        registerInterval();
+
         NetRequestApi.loginWithYy(true,getActivity(), account, pwd, new LoginCallback() {
             @Override
             public void onLoginSuccess(String token) {
 
-                if (time != null){
-                    time.cancel();
-                }
+
                 getActivity().finish();
 
                 YyrhSdkManager.defaultManager(SDKEntry.getSdkInstance().gameAct).saveUserLoginInfo(SDKEntry.getSdkInstance().gameAct,account,pwd,token);
@@ -207,7 +212,7 @@ public class UserAccountLoginFragment extends BaseFragment {
             public void onLoginFailed(String msg) {
                 new TosUtil(getActivity(),TosUtil.TOAST_ERROR, msg).show();
 
-                SDKEntry.getSdkInstance().loginCall.onLoginFailed(msg);
+                SDKEntry.getSdkInstance().sdkCallback.onLoginFailed(msg);
 
             }
 
@@ -220,46 +225,10 @@ public class UserAccountLoginFragment extends BaseFragment {
     }
 
 
-    private void registerInterval() {
-
-
-        reg_compete_btn.setEnabled(false);
-        reg_compete_btn.setText("3s");
-        reg_compete_btn.setBackgroundResource(ResourceUtil.getDrawableId(getActivity(),"qj_login_button_grayed_style"));
-        time = new TimeCount(3000, 1000);
-        time.start();
-    }
-    class TimeCount extends CountDownTimer {
-
-        public TimeCount(long millisInFuture, long countDownInterval) {
-            super(millisInFuture, countDownInterval);
-            // TODO Auto-generated constructor stub
-        }
-
-        @Override
-        public void onTick(long millisUntilFinished) {
-            // TODO Auto-generated method stub
-            reg_compete_btn.setText(millisUntilFinished / 1000 + "s");
-
-        }
-
-        @Override
-        public void onFinish() {
-            // TODO Auto-generated method stub
-            reg_compete_btn.setEnabled(true);
-            reg_compete_btn.setBackgroundResource(ResourceUtil.getDrawableId(getActivity(),"qj_login_button_style"));
-            reg_compete_btn.setText(ResourceUtil.getStringId(getActivity(), "qj_enter_game"));
-        }
-
-    }
 
     @Override
     public void onDestroy() {
         super.onDestroy();
-        if (time != null){
-            time.cancel();
-        }
-
 
     }
 

+ 16 - 46
hnqj/src/main/java/com/yyrh/ui/fragment/UserPhoneLoginFragment.java

@@ -19,12 +19,14 @@ import com.yyrh.constant.URLConstants;
 import com.yyrh.networking.NetRequestApi;
 import com.yyrh.sdk.SDKEntry;
 import com.yyrh.sdk.YyrhSdkManager;
-import com.yyrh.ui.WvPageListDialog;
+import com.yyrh.ui.dialog.WvPageListDialog;
 import com.yyrh.utils.ResourceUtil;
 import com.yyrh.utils.SignUtils;
 import com.yyrh.utils.TosUtil;
 import com.yyrh.utils.Utils;
+import com.yyrh.utils.YYLog;
 
+import static com.yyrh.constant.Constants.CLICK_INTERVAL;
 import static com.yyrh.constant.URLConstants.RSAKEY;
 
 
@@ -36,7 +38,7 @@ public class UserPhoneLoginFragment extends BaseFragment {
     private TextView tv_tip,tv_private_policy;
     private Button btn_get_code,btn_account_login,btn_guest_login,btn_reg_compete;
     private CodeVerifyTimeCount codeVerifyTimeCount;
-    private RegTimeCount regTimeCount;
+    private long clickLoginTime = 0L;
     @Nullable
     @Override
     public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
@@ -78,20 +80,25 @@ public class UserPhoneLoginFragment extends BaseFragment {
         super.onClick(v);
         int id = v.getId();
         if(id == ResourceUtil.getId(getActivity(), "tv_tip")){
-            String url  =  SDKSettings.UserCentUrl + URLConstants.USERPROTOCOLWEB + "gcp_code=" + SDKSettings.gcp_code
-                    + "&game_code=" + SDKSettings.game_code;
 
-            new WvPageListDialog(getActivity(),ResourceUtil.getStyleId(getActivity(),"qj_base_dialog"),url).show();
+
+            new WvPageListDialog(getActivity(),ResourceUtil.getStyleId(getActivity(),"qj_base_dialog"),SDKSettings.initConfig.agreement_user).show();
 
 
         }else if(id == ResourceUtil.getId(getActivity(), "tv_private_policy")){
 
-            String url  =  SDKSettings.UserCentUrl + URLConstants.USERPOLICYWEB + "gcp_code=" + SDKSettings.gcp_code
-                    + "&game_code=" + SDKSettings.game_code;
 
-            new WvPageListDialog(getActivity(),ResourceUtil.getStyleId(getActivity(),"qj_base_dialog"),url).show();
+
+            new WvPageListDialog(getActivity(),ResourceUtil.getStyleId(getActivity(),"qj_base_dialog"),SDKSettings.initConfig.agreement_privacy).show();
 
         }else if(id == ResourceUtil.getId(getActivity(), "btn_reg_compete")){
+
+            if (System.currentTimeMillis() - clickLoginTime < CLICK_INTERVAL) {
+                YYLog.i("调用登录接口太频繁,拦截此次操作");
+                return;
+            }
+            clickLoginTime = System.currentTimeMillis();
+
             registerWithPhone(getActivity());
 
         }else if(id == ResourceUtil.getId(getActivity(), "btn_get_code")){
@@ -124,10 +131,6 @@ public class UserPhoneLoginFragment extends BaseFragment {
         if (codeVerifyTimeCount != null){
             codeVerifyTimeCount.cancel();
         }
-        if (regTimeCount != null){
-            regTimeCount.cancel();
-        }
-
 
     }
 
@@ -174,7 +177,7 @@ public class UserPhoneLoginFragment extends BaseFragment {
             // TODO Auto-generated catch block
             e.printStackTrace();
         }
-        registerInterval();
+
         NetRequestApi.registerWithPhone(activity,code,userInfo, new PhoneRegisterCallback() {
             @Override
             public void onRegisterSuccess(String msg) {
@@ -265,39 +268,6 @@ public class UserPhoneLoginFragment extends BaseFragment {
 
     }
 
-    private void registerInterval() {
-
-
-
-
-        btn_reg_compete.setEnabled(false);
-        btn_reg_compete.setText("3s");
-        btn_reg_compete.setBackgroundResource(ResourceUtil.getDrawableId(getActivity(),"qj_login_button_grayed_style"));
-        regTimeCount = new RegTimeCount(3000, 1000);
-        regTimeCount.start();
-    }
-
-    class RegTimeCount extends CountDownTimer {
 
-        public RegTimeCount(long millisInFuture, long countDownInterval) {
-            super(millisInFuture, countDownInterval);
-            // TODO Auto-generated constructor stub
-        }
-
-        @Override
-        public void onTick(long millisUntilFinished) {
-            // TODO Auto-generated method stub
-            btn_reg_compete.setText(millisUntilFinished / 1000 + "s");
 
-        }
-
-        @Override
-        public void onFinish() {
-            // TODO Auto-generated method stub
-            btn_reg_compete.setEnabled(true);
-            btn_reg_compete.setBackgroundResource(ResourceUtil.getDrawableId(getActivity(),"qj_login_button_style"));
-            btn_reg_compete.setText(ResourceUtil.getStringId(getActivity(), "qj_login"));
-        }
-
-    }
 }

+ 15 - 45
hnqj/src/main/java/com/yyrh/ui/fragment/UserRegisterFragment.java

@@ -26,13 +26,15 @@ import com.yyrh.sdk.SDKEntry;
 import com.yyrh.sdk.YyrhSdkManager;
 import com.yyrh.sdk.callback.RegisterCallback;
 
-import com.yyrh.ui.WvPageListDialog;
+import com.yyrh.ui.dialog.WvPageListDialog;
 
 import com.yyrh.utils.ResourceUtil;
 import com.yyrh.utils.ScreenShotUtil;
 import com.yyrh.utils.TosUtil;
 import com.yyrh.utils.Utils;
+import com.yyrh.utils.YYLog;
 
+import static com.yyrh.constant.Constants.CLICK_INTERVAL;
 
 
 public class UserRegisterFragment extends BaseFragment {
@@ -43,7 +45,8 @@ public class UserRegisterFragment extends BaseFragment {
     private ImageButton close_btn;
     private CheckBox cb_register;
     private boolean isShowPwd = true;
-    private TimeCount time;
+    private long clickLoginTime = 0L;
+
     @Nullable
     @Override
     public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
@@ -97,7 +100,11 @@ public class UserRegisterFragment extends BaseFragment {
         super.onClick(v);
         int id = v.getId();
         if (id == ResourceUtil.getId(getActivity(), "reg_compete_btn")){
-            registerInterval();
+            if (System.currentTimeMillis() - clickLoginTime < CLICK_INTERVAL) {
+                YYLog.i("调用登录接口太频繁,拦截此次操作");
+                return;
+            }
+            clickLoginTime = System.currentTimeMillis();
             startRegister(reg_account_edit.getText().toString(), reg_pwd_edit.getText().toString());
         }else if(id == ResourceUtil.getId(getActivity(), "iv_clear_text")){
             reg_account_edit.setText("");
@@ -117,18 +124,16 @@ public class UserRegisterFragment extends BaseFragment {
             }
 
         }else if(id == ResourceUtil.getId(getActivity(), "tv_tip")){
-            String url  =  SDKSettings.UserCentUrl + URLConstants.USERPROTOCOLWEB + "gcp_code=" + SDKSettings.gcp_code
-                    + "&game_code=" + SDKSettings.game_code;
 
-            new WvPageListDialog(getActivity(),ResourceUtil.getStyleId(getActivity(),"qj_base_dialog"),url).show();
+
+            new WvPageListDialog(getActivity(),ResourceUtil.getStyleId(getActivity(),"qj_base_dialog"),SDKSettings.initConfig.agreement_user).show();
 
 
         }else if(id == ResourceUtil.getId(getActivity(), "tv_private_policy")){
 
-            String url  =  SDKSettings.UserCentUrl + URLConstants.USERPOLICYWEB + "gcp_code=" + SDKSettings.gcp_code
-                    + "&game_code=" + SDKSettings.game_code;
 
-            new WvPageListDialog(getActivity(),ResourceUtil.getStyleId(getActivity(),"qj_base_dialog"),url).show();
+
+            new WvPageListDialog(getActivity(),ResourceUtil.getStyleId(getActivity(),"qj_base_dialog"),SDKSettings.initConfig.agreement_privacy).show();
 
 
         }else if(id == ResourceUtil.getId(getActivity(), "btn_account_login")){
@@ -204,9 +209,7 @@ public class UserRegisterFragment extends BaseFragment {
                 SDKSettings.isVefityRealName = false;
                 YyrhSdkManager.defaultManager(SDKEntry.getSdkInstance().gameAct).saveUserLoginInfo(SDKEntry.getSdkInstance().gameAct,account,pwd,token);
                 SDKEntry.getSdkInstance().adSdkCallback.onRegisterSuccess(account);
-                if (time != null){
-                    time.cancel();
-                }
+
                 getActivity().finish();
             }
 
@@ -222,37 +225,4 @@ public class UserRegisterFragment extends BaseFragment {
 
     }
 
-    private void registerInterval() {
-
-
-        reg_compete_btn.setEnabled(false);
-        reg_compete_btn.setText("3s");
-        reg_compete_btn.setBackgroundResource(ResourceUtil.getDrawableId(getActivity(),"qj_login_button_grayed_style"));
-        time = new TimeCount(3000, 1000);
-        time.start();
-    }
-
-    class TimeCount extends CountDownTimer {
-
-        public TimeCount(long millisInFuture, long countDownInterval) {
-            super(millisInFuture, countDownInterval);
-            // TODO Auto-generated constructor stub
-        }
-
-        @Override
-        public void onTick(long millisUntilFinished) {
-            // TODO Auto-generated method stub
-            reg_compete_btn.setText(millisUntilFinished / 1000 + "s");
-
-        }
-
-        @Override
-        public void onFinish() {
-            // TODO Auto-generated method stub
-            reg_compete_btn.setEnabled(true);
-            reg_compete_btn.setBackgroundResource(ResourceUtil.getDrawableId(getActivity(),"qj_login_button_style"));
-            reg_compete_btn.setText(ResourceUtil.getStringId(getActivity(), "qj_login"));
-        }
-
-    }
 }

+ 3 - 8
hnqj/src/main/java/com/yyrh/ui/fragment/UserRetrievePwdFragment.java

@@ -14,12 +14,11 @@ import android.widget.Button;
 import android.widget.EditText;
 import android.widget.ImageButton;
 import android.widget.TextView;
-import android.widget.Toast;
 
 import com.yyrh.constant.SDKSettings;
 import com.yyrh.constant.URLConstants;
 import com.yyrh.networking.NetRequestApi;
-import com.yyrh.ui.WvPageListDialog;
+import com.yyrh.ui.dialog.WvPageListDialog;
 import com.yyrh.ui.userlist.DatabaseHelper;
 import com.yyrh.utils.ResourceUtil;
 import com.yyrh.utils.TosUtil;
@@ -107,15 +106,11 @@ public class UserRetrievePwdFragment extends BaseFragment {
             replaceFragmentToActivity(getFragmentManager(),accountLoginFragment,ResourceUtil.getId(getActivity(),"qj_content"));
 
         }else if (id == ResourceUtil.getId(getActivity(), "tv_tip_2")) {
-            if (!Utils.judgeStrNull(SDKSettings.UserCentUrl)){
+            if (!Utils.judgeStrNull(SDKSettings.initConfig.service_center)){
 
-                HashMap<String,String> map = new HashMap<>();
-                map.put("game_code",SDKSettings.game_code);
-                map.put("gcp_code",SDKSettings.gcp_code);
 
-                String url  = Utils.getUserCententerUrl(URLConstants.CUSTOMER_SERVICE_URL,map);
 
-                new WvPageListDialog(getActivity(),ResourceUtil.getStyleId(getActivity(),"qj_half_black_dialog"),url).show();
+                new WvPageListDialog(getActivity(),ResourceUtil.getStyleId(getActivity(),"qj_half_black_dialog"),SDKSettings.initConfig.service_center).show();
 
             }
         }

+ 213 - 0
hnqj/src/main/java/com/yyrh/ui/fragment/UserSwitchAccountLoginFragment.java

@@ -0,0 +1,213 @@
+package com.yyrh.ui.fragment;
+
+import android.app.Fragment;
+
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+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 com.yyrh.networking.NetRequestApi;
+import com.yyrh.sdk.SDKEntry;
+import com.yyrh.sdk.YyrhSdkManager;
+import com.yyrh.sdk.callback.LoginCallback;
+import com.yyrh.ui.AccountLoginListView;
+
+import com.yyrh.ui.userlist.DatabaseHelper;
+import com.yyrh.ui.userlist.User;
+import com.yyrh.utils.ResourceUtil;
+import com.yyrh.utils.TosUtil;
+import com.yyrh.utils.Utils;
+import com.yyrh.utils.YYLog;
+
+import java.util.ArrayList;
+
+import static com.yyrh.constant.Constants.CLICK_INTERVAL;
+
+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(),"qj_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(),"qj_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(),"qj_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);
+        }else  if (id == ResourceUtil.getId(getActivity(), "all_item_2")) {
+            startLogin(all_item_2.tv_account.getText().toString(),all_item_2.password);
+        }else  if (id == ResourceUtil.getId(getActivity(), "all_item_3")) {
+            startLogin(all_item_3.tv_account.getText().toString(),all_item_3.password);
+        }else  if (id == ResourceUtil.getId(getActivity(), "tv_other_login_type")) {
+            Fragment accountLoginFragment = FragmentUtils.getSdkFragment(getActivity(),FragmentUtils.SDK_PHONE_REGISTER_TAG);
+            replaceFragmentToActivity(getFragmentManager(),accountLoginFragment,ResourceUtil.getId(getActivity(),"qj_content"));
+
+        }
+    }
+
+    private void startLogin(final String account, final String pwd){
+        if (System.currentTimeMillis() - clickLoginTime < CLICK_INTERVAL) {
+            YYLog.i("调用登录接口太频繁,拦截此次操作");
+            return;
+        }
+        clickLoginTime = System.currentTimeMillis();
+
+        NetRequestApi.loginWithYy(true,getActivity(), account, pwd, new LoginCallback() {
+            @Override
+            public void onLoginSuccess(String token) {
+
+
+                getActivity().finish();
+
+                YyrhSdkManager.defaultManager(SDKEntry.getSdkInstance().gameAct).saveUserLoginInfo(SDKEntry.getSdkInstance().gameAct,account,pwd,token);
+
+            }
+
+            @Override
+            public void onLoginFailed(String msg) {
+                new TosUtil(getActivity(),TosUtil.TOAST_ERROR, msg).show();
+
+                SDKEntry.getSdkInstance().sdkCallback.onLoginFailed(msg);
+
+            }
+
+            @Override
+            public void onLoginError(String msg) {
+                new TosUtil(getActivity(),TosUtil.TOAST_ERROR, msg).show();
+            }
+        });
+
+    }
+    private void setAccountLoginListView(AccountLoginListView accountLoginListView,User user){
+        accountLoginListView.setVisibility(View.VISIBLE);
+        accountLoginListView.tv_account.setText(user.uname);
+        accountLoginListView.password = user.pwd;
+
+        if (Utils.isNumeric(user.uname)){
+            accountLoginListView.tv_account_type.setText(ResourceUtil.getStringId(getActivity(),"qj_phone_login_user"));
+            accountLoginListView.iv_account_icon.setImageResource(ResourceUtil.getMipmapId(getActivity(), "qj_phone_user"));
+        }
+
+    }
+    private void getTopThirdUserInfo() {
+        ArrayList<User> userList = new ArrayList<User>();
+        DatabaseHelper dbHelper = new DatabaseHelper(getActivity());
+        SQLiteDatabase db = dbHelper.getReadableDatabase();
+        String qurey_sql = "select name,pwd from user order by time desc";
+        Cursor cursor = db.rawQuery(qurey_sql, null);
+
+        while (cursor.moveToNext()) {
+            User user = new User();
+            user.uname = cursor.getString(0);
+            user.pwd = cursor.getString(1);
+            userList.add(user);
+        }
+        cursor.close();
+        db.close();
+
+
+
+        for (int i=0;i<userList.size();i++){
+
+            if (i == 0){
+
+                setAccountLoginListView(all_item_1,userList.get(i));
+
+            }else if(i == 1){
+
+                setAccountLoginListView(all_item_2,userList.get(i));
+
+
+            }else if(i == 2){
+
+                setAccountLoginListView(all_item_3,userList.get(i));
+
+            }
+        }
+    }
+}

+ 1 - 13
hnqj/src/main/java/com/yyrh/ui/userlist/QjUserListAdapter.java

@@ -86,15 +86,7 @@ public class QjUserListAdapter extends BaseAdapter {
 
 	}
 	private void deleteItem(int position){
-		String uname = list.get(position).uname;
-		SharedPreferences sp = context.getSharedPreferences("ninsw", Activity.MODE_PRIVATE);
-		SharedPreferences.Editor editor = sp.edit();
-		String name = sp.getString("username", "");
-		if(uname.endsWith("name")){
-			editor.remove("username");
-			editor.remove("password");
-		}
-		
+
 		
 		dbHelper = new DatabaseHelper(context);
 		SQLiteDatabase db = null;
@@ -104,10 +96,6 @@ public class QjUserListAdapter extends BaseAdapter {
 		db.execSQL(sql);   
 		db.close();
 		list.remove(position);
-		if(list.size()==0){
-
-		}
-	
 		this.notifyDataSetChanged();
 	}
 

+ 0 - 17
hnqj/src/main/java/com/yyrh/utils/SwitchUtil.java

@@ -60,22 +60,5 @@ public class SwitchUtil {
 
     }
 
-    public  static void saveInitData(JSONArray data){
-
-        if (data == null){
-
-            YYLog.i("reg_tabs is null.");
-
-        }else{
-            YYLog.i("reg_tabs : data" + data);
-            try {
-                if (data.get(0).toString().equals("phone")){
-                    InitConfig.fristShowPage = "phone";
-                }
-            } catch (JSONException e) {
-                e.printStackTrace();
-            }
-        }
-    }
 
 }

+ 7 - 4
hnqj/src/main/java/com/yythird/base/BaseSDK.java

@@ -56,6 +56,9 @@ public class BaseSDK {
         getSdkCallback().onGetOaidCallback(false, "");
     }
 
+    public boolean SDKGetPstatus(){
+        return false;
+    }
     public void SDKInitSuccess(String msg) {
     }
 
@@ -74,10 +77,10 @@ public class BaseSDK {
 
     }
     public void SDKExit(Activity ac, final ChannelSdkCallback sdkCallback) {
-        String tip = ac.getString(ResourceUtil.getStringId(ac, "qj_exit_tip"));
-        String message = ac.getString(ResourceUtil.getStringId(ac, "qj_issure_exit"));
-        String left = ac.getString(ResourceUtil.getStringId(ac, "qj_sure"));
-        String right = ac.getString(ResourceUtil.getStringId(ac, "qj_cancel"));
+        String tip = ac.getString(ResourceUtil.getStringId(ac, "yyrh_exit_tip"));
+        String message = ac.getString(ResourceUtil.getStringId(ac, "yyrh_issure_exit"));
+        String left = ac.getString(ResourceUtil.getStringId(ac, "yyrh_sure"));
+        String right = ac.getString(ResourceUtil.getStringId(ac, "yyrh_cancel"));
         new AlertDialog.Builder(ac)
                 .setTitle(tip)
                 .setMessage(message)

+ 3 - 3
hnqj/src/main/java/com/yythird/sdk/ChannelSDK.java

@@ -57,10 +57,10 @@ public class ChannelSDK extends BaseSDK {
 
     }
 
-    @Override
-    public void SDKExit(Activity ac, ChannelSdkCallback sdkCallback) {
-
 
+    @Override
+    public void SDKGetOaid() {
+        super.SDKGetOaid();
     }
 
     @Override

+ 11 - 0
hnqj/src/main/res/drawable/qj_hide_float_view_bg.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android" >
+
+
+
+        <solid android:color="@color/qj_hide_view_orange" />
+
+         <corners android:radius="10dp"/>
+
+
+</shape>

+ 5 - 0
hnqj/src/main/res/drawable/qj_login_list_bg.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="@color/qj_white" />
+    <corners android:radius="6dp" />
+</shape>

+ 7 - 0
hnqj/src/main/res/drawable/qj_login_list_btn_red_bg.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="@color/qj_account_list_red" />
+    <corners
+        android:radius="70dp"
+        />
+</shape>

+ 8 - 0
hnqj/src/main/res/drawable/qj_login_list_btn_yellow_bg.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="@color/qj_account_list_yellow" />
+    <corners
+        android:topLeftRadius="20dp"
+        android:bottomLeftRadius="20dp"
+        />
+</shape>

+ 48 - 0
hnqj/src/main/res/layout/qj_email_dialog.xml

@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="460dp"
+    android:layout_height="300dp"
+    android:background="@drawable/qj_common_wv_bg"
+    android:orientation="vertical"
+    android:id="@+id/ll_webview_common"
+    android:padding="5dp"
+    >
+
+    <RelativeLayout
+        android:id="@+id/rl1"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        >
+
+
+        <WebView
+            android:id="@+id/wb_user_info"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_gravity="center"
+            android:background="@drawable/qj_common_wv_bg"
+            />
+
+
+        <ImageView
+            android:layout_width="30dp"
+            android:layout_height="30dp"
+            android:layout_centerInParent="true"
+            android:id="@+id/qj_loading"
+            android:background="@mipmap/qj_loading"/>
+        <ImageView
+            android:id="@+id/close_btn"
+            android:layout_width="28dp"
+            android:layout_height="28dp"
+
+            android:src="@mipmap/qj_close"
+            android:layout_alignParentRight="true"
+            android:layout_marginRight="15dp"
+            android:layout_marginTop="15dp"
+            android:padding="6dp"
+            />
+    </RelativeLayout>
+
+
+
+</LinearLayout>

+ 1 - 0
hnqj/src/main/res/layout/qj_exit_game_dialog.xml

@@ -24,6 +24,7 @@
             android:textSize="18sp"
             />
         <TextView
+            android:id="@+id/qj_issure_exit"
             android:layout_width="match_parent"
             android:layout_height="45dp"
             android:gravity="center_horizontal"

+ 16 - 0
hnqj/src/main/res/layout/qj_hide_float_view.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical" android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:id="@+id/ll_hide"
+    android:background="@color/qj_text_black">
+    <TextView
+        android:layout_width="130dp"
+        android:layout_height="40dp"
+        android:drawableLeft="@mipmap/qj_hide_float_eye_view"
+        android:paddingLeft="5dp"
+        android:textColor="@color/qj_white"
+        android:text="@string/qj_close_float_view"
+        android:gravity="center"/>
+    
+</LinearLayout>

+ 63 - 0
hnqj/src/main/res/layout/qj_login_list.xml

@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="300dp"
+    android:layout_height="43dp"
+    android:background="@drawable/qj_login_list_bg"
+    >
+    <ImageView
+        android:id="@+id/iv_account_icon"
+        android:layout_width="28dp"
+        android:layout_height="28dp"
+        android:background="@mipmap/qj_account_user"
+        android:layout_centerVertical="true"
+        android:layout_marginLeft="10dp"
+        />
+    <TextView
+        android:id="@+id/tv_account_type"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/qj_account_login_user"
+        android:textColor="@color/qj_text_black"
+        android:layout_toRightOf="@id/iv_account_icon"
+        android:layout_marginLeft="10dp"
+        android:layout_marginTop="5dp"
+        android:textSize="12dp"
+        />
+    <TextView
+        android:id="@+id/tv_account"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+
+        android:layout_toRightOf="@id/iv_account_icon"
+        android:layout_below="@+id/tv_account_type"
+        android:textSize="12dp"
+        android:textColor="@color/qj_text_orange_color"
+        android:layout_marginLeft="10dp"
+
+        />
+        <Button
+            android:id="@+id/btn_common_use"
+            android:layout_width="40dp"
+            android:layout_height="20dp"
+            android:background="@drawable/qj_login_list_btn_yellow_bg"
+            android:layout_alignParentRight="true"
+            android:layout_centerVertical="true"
+            android:text="@string/qj_common_use"
+            android:textColor="@color/qj_white"
+            android:textSize="11dp"
+
+            />
+    <Button
+        android:id="@+id/btn_delete"
+        android:layout_width="55dp"
+        android:layout_height="22dp"
+        android:background="@drawable/qj_login_list_btn_red_bg"
+        android:layout_alignParentRight="true"
+        android:layout_centerVertical="true"
+        android:text="@string/qj_delete_use"
+        android:textColor="@color/qj_white"
+        android:textSize="11dp"
+        android:layout_marginRight="10dp"
+        android:visibility="gone"
+        />
+</RelativeLayout>

+ 5 - 2
hnqj/src/main/res/layout/qj_retrieve_pwd.xml

@@ -111,9 +111,9 @@
             android:background="@drawable/qj_edittext_bg"
             android:drawableLeft="@mipmap/qj_lock"
             android:textColorHint="@color/qj_text_hint_color"
-            android:drawablePadding="10dp"
+            android:drawablePadding="20dp"
             android:hint="@string/qj_input_new_pwd"
-            android:paddingLeft="20dp"
+            android:paddingLeft="12dp"
             android:textSize="16sp"
             android:maxLength="20"
             android:digits="0123456789abcdefghijgklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
@@ -150,6 +150,7 @@
             android:gravity="center"
             android:layout_marginLeft="40dp"
             android:text="@string/qj_forget_pwd_tip"
+            android:textColor="@color/qj_text_black"
 
             />
         <TextView
@@ -172,6 +173,8 @@
             android:gravity="center"
             android:text="@string/qj_get_back_tip"
             android:layout_toRightOf="@id/tv_tip_2"
+            android:textColor="@color/qj_text_black"
+
             />
     </RelativeLayout>
 </LinearLayout>

+ 84 - 0
hnqj/src/main/res/layout/qj_switch_account_login.xml

@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="360dp"
+    android:layout_height="280dp"
+    android:background="@drawable/qj_login_bg"
+    >
+
+    <RelativeLayout
+        android:id="@+id/rl1"
+        android:layout_width="match_parent"
+        android:layout_height="50dp">
+
+        <ImageView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:layout_centerInParent= "true"
+            android:background="@mipmap/qj_logo"
+            />
+
+    </RelativeLayout>
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="30dp"
+        android:text="@string/qj_select_account"
+        android:layout_below="@id/rl1"
+        android:layout_marginLeft="30dp"
+        android:textSize="17sp"
+        android:gravity="center"
+        android:textColor="@color/qj_text_black"
+        />
+    <TextView
+        android:id="@+id/ib_edit_account"
+        android:layout_width="wrap_content"
+        android:layout_height="30dp"
+        android:layout_below="@id/rl1"
+        android:layout_alignRight="@id/rl1"
+        android:layout_marginRight="30dp"
+        android:gravity="center"
+        android:textSize="17sp"
+        android:textColor="@color/qj_account_edit_color"
+        android:drawableRight="@mipmap/qj_edit_account"
+        />
+    <com.yyrh.ui.AccountLoginListView
+        android:id="@+id/all_item_1"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/ib_edit_account"
+        android:layout_centerHorizontal="true"
+        android:layout_marginTop="3dp"
+        android:visibility="gone"
+        />
+    <com.yyrh.ui.AccountLoginListView
+        android:id="@+id/all_item_2"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/all_item_1"
+        android:layout_centerHorizontal="true"
+        android:layout_marginTop="10dp"
+        android:visibility="gone"
+        />
+    <com.yyrh.ui.AccountLoginListView
+        android:id="@+id/all_item_3"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/all_item_2"
+        android:layout_centerHorizontal="true"
+        android:layout_marginTop="10dp"
+        android:visibility="gone"
+        />
+    <TextView
+        android:id="@+id/tv_other_login_type"
+        android:layout_marginTop="10dp"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/qj_other_login_type"
+        android:textSize="16sp"
+        android:textColor="@color/qj_text_orange_color"
+        android:layout_centerHorizontal="true"
+        android:layout_marginBottom="15dp"
+        android:layout_alignParentBottom="true"
+        />
+</RelativeLayout>

+ 45 - 0
hnqj/src/main/res/layout/qj_usercenter_dialog.xml

@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    >
+
+
+
+    <RelativeLayout
+        android:id="@+id/rl1"
+        android:layout_width="520dp"
+        android:layout_height="match_parent"
+
+        >
+
+
+        <WebView
+            android:id="@+id/wb_user_info"
+            android:layout_width="387dp"
+            android:layout_height="match_parent"
+            android:layout_marginTop="22dp"
+            android:layout_marginBottom="22dp"
+            android:layout_centerVertical="true"
+            android:background="@drawable/qj_common_wv_bg"
+            />
+
+
+
+        <ImageView
+            android:id="@+id/close_btn"
+            android:layout_width="30dp"
+            android:layout_height="30dp"
+            android:layout_toRightOf="@id/wb_user_info"
+            android:background="@mipmap/qj_usercenter_close"
+            android:layout_marginTop="10dp"
+            android:layout_marginLeft="15dp"
+
+
+            />
+    </RelativeLayout>
+
+
+
+</LinearLayout>

+ 45 - 0
hnqj/src/main/res/layout/qj_usercenter_portait_dialog.xml

@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    >
+
+
+
+    <RelativeLayout
+        android:id="@+id/rl1"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+
+        >
+
+
+        <WebView
+            android:id="@+id/wb_user_info"
+            android:layout_width="350dp"
+            android:layout_height="320dp"
+            android:layout_marginTop="25dp"
+            android:layout_marginBottom="25dp"
+            android:layout_centerInParent="true"
+            android:background="@drawable/qj_common_wv_bg"
+            />
+
+
+        <ImageView
+            android:id="@+id/close_btn"
+            android:layout_width="30dp"
+            android:layout_height="30dp"
+            android:layout_alignRight="@id/wb_user_info"
+            android:layout_alignTop="@id/wb_user_info"
+            android:layout_marginTop="8dp"
+            android:layout_marginRight="8dp"
+            android:src="@mipmap/qj_close"
+            android:padding="8dp"
+
+            />
+    </RelativeLayout>
+
+
+
+</LinearLayout>

+ 0 - 1
hnqj/src/main/res/layout/qj_webview_common_dialog.xml

@@ -2,7 +2,6 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="360dp"
     android:layout_height="280dp"
-    android:background="@drawable/qj_common_wv_bg"
     android:orientation="vertical"
     android:id="@+id/ll_webview_common"
     >

BIN
hnqj/src/main/res/mipmap-xhdpi/qj_account_user.png


BIN
hnqj/src/main/res/mipmap-xhdpi/qj_edit_account.png


BIN
hnqj/src/main/res/mipmap-xhdpi/qj_hide_float_eye_view.png


BIN
hnqj/src/main/res/mipmap-xhdpi/qj_phone_user.png


BIN
hnqj/src/main/res/mipmap-xhdpi/qj_usercenter_close.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_account_icon.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_accoutn_del_x.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_arrow_account.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_arrow_normal.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_arrow_select.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_arrow_up_account.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_back_btn.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_bt_back_up.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_close_btn.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_eye_icon_normal.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_eye_icon_select.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_hide_pwd.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_item_normal.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_item_select.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_lock.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_name_icon.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_phone_icon.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_pwd_icon.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_show_pwd.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_tips_error.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_tips_success.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_trumpet.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_user_head.png


BIN
hnqj/src/main/res/mipmap-xhdpi/yyrh_wv_close.png


+ 5 - 0
hnqj/src/main/res/values/colors.xml

@@ -26,4 +26,9 @@
     <color name="qj_dialog_line">#999999</color>
     <color name="qj_blues">#2abfff</color>
     <color name="qj_white_90">#E6FFFFFF</color>
+    <color name="qj_account_list_yellow">#FFC433</color>
+    <color name="qj_account_list_red">#E85C56</color>
+    <color name="qj_account_edit_color">#F8693C</color>
+    <color name="qj_hide_view_orange">#FF9D4B</color>
+
 </resources>

+ 12 - 2
hnqj/src/main/res/values/strings.xml

@@ -1,7 +1,7 @@
 <resources>
 
 
-    <string name="qj_visitors_register">游客登录</string>
+    <string name="qj_visitors_register">快速登录</string>
     <string name="qj_input_your_account">请输入账号</string>
     <string name="qj_input_your_pwd">请输入密码</string>
     <string name="qj_agreement_tip">我已阅读并同意</string>
@@ -17,7 +17,7 @@
     <string name="qj_contact_tip">联系客服</string>
     <string name="qj_get_back_tip">找回</string>
     <string name="qj_account_login">账号登录</string>
-    <string name="qj_guset_login">游客登录</string>
+    <string name="qj_guset_login">快速注册</string>
     <string name="qj_login">登录</string>
     <string name="qj_switch_account">切换账号</string>
     <string name="qj_enter_game_tip">,欢迎进入游戏\t\t\t\t</string>
@@ -57,4 +57,14 @@
     <string name="qj_pls_upload_roleinfo_frist">请先调用上传角色信息</string>
     <string name="qj_exit_tip">提 示</string>
     <string name="qj_register">注册</string>
+    <string name="qj_select_account">选择已有账号登录</string>
+    <string name="qj_other_login_type">其他登录方式</string>
+    <string name="qj_phone_login_user">手机号登录</string>
+    <string name="qj_account_login_user">账号登录</string>
+    <string name="qj_common_use">常用</string>
+    <string name="qj_delete_use">删除</string>
+    <string name="qj_close_float_view">拖到此处隐藏</string>
+    <string name="qj_close_float_view_tip">点击确认隐藏,我们将在下次 登录时回归</string>
+    <string name="qj_delete_account_tip">是否删除账号:</string>
+    <string name="qj_commit_edit">完成编辑</string>
 </resources>

+ 0 - 1
hnqj/src/main/res/values/styles.xml

@@ -56,7 +56,6 @@
     <item name="android:windowFullscreen">true</item>
     </style>
 
-
     <style name="qj_auto_login_dialog" parent="@android:style/Theme.Dialog">
 
         <item name="android:windowFrame">@null</item>