|
@@ -7,6 +7,7 @@ import android.content.Intent;
|
|
import android.content.SharedPreferences;
|
|
import android.content.SharedPreferences;
|
|
import android.os.Build;
|
|
import android.os.Build;
|
|
import android.os.Handler;
|
|
import android.os.Handler;
|
|
|
|
+import android.support.annotation.UiThread;
|
|
import android.util.Log;
|
|
import android.util.Log;
|
|
|
|
|
|
import com.yyrh.constant.InitConfig;
|
|
import com.yyrh.constant.InitConfig;
|
|
@@ -286,12 +287,12 @@ public class YyrhSdkManager {
|
|
|
|
|
|
|
|
|
|
private void autoLogin(final Activity activity) {
|
|
private void autoLogin(final Activity activity) {
|
|
- AutoLoginDialog.Builder builder = new AutoLoginDialog.Builder(activity);
|
|
|
|
|
|
+ final AutoLoginDialog.Builder builder = new AutoLoginDialog.Builder(activity);
|
|
builder.setPositiveButton(new DialogInterface.OnClickListener() {
|
|
builder.setPositiveButton(new DialogInterface.OnClickListener() {
|
|
@Override
|
|
@Override
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
//取消回调
|
|
//取消回调
|
|
- dialog.dismiss();
|
|
|
|
|
|
+ builder.dialogDismiss();
|
|
|
|
|
|
showLoginView(activity,FragmentUtils.SDK_USER_SWITCH_ACCOUNT);
|
|
showLoginView(activity,FragmentUtils.SDK_USER_SWITCH_ACCOUNT);
|
|
|
|
|
|
@@ -334,6 +335,7 @@ public class YyrhSdkManager {
|
|
}
|
|
}
|
|
|
|
|
|
public void yyrhExitGame(final Activity activity){
|
|
public void yyrhExitGame(final Activity activity){
|
|
|
|
+ YYLog.i("yyrhExitGame");
|
|
CustomExitGameDialog.Builder builder = new CustomExitGameDialog.Builder(activity);
|
|
CustomExitGameDialog.Builder builder = new CustomExitGameDialog.Builder(activity);
|
|
builder.setPositiveButton(new DialogInterface.OnClickListener() {
|
|
builder.setPositiveButton(new DialogInterface.OnClickListener() {
|
|
@Override
|
|
@Override
|
|
@@ -341,9 +343,10 @@ public class YyrhSdkManager {
|
|
|
|
|
|
FloatViewManager.defaultManager(activity).destroyFloat();
|
|
FloatViewManager.defaultManager(activity).destroyFloat();
|
|
|
|
|
|
- dialog.dismiss();
|
|
|
|
|
|
+
|
|
SDKEntry.getSdkInstance().adSdkCallback.onExitGame(activity);
|
|
SDKEntry.getSdkInstance().adSdkCallback.onExitGame(activity);
|
|
SDKEntry.getSdkInstance().sdkCallback.onExiGameCallback(true,"Exit Game.");
|
|
SDKEntry.getSdkInstance().sdkCallback.onExiGameCallback(true,"Exit Game.");
|
|
|
|
+ dialog.dismiss();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
builder.setnegativeButton(new DialogInterface.OnClickListener() {
|
|
builder.setnegativeButton(new DialogInterface.OnClickListener() {
|
|
@@ -385,84 +388,56 @@ public class YyrhSdkManager {
|
|
DatabaseHelper.excuteSql(context, insert_sql);
|
|
DatabaseHelper.excuteSql(context, insert_sql);
|
|
|
|
|
|
|
|
|
|
- if (isOpenRealName){
|
|
|
|
-
|
|
|
|
- if (!isVefityRealName){
|
|
|
|
-
|
|
|
|
- if (SDKSettings.isForceRealName){
|
|
|
|
-
|
|
|
|
- new WvPageListDialog(context, ResourceUtil.getStyleId(context, "qj_half_black_dialog"), SDKSettings.loginData.authentication,
|
|
|
|
- new WvPageListDialog.OnClosePageListener() {
|
|
|
|
- @Override
|
|
|
|
- public void onClose() {
|
|
|
|
-
|
|
|
|
- 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) {
|
|
|
|
-
|
|
|
|
|
|
+ operateRealNameDialog(token);
|
|
|
|
+}
|
|
|
|
|
|
- SDKEntry.getSdkInstance().sdkCallback.onLoginSuccess(token);
|
|
|
|
|
|
+ void operateRealNameDialog(final String token) {
|
|
|
|
+ if (isOpenRealName) {
|
|
|
|
|
|
|
|
+ if (isVefityRealName) {
|
|
|
|
|
|
|
|
+ new WvPageListDialog(context, ResourceUtil.getStyleId(context, "qj_half_black_dialog"), SDKSettings.loginData.authentication,
|
|
|
|
+ new WvPageListDialog.OnClosePageListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onClose() {
|
|
|
|
|
|
- }
|
|
|
|
- },SDKSettings.isForceRealName).show();
|
|
|
|
- }else {
|
|
|
|
- new WvPageListDialog(context, ResourceUtil.getStyleId(context, "qj_half_black_dialog"), SDKSettings.loginData.authentication,
|
|
|
|
- new WvPageListDialog.OnClosePageListener() {
|
|
|
|
- @Override
|
|
|
|
- public void onClose() {
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- SDKEntry.getSdkInstance().sdkCallback.onLoginSuccess(token);
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public void onDissmiss() {
|
|
|
|
|
|
|
|
+ showLoginSuccessUi(token);
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- @Override
|
|
|
|
- public void onDissmiss() {
|
|
|
|
- operateFloatViewInUIThread((Activity)context,SHOW_FLOAT);
|
|
|
|
- openEmaiDialogInUIThread((Activity) context);
|
|
|
|
- }
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public void onRealNameSuccess(String birthday) {
|
|
|
|
+ YYLog.i("onRealNameSuccess");
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ }, SDKSettings.isForceRealName).show();
|
|
|
|
|
|
- @Override
|
|
|
|
- public void onRealNameSuccess(String birthday) {
|
|
|
|
- YYLog.i("onRealNameSuccess");
|
|
|
|
|
|
|
|
- }
|
|
|
|
- }).show();
|
|
|
|
|
|
+ } else {
|
|
|
|
|
|
|
|
+ showLoginSuccessUi(token);
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
|
|
|
|
- operateFloatViewInUIThread((Activity)context,SHOW_FLOAT);
|
|
|
|
- SDKEntry.getSdkInstance().sdkCallback.onLoginSuccess(token);
|
|
|
|
|
|
+ showLoginSuccessUi(token);
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
- }else{
|
|
|
|
- operateFloatViewInUIThread((Activity)context,SHOW_FLOAT);
|
|
|
|
- SDKEntry.getSdkInstance().sdkCallback.onLoginSuccess(token);
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
+ private void showLoginSuccessUi(String token){
|
|
|
|
+ openEmaiDialogInUIThread((Activity) context);
|
|
|
|
+ operateFloatViewInUIThread((Activity) context, SHOW_FLOAT);
|
|
|
|
+ SDKEntry.getSdkInstance().sdkCallback.onLoginSuccess(token);
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
public void yyrhGetRealNameInfo(Activity activity,RealNameMsgCallback msgCallback){
|
|
public void yyrhGetRealNameInfo(Activity activity,RealNameMsgCallback msgCallback){
|
|
|
|
|
|
@@ -496,7 +471,7 @@ public class YyrhSdkManager {
|
|
@Override
|
|
@Override
|
|
public void run() {
|
|
public void run() {
|
|
|
|
|
|
- new EmailDialog(context, ResourceUtil.getStyleId(context, "qj_half_black_dialog"),SDKSettings.loginData.solo_email).show();
|
|
|
|
|
|
+ new EmailDialog(gameAct, ResourceUtil.getStyleId(gameAct, "qj_half_black_dialog"),SDKSettings.loginData.solo_email).show();
|
|
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|