|
@@ -58,8 +58,8 @@ public class LoginAct extends BaseUMActivity implements LoginController {
|
|
|
public void initView() {
|
|
public void initView() {
|
|
|
TitleBarUtils.getInstance().setTitleBack(this);
|
|
TitleBarUtils.getInstance().setTitleBack(this);
|
|
|
// if (DDProviderHelper.getInstance().getAccountList().size() == 0) {
|
|
// if (DDProviderHelper.getInstance().getAccountList().size() == 0) {
|
|
|
- WelcomeFgt welcomeFragment = WelcomeFgt.newInstance(this);
|
|
|
|
|
- showFragment("welcome", welcomeFragment);
|
|
|
|
|
|
|
+ WelcomeFgt welcomeFragment = WelcomeFgt.newInstance(this);
|
|
|
|
|
+ showFragment("welcome", welcomeFragment);
|
|
|
// } else {
|
|
// } else {
|
|
|
// SignInFgt signInFragment = SignInFgt.newInstance(this);
|
|
// SignInFgt signInFragment = SignInFgt.newInstance(this);
|
|
|
// showFragment("登录", signInFragment);
|
|
// showFragment("登录", signInFragment);
|
|
@@ -79,8 +79,8 @@ public class LoginAct extends BaseUMActivity implements LoginController {
|
|
|
if (getSupportFragmentManager().getBackStackEntryCount() == 1) {
|
|
if (getSupportFragmentManager().getBackStackEntryCount() == 1) {
|
|
|
TitleBarUtils.getInstance().setShowOrHide(this, false);
|
|
TitleBarUtils.getInstance().setShowOrHide(this, false);
|
|
|
}
|
|
}
|
|
|
- if(getSupportActionBar()!=null){
|
|
|
|
|
- if(getSupportFragmentManager().getBackStackEntryCount() == 1) {
|
|
|
|
|
|
|
+ if (getSupportActionBar() != null) {
|
|
|
|
|
+ if (getSupportFragmentManager().getBackStackEntryCount() == 1) {
|
|
|
getSupportActionBar().hide();
|
|
getSupportActionBar().hide();
|
|
|
} else {
|
|
} else {
|
|
|
getSupportActionBar().show();
|
|
getSupportActionBar().show();
|
|
@@ -97,17 +97,12 @@ public class LoginAct extends BaseUMActivity implements LoginController {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void whenLoginSuccess(int platform, LoginEntity loginResult) {
|
|
public void whenLoginSuccess(int platform, LoginEntity loginResult) {
|
|
|
- if (TextUtils.isEmpty(SheepApp.getInstance().getGameCode())) {
|
|
|
|
|
// Snackbar.make(getWindow().getDecorView(), "登录成功", Snackbar.LENGTH_SHORT).show();
|
|
// Snackbar.make(getWindow().getDecorView(), "登录成功", Snackbar.LENGTH_SHORT).show();
|
|
|
- if (TextUtils.isEmpty(loginResult.getUser().getBirthday())
|
|
|
|
|
- || loginResult.getUser().getBirthday().startsWith("000")) {
|
|
|
|
|
- getUserInfo(platform, loginResult);
|
|
|
|
|
- } else {
|
|
|
|
|
- goMain(loginResult);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (TextUtils.isEmpty(loginResult.getUser().getBirthday())
|
|
|
|
|
+ || loginResult.getUser().getBirthday().startsWith("000")) {
|
|
|
|
|
+ getUserInfo(platform, loginResult);
|
|
|
} else {
|
|
} else {
|
|
|
- CertificationUtil.newInstance().addCurUserToSdkLoginUser();
|
|
|
|
|
- CertificationUtil.newInstance().authCertificationCode(this, SpUtils.getToken(SheepApp.getInstance()));
|
|
|
|
|
|
|
+ goMain(loginResult);
|
|
|
}
|
|
}
|
|
|
TestUtil.saveUser(loginResult);
|
|
TestUtil.saveUser(loginResult);
|
|
|
if (platform == LoginController.PLATFORM_ACCOUNT || platform == LoginController.PLATFORM_PHONE) {
|
|
if (platform == LoginController.PLATFORM_ACCOUNT || platform == LoginController.PLATFORM_PHONE) {
|
|
@@ -161,9 +156,14 @@ public class LoginAct extends BaseUMActivity implements LoginController {
|
|
|
goMain(entity);
|
|
goMain(entity);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void goMain(LoginEntity entity){
|
|
|
|
|
- showProgress();
|
|
|
|
|
- Jump2View.getInstance().checkOrGoHomePage(this);
|
|
|
|
|
|
|
+ private void goMain(LoginEntity entity) {
|
|
|
|
|
+ CertificationUtil.newInstance().addCurUserToSdkLoginUser();
|
|
|
|
|
+ if (TextUtils.isEmpty(SheepApp.getInstance().getGameCode())) {
|
|
|
|
|
+ showProgress();
|
|
|
|
|
+ Jump2View.getInstance().checkOrGoHomePage(this);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ CertificationUtil.newInstance().authCertificationCode(this, SpUtils.getToken(SheepApp.getInstance()));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -185,8 +185,8 @@ public class LoginAct extends BaseUMActivity implements LoginController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void showFragment(String tag, Fragment fragment) {
|
|
private void showFragment(String tag, Fragment fragment) {
|
|
|
- if(getSupportActionBar()!=null){
|
|
|
|
|
- if(getSupportFragmentManager().getBackStackEntryCount() > 0) {
|
|
|
|
|
|
|
+ if (getSupportActionBar() != null) {
|
|
|
|
|
+ if (getSupportFragmentManager().getBackStackEntryCount() > 0) {
|
|
|
getSupportActionBar().show();
|
|
getSupportActionBar().show();
|
|
|
} else {
|
|
} else {
|
|
|
getSupportActionBar().hide();
|
|
getSupportActionBar().hide();
|