|
|
@@ -181,8 +181,7 @@ public class EventQuestionFragment extends FragmentBase<EventQuestionPresenter>
|
|
|
View questionItemView;
|
|
|
EventQuestionViewHolder eventQuestionViewHolder;
|
|
|
for (int i = 0; i < detailBean.getEventQuestionList().size(); ++i) {
|
|
|
- questionItemView = null;
|
|
|
- eventQuestionViewHolder = null;
|
|
|
+
|
|
|
EventQuestionBean eventQuestionBean = detailBean.getEventQuestionList().get(i);
|
|
|
if (EventQuestionBean.QUESTION_TYPE_SINGLE.equals(eventQuestionBean.getQuestionType())) {
|
|
|
questionItemView = inflater.inflate(R.layout.event_participation_item_single_choice, null);
|
|
|
@@ -194,27 +193,18 @@ public class EventQuestionFragment extends FragmentBase<EventQuestionPresenter>
|
|
|
eventQuestionViewHolder = new EventQuestionMultiViewHolder(questionItemView);
|
|
|
eventQuestionViewHolder.draw(i, event -> presenter.onEvent(event), eventQuestionBean);
|
|
|
}
|
|
|
- else if (EventQuestionBean.QUESTION_TYPE_ANSWER.equals(eventQuestionBean.getQuestionType())) {
|
|
|
- questionItemView = inflater.inflate(R.layout.event_participation_item_answer, null);
|
|
|
- eventQuestionViewHolder = new EventQuestionAnswerViewHolder(questionItemView);
|
|
|
- eventQuestionViewHolder.draw(i, event -> presenter.onEvent(event), eventQuestionBean);
|
|
|
- }
|
|
|
else if (EventQuestionBean.QUESTION_TYPE_IMAGE.equals(eventQuestionBean.getQuestionType())) {
|
|
|
questionItemView = inflater.inflate(R.layout.event_participation_item_image, null);
|
|
|
eventQuestionViewHolder = new EventQuestionImageViewHolder(questionItemView);
|
|
|
eventQuestionViewHolder.draw(i, event -> presenter.onEvent(event), eventQuestionBean);
|
|
|
}
|
|
|
-
|
|
|
- if (null == eventQuestionViewHolder) {
|
|
|
- // dummy : model 과 index 를 맞추기 위해서
|
|
|
- eventQuestionViewHolder = new EventQuestionViewHolder(null) {
|
|
|
- @Override
|
|
|
- public void validate(boolean isValidate) {}
|
|
|
-
|
|
|
- @Override
|
|
|
- public void clearFocus() {}
|
|
|
- };
|
|
|
+ else /*if (EventQuestionBean.QUESTION_TYPE_ANSWER.equals(eventQuestionBean.getQuestionType()))*/ {
|
|
|
+ // 타입이 맞지 않는 질문이 있는 경우 보기가 필요없는 단답형으로 처리 -> 에러 방지
|
|
|
+ questionItemView = inflater.inflate(R.layout.event_participation_item_answer, null);
|
|
|
+ eventQuestionViewHolder = new EventQuestionAnswerViewHolder(questionItemView);
|
|
|
+ eventQuestionViewHolder.draw(i, event -> presenter.onEvent(event), eventQuestionBean);
|
|
|
}
|
|
|
+
|
|
|
eventQuestionViewHolders.add(eventQuestionViewHolder);
|
|
|
|
|
|
if (null != questionItemView) {
|