|
|
@@ -117,27 +117,20 @@ public class SplashActivity extends BaseActivity {
|
|
|
return;
|
|
|
}
|
|
|
int userStatus = LoginHelper.prepareUser(mContext);
|
|
|
- Intent intent = new Intent();
|
|
|
switch (userStatus) {
|
|
|
case LoginHelper.STATUS_USER_FULL://5
|
|
|
case LoginHelper.STATUS_USER_NO_UPDATE://3
|
|
|
- intent.setClass(mContext, MainActivity.class);
|
|
|
+ trun2NextPage(1);
|
|
|
break;
|
|
|
case LoginHelper.STATUS_USER_TOKEN_OVERDUE://2
|
|
|
case LoginHelper.STATUS_USER_SIMPLE_TELPHONE:
|
|
|
- boolean isFirst = PreferenceUtils.getBoolean(IS_FIRST, true);
|
|
|
- if (isFirst) {
|
|
|
- intent.setClass(mContext, ADActivity.class);
|
|
|
- } else
|
|
|
- intent.setClass(mContext, LoginActivity.class);
|
|
|
+ trun2NextPage(0);
|
|
|
break;
|
|
|
case LoginHelper.STATUS_NO_USER://0
|
|
|
default:
|
|
|
stay();
|
|
|
return;// must return
|
|
|
}
|
|
|
- startActivity(intent);
|
|
|
- finish();
|
|
|
}
|
|
|
|
|
|
private void jump2() {
|
|
|
@@ -206,11 +199,9 @@ public class SplashActivity extends BaseActivity {
|
|
|
success = LoginHelper.setLoginUser(mContext, phoneNumber, password, result);// 设置登陆用户信息
|
|
|
}
|
|
|
if (success) {// 登陆IM成功
|
|
|
- startActivity(new Intent(SplashActivity.this, MainActivity.class));
|
|
|
- //TODO 获取此刻精确时间并转换为yyyy-MM-dd HH:mm:ss
|
|
|
+ trun2NextPage(1);
|
|
|
String nowtime = TimeUtils.f_long_2_str(System.currentTimeMillis());
|
|
|
String saved_time = PreferenceUtils.getString(MyApplication.getInstance(), TimeStatisticsActivity.Login_In);
|
|
|
-
|
|
|
if (!TextUtils.isEmpty(saved_time)) {
|
|
|
PreferenceUtils.putString(TimeStatisticsActivity.Login_In, saved_time + "," + nowtime);
|
|
|
} else {
|
|
|
@@ -226,15 +217,27 @@ public class SplashActivity extends BaseActivity {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ private void trun2NextPage(int type) {
|
|
|
+ boolean isFirst = PreferenceUtils.getBoolean(IS_FIRST, true);
|
|
|
+ Intent intent = new Intent();
|
|
|
+ if (isFirst) {
|
|
|
+ intent.setClass(this, ADActivity.class);
|
|
|
+ intent.putExtra("type", type);
|
|
|
+ } else {
|
|
|
+ if (type == 1) {
|
|
|
+ intent.setClass(this, MainActivity.class);
|
|
|
+ } else {
|
|
|
+ intent.setClass(this, LoginActivity.class);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ startActivity(intent);
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+
|
|
|
// 停留在此界面
|
|
|
private void stay() {
|
|
|
mSelectLv.setVisibility(View.GONE);
|
|
|
- boolean isFirst = PreferenceUtils.getBoolean(IS_FIRST, true);
|
|
|
- if (isFirst) {
|
|
|
- startActivity(new Intent(mContext, ADActivity.class));
|
|
|
- finish();
|
|
|
- } else
|
|
|
- startActivity(new Intent(mContext, LoginActivity.class));
|
|
|
+ trun2NextPage(0);
|
|
|
Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha_in);
|
|
|
mSelectLv.startAnimation(anim);
|
|
|
}
|