|
|
@@ -1,119 +0,0 @@
|
|
|
-package kr.co.zumo.app.lifeplus.view.screen.event;
|
|
|
-
|
|
|
-import android.content.Context;
|
|
|
-import android.support.annotation.NonNull;
|
|
|
-import android.support.v7.widget.RecyclerView;
|
|
|
-import android.view.LayoutInflater;
|
|
|
-import android.view.View;
|
|
|
-import android.view.ViewGroup;
|
|
|
-
|
|
|
-import kr.co.zumo.app.R;
|
|
|
-import kr.co.zumo.app.lifeplus.view.IEventListener;
|
|
|
-
|
|
|
-/**
|
|
|
- * EventParticipationAdapter
|
|
|
- * <pre>
|
|
|
- * </pre>
|
|
|
- *
|
|
|
- * @author 하세미
|
|
|
- * @version 1.0
|
|
|
- * @history 하세미 [2019-01-09] [최초 작성]
|
|
|
- * @since 2019-01-09
|
|
|
- */
|
|
|
-public class EventParticipationAdapter extends RecyclerView.Adapter<EventParticipationView> {
|
|
|
-
|
|
|
- private Context context;
|
|
|
- private IEventListener listener;
|
|
|
- private LayoutInflater inflater;
|
|
|
-
|
|
|
- private static final int LIST_COUNT = 9;
|
|
|
-
|
|
|
- private static final int TYPE_TITLE = 0;
|
|
|
- private static final int TYPE_EMAIL = 1;
|
|
|
- private static final int TYPE_NICKNAME = 2;
|
|
|
- private static final int TYPE_SCORE = 3;
|
|
|
- private static final int TYPE_MULTIPLE_CHOICE = 4;
|
|
|
- private static final int TYPE_IMAGE = 5;
|
|
|
- private static final int TYPE_AGREE = 6;
|
|
|
- private static final int TYPE_BUTTON = 7;
|
|
|
- private static final int TYPE_NOTICE = 8;
|
|
|
-
|
|
|
- public EventParticipationAdapter(Context context, IEventListener listener) {
|
|
|
- this.context = context;
|
|
|
- this.listener = listener;
|
|
|
- this.inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
|
- }
|
|
|
-
|
|
|
- @NonNull
|
|
|
- @Override
|
|
|
- public EventParticipationView onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
|
|
- View view;
|
|
|
- switch (viewType) {
|
|
|
- case TYPE_TITLE:
|
|
|
- view = inflater.inflate(R.layout.event_participation_item_title, parent, false);
|
|
|
- return new EventParticipationTitleViewHolder(view);
|
|
|
- case TYPE_EMAIL:
|
|
|
- view = inflater.inflate(R.layout.event_participation_item_answer, parent, false);
|
|
|
- return new EventParticipationEmailViewHolder(view);
|
|
|
- case TYPE_NICKNAME:
|
|
|
- view = inflater.inflate(R.layout.event_participation_item_single_choice, parent, false);
|
|
|
- return new EventParticipationSingleHolder(view);
|
|
|
-// case TYPE_SCORE:
|
|
|
-// view = inflater.inflate(R.layout.event_participation_item_score, parent, false);
|
|
|
-// return new EventParticipationScoreViewHolder(view);
|
|
|
- case TYPE_MULTIPLE_CHOICE:
|
|
|
- view = inflater.inflate(R.layout.event_participation_item_multiple_choice, parent, false);
|
|
|
- return new EventParticipationMultipleChoiceViewHolder(view);
|
|
|
- case TYPE_IMAGE:
|
|
|
- view = inflater.inflate(R.layout.event_participation_item_image, parent, false);
|
|
|
- return new EventParticipationImageViewHolder(view);
|
|
|
- case TYPE_AGREE:
|
|
|
- view = inflater.inflate(R.layout.event_participation_item_agree, parent, false);
|
|
|
- return new EventParticipationAgreeViewHolder(view);
|
|
|
- case TYPE_BUTTON:
|
|
|
- view = inflater.inflate(R.layout.event_participation_item_button, parent, false);
|
|
|
- return new EventParticipationButtonViewHolder(view);
|
|
|
- case TYPE_NOTICE:
|
|
|
- view = inflater.inflate(R.layout.event_participation_item_notice, parent, false);
|
|
|
- return new EventParticipationNoticeViewHolder(view);
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onBindViewHolder(@NonNull EventParticipationView holder, int position) {
|
|
|
- holder.init(listener);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public int getItemCount() {
|
|
|
- return LIST_COUNT;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public int getItemViewType(int position) {
|
|
|
- switch (position) {
|
|
|
- case 0:
|
|
|
- return TYPE_TITLE;
|
|
|
- case 1:
|
|
|
- return TYPE_EMAIL;
|
|
|
- case 2:
|
|
|
- return TYPE_NICKNAME;
|
|
|
- case 3:
|
|
|
- return TYPE_SCORE;
|
|
|
- case 4:
|
|
|
- return TYPE_MULTIPLE_CHOICE;
|
|
|
- case 5:
|
|
|
- return TYPE_IMAGE;
|
|
|
- case 6:
|
|
|
- return TYPE_AGREE;
|
|
|
- case 7:
|
|
|
- return TYPE_BUTTON;
|
|
|
- default:
|
|
|
- return TYPE_NOTICE;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-}
|