|
|
@@ -11,9 +11,9 @@ import android.os.Bundle;
|
|
|
import android.provider.Settings;
|
|
|
import android.support.annotation.NonNull;
|
|
|
import android.support.annotation.Nullable;
|
|
|
+import android.support.constraint.ConstraintLayout;
|
|
|
import android.support.v4.app.ActivityCompat;
|
|
|
import android.support.v4.content.ContextCompat;
|
|
|
-import android.util.Log;
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
@@ -49,7 +49,7 @@ public class EventQuestionFragment extends FragmentBase<EventQuestionPresenter>
|
|
|
private Bitmap uploadImage;
|
|
|
private LinearLayout layoutContainer;
|
|
|
private LayoutInflater inflater;
|
|
|
- // private EventParticipationAdapter adapter;
|
|
|
+ private EventQuestionImageView eventQuestionImageView;
|
|
|
private static final int PERMISSION_CHECK = 0;
|
|
|
|
|
|
@Override
|
|
|
@@ -137,12 +137,8 @@ public class EventQuestionFragment extends FragmentBase<EventQuestionPresenter>
|
|
|
|
|
|
|
|
|
for (int i = 0; i < detailBean.getEventQuestionList().size(); ++i) {
|
|
|
- Log.e("APP# EventQuestionFragment | drawList", "|" + detailBean.getEventQuestionList().size());
|
|
|
View questionItemView = null;
|
|
|
EventQuestionBean eventQuestionBean = detailBean.getEventQuestionList().get(i);
|
|
|
- Log.e("APP# EventQuestionFragment | drawList", "|" + eventQuestionBean.getQuestionName());
|
|
|
- Log.e("APP# EventQuestionFragment | drawList", "|" + eventQuestionBean.getQuestionType());
|
|
|
-
|
|
|
if (eventQuestionBean.getQuestionType().equals(EventQuestionBean.QUESTION_TYPE_SINGLE)) {
|
|
|
questionItemView = inflater.inflate(R.layout.event_participation_item_single_choice, null);
|
|
|
EventQuestionSingleView eventQuestionSingleView = new EventQuestionSingleView(questionItemView, eventQuestionBean);
|
|
|
@@ -163,6 +159,7 @@ public class EventQuestionFragment extends FragmentBase<EventQuestionPresenter>
|
|
|
presenter.onEvent(event);
|
|
|
}
|
|
|
}, eventQuestionBean);
|
|
|
+ layoutContainer.addView(questionItemView);
|
|
|
|
|
|
}
|
|
|
else if (eventQuestionBean.getQuestionType().equals(EventQuestionBean.QUESTION_TYPE_ANSWER)) {
|
|
|
@@ -174,19 +171,47 @@ public class EventQuestionFragment extends FragmentBase<EventQuestionPresenter>
|
|
|
presenter.onEvent(event);
|
|
|
}
|
|
|
}, eventQuestionBean);
|
|
|
-
|
|
|
+ layoutContainer.addView(questionItemView);
|
|
|
}
|
|
|
- else {
|
|
|
+ else if (eventQuestionBean.getQuestionType().equals(EventQuestionBean.QUESTION_TYPE_IMAGE)) {
|
|
|
questionItemView = inflater.inflate(R.layout.event_participation_item_image, null);
|
|
|
- EventQuestionImageView eventQuestionImageView = new EventQuestionImageView(questionItemView, eventQuestionBean);
|
|
|
+ eventQuestionImageView = new EventQuestionImageView(questionItemView, eventQuestionBean);
|
|
|
eventQuestionImageView.draw(new IEventListener() {
|
|
|
@Override
|
|
|
public void onEvent(Event event) {
|
|
|
presenter.onEvent(event);
|
|
|
}
|
|
|
}, eventQuestionBean);
|
|
|
+ layoutContainer.addView(questionItemView);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //동의 영역
|
|
|
+ View agreeView = inflater.inflate(R.layout.event_participation_item_agree, null);
|
|
|
+ EventQuestionAgreeView eventQuestionAgreeView = new EventQuestionAgreeView(agreeView, detailBean.getEventPolicyList());
|
|
|
+ eventQuestionAgreeView.draw(new IEventListener() {
|
|
|
+ @Override
|
|
|
+ public void onEvent(Event event) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ layoutContainer.addView(agreeView);
|
|
|
+
|
|
|
+ //버튼
|
|
|
+ View buttonView = inflater.inflate(R.layout.event_participation_item_button, null);
|
|
|
+ ((ConstraintLayout) buttonView.findViewById(R.id.layout_button)).setOnClickListener(view -> {
|
|
|
+ //참여하기 버튼 클릭함
|
|
|
+ presenter.onEvent(new Event.Builder(Event.CLICK).build());
|
|
|
+ });
|
|
|
+ layoutContainer.addView(buttonView);
|
|
|
+
|
|
|
+
|
|
|
+ //공지사항 영역
|
|
|
+ View noticeView = inflater.inflate(R.layout.event_participation_item_notice, null);
|
|
|
+ EventQuestionNoticeView eventQuestionNoticeView = new EventQuestionNoticeView(noticeView);
|
|
|
+ eventQuestionNoticeView.draw(detailBean);
|
|
|
+ layoutContainer.addView(noticeView);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -212,10 +237,7 @@ public class EventQuestionFragment extends FragmentBase<EventQuestionPresenter>
|
|
|
@Override
|
|
|
public void uploadAlbumImage() {
|
|
|
if (null != uploadImage) {
|
|
|
- Log.e("APP# EventParticipationFragment | uploadAlbumImage", "|" + "===>");
|
|
|
-// EventParticipationView view =
|
|
|
-// (EventParticipationView) recyclerViewEventParticipation.findViewHolderForAdapterPosition(5);
|
|
|
-// view.setUploadImage(uploadImage);
|
|
|
+ eventQuestionImageView.setUploadImage(uploadImage);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -224,10 +246,10 @@ public class EventQuestionFragment extends FragmentBase<EventQuestionPresenter>
|
|
|
if (requestCode == GET_ALBUM_PHOTO) {
|
|
|
try {
|
|
|
Uri uri = data.getData();
|
|
|
- Log.e("APP# EventParticipationFragment | onActivityResult", "|" + uri);
|
|
|
+ //Uri 프리젠터로 보내기
|
|
|
+ //presenter.onEvent(new Event.Builder(Event.IMAGE ).string(uri.toString()).build());
|
|
|
|
|
|
InputStream inputStream = getContext().getContentResolver().openInputStream(data.getData());
|
|
|
- Log.e("APP# EventParticipationFragment | onActivityResult", "|" + data.toString());
|
|
|
uploadImage = BitmapFactory.decodeStream(inputStream);
|
|
|
inputStream.close();
|
|
|
presenter.onEvent(new Event.Builder(Event.IMAGE).build());
|