V3.0 10月10日测试包

This commit is contained in:
kehaoyuan
2017-10-10 16:36:10 +08:00
parent 7f303b362d
commit 572274a2e3
4 changed files with 45 additions and 14 deletions

View File

@ -363,7 +363,9 @@ public class LoginUtils {
@Override
public void onFailure(HttpException e) {
super.onFailure(e);
Utils.toast(context, context.getString(R.string.login_failure_hint));
if (loginTag != null) {
Utils.toast(context, context.getString(R.string.login_failure_hint));
}
if (loginTag != null && loginTag.equals(LoginTag.qq)) {
GetLoginDataUtils.getInstance(context).QQLogout();
}

View File

@ -14,6 +14,8 @@ class KaiFuServerEntity(source: Parcel) : Parcelable {
var type: String? = null
var order: Int = -1
override fun describeContents(): Int {
return 0
}
@ -22,12 +24,14 @@ class KaiFuServerEntity(source: Parcel) : Parcelable {
dest.writeString(this.note)
dest.writeLong(this.time)
dest.writeString(this.type)
dest.writeInt(this.order)
}
init {
this.note = source.readString()
this.time = source.readLong()
this.type = source.readString()
this.order = source.readInt()
}
companion object {

View File

@ -33,6 +33,8 @@ import org.greenrobot.eventbus.EventBus;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
@ -360,19 +362,43 @@ public class GameDetailKaiFuAdapter extends BaseRecyclerAdapter<ViewHolder> {
int padd = DisplayUtils.dip2px(mContext, 2);
viewHolder.calendarKaifu.setPadding(padd, DisplayUtils.dip2px(mContext, 1), padd, padd);
String allType = "";
String type = null;
for (KaiFuServerEntity kaiFuServerEntity : entity.getServer()) {
allType += kaiFuServerEntity.getType();
// 自定义排:删档内测 > 不删档内测 > 公测 > 新服
List<KaiFuServerEntity> server = entity.getServer();
for (int i = 0; i < server.size(); i++) {
KaiFuServerEntity serverEntity = server.get(i);
String type = serverEntity.getType();
switch (type) {
case "删档内测":
serverEntity.setOrder(2);
break;
case "不删档内测":
serverEntity.setOrder(1);
break;
case "公测":
serverEntity.setOrder(0);
break;
default:
serverEntity.setOrder(-1);
break;
}
}
if (allType.contains("公测")) {
type = "公测";
} else if (allType.contains("不删档内测")) {
type = "内测";
} else if (allType.contains("删档内测")) {
Collections.sort(server, new Comparator<KaiFuServerEntity>() {
@Override
public int compare(KaiFuServerEntity lhs, KaiFuServerEntity rhs) {
return rhs.getOrder() - lhs.getOrder();
}
});
String serverType = server.get(0).getType();
String type = null;
if ("删档内测".equals(serverType)) {
type = "删测";
} else if ("不删档内测".equals(serverType)) {
type = "内测";
} else if ("公测".equals(serverType)) {
type = "公测";
}
if (day < curDay && !isNextMonth) {

View File

@ -112,12 +112,11 @@ class OkHttpRetryInterceptor internal constructor(context: Context) : Intercepto
val content = JSONObject(string)
val code = content.getInt("code")
LoginUtils.cleanUserData(mContext)
Utils.toast(mContext, mContext.getString(R.string.login_refresh_error))
EventBus.getDefault().post(EBReuse(PersonalFragment.LOGOUT_TAG))
tryCount = 4 // 只要token刷新异常直接主动退出登录
if (code == 40802) { // 其他设备登录了该账号
EventBus.getDefault().post(EBShowDialog("loginException", string)) // 打开提示框
} else{
Utils.toast(mContext, mContext.getString(R.string.login_refresh_error))
}
} catch (e1: Exception) {
e1.printStackTrace()
@ -128,7 +127,7 @@ class OkHttpRetryInterceptor internal constructor(context: Context) : Intercepto
} else {
// 重新登录
LoginUtils.cleanUserData(mContext)
Utils.toast(mContext, "账号过,请重新登录!")
Utils.toast(mContext, "账号过,请重新登录!")
}
} else { // 网络错误处理
response = doRequest(chain, request)