Bläddra i källkod

[이벤트][Bug] 선택형 추천 컨텐츠 타입 없는 경우 대비

hyodong.min 6 år sedan
förälder
incheckning
ca8ab043a7

+ 13 - 4
app/src/main/java/kr/co/zumo/app/lifeplus/activity/EventRecommendActivity.java

@@ -118,15 +118,24 @@ public class EventRecommendActivity extends ActivityBaseScreen implements IWaite
 
   private void launchScreenInternal(EventDetailBean eventDetailBean) {
     int id = ScreenID.NONE;
+
+    // fixme 질문 수를 기준으로 강제 타입 변경하면 기본형 질문에 없는 태그를 요구하기 때문에 tag list 결과값이 없다.
+//    if (eventDetailBean.isSimpleQuestion()) {
+    // 질문 수 1 -> 타입 구분
     String questionType = eventDetailBean.getEventQuestionList().get(0).getQuestionType();
-    if (EventQuestionBean.QUESTION_TYPE_RECOMMEND_BASIC.equals(questionType)) {
+    if (EventQuestionBean.QUESTION_TYPE_RECOMMEND_TAG.equals(questionType)) {
       // 기본형
-      id = ScreenID.EVENT_RECOMMEND_BASIC;
+      id = ScreenID.EVENT_RECOMMEND_TAG;
     }
-    else if (EventQuestionBean.QUESTION_TYPE_RECOMMEND_TAG.equals(questionType)) {
+    else if (EventQuestionBean.QUESTION_TYPE_RECOMMEND_BASIC.equals(questionType)) {
       // 태그형
-      id = ScreenID.EVENT_RECOMMEND_TAG;
+      id = ScreenID.EVENT_RECOMMEND_BASIC;
     }
+//    }
+//    else {
+//      // 질문 수 2 -> 태그형 고정
+//      id = ScreenID.EVENT_RECOMMEND_TAG;
+//    }
 
     if (id != ScreenID.NONE) {
       launchScreen(id);

+ 9 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/bean/api/EventDetailBean.java

@@ -155,4 +155,13 @@ public class EventDetailBean extends EventBean {
 
     return false;
   }
+
+  /**
+   * 단일 항목인지확인
+   *
+   * @return
+   */
+  public boolean isSimpleQuestion() {
+    return getEventQuestionList().size() < 2;
+  }
 }

+ 1 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/event/EventDetailModel.java

@@ -180,6 +180,6 @@ public abstract class EventDetailModel extends CoinModel {
    * @return
    */
   public boolean isSimpleQuestion() {
-    return getEventDetailBean().getEventQuestionList().size() == 1;
+    return getEventDetailBean().isSimpleQuestion();
   }
 }