|
|
@@ -19,7 +19,6 @@ import android.util.Log;
|
|
|
import java.io.IOException;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Collections;
|
|
|
-import java.util.Comparator;
|
|
|
import java.util.List;
|
|
|
import java.util.Locale;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
@@ -183,21 +182,7 @@ public class MainModel extends Model {
|
|
|
//정렬 추가
|
|
|
if (null != popupInfoListBean) {
|
|
|
promotionPopupBeans = popupInfoListBean.getPromotionPopupList();
|
|
|
-
|
|
|
- if (null != promotionPopupBeans) {
|
|
|
- Collections.sort(promotionPopupBeans, new Comparator<PromotionPopupBean>() {
|
|
|
- @Override
|
|
|
- public int compare(PromotionPopupBean promotionPopupBean, PromotionPopupBean t1) {
|
|
|
- if (Integer.parseInt(promotionPopupBean.getOrderSeqNo()) < Integer.parseInt(t1.getOrderSeqNo())) {
|
|
|
- return -1;
|
|
|
- }
|
|
|
- else if (Integer.parseInt(promotionPopupBean.getOrderSeqNo()) > Integer.parseInt(t1.getOrderSeqNo())) {
|
|
|
- return 1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ sortPopupList(promotionPopupBeans);
|
|
|
|
|
|
SystemPopupManager.getInstance().setSystemPopupBeans(popupInfoListBean.getSystemPopupList());
|
|
|
}
|
|
|
@@ -218,11 +203,26 @@ public class MainModel extends Model {
|
|
|
else {
|
|
|
SystemPopupManager.getInstance().setAvailableRefresh();
|
|
|
promotionPopupBeans = SystemPopupManager.getInstance().getPromotionPopupBeans();
|
|
|
+ sortPopupList(promotionPopupBeans);
|
|
|
onResult(new Event.Builder(Event.SUCCESS).integer(Event.LOADED_POPUP_INFO).build());
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private void sortPopupList(List<PromotionPopupBean> beans) {
|
|
|
+ if (null != beans) {
|
|
|
+ Collections.sort(beans, (promotionPopupBean, t1) -> {
|
|
|
+ if (Integer.parseInt(promotionPopupBean.getOrderSeqNo()) < Integer.parseInt(t1.getOrderSeqNo())) {
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ else if (Integer.parseInt(promotionPopupBean.getOrderSeqNo()) > Integer.parseInt(t1.getOrderSeqNo())) {
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private List<PromotionPopupBean> promotionPopupBeans;
|
|
|
|
|
|
public List<PromotionPopupBean> getPromotionPopupBeans() {
|