修改排序
This commit is contained in:
@@ -89,17 +89,35 @@ public class AprilFoolsDayRoomService {
|
||||
rooms.add(aprilFoolsDayRoom);
|
||||
}
|
||||
rooms.sort((a, b) -> {
|
||||
if (a.getIsUnderway()) {
|
||||
return -1;
|
||||
} else if (b.getIsUnderway()) {
|
||||
return 1;
|
||||
if (a.getIsUnderway() && b.getIsUnderway()) {
|
||||
if (a.getIsLive() && b.getIsLive()) {
|
||||
return b.getActivityValue().compareTo(a.getActivityValue());
|
||||
} else {
|
||||
if (a.getIsLive()) {
|
||||
return -1;
|
||||
} else if (b.getIsLive()) {
|
||||
return 1;
|
||||
} else {
|
||||
return b.getActivityValue().compareTo(a.getActivityValue());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (a.getIsLive()) {
|
||||
if (a.getIsUnderway()) {
|
||||
return -1;
|
||||
} else if (b.getIsLive()) {
|
||||
} else if (b.getIsUnderway()) {
|
||||
return 1;
|
||||
} else {
|
||||
return b.getActivityValue().compareTo(a.getActivityValue());
|
||||
if (a.getIsLive() && b.getIsLive()) {
|
||||
return b.getActivityValue().compareTo(a.getActivityValue());
|
||||
} else {
|
||||
if (a.getIsLive()) {
|
||||
return -1;
|
||||
} else if (b.getIsLive()) {
|
||||
return 1;
|
||||
} else {
|
||||
return b.getActivityValue().compareTo(a.getActivityValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user