Ver código fonte

[이벤트][Common] 이벤트 항목선택형 글자형 구현 중

Hasemi 7 anos atrás
pai
commit
18343981e0

+ 14 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/custom/event/EventCombinedSelectView.java

@@ -0,0 +1,14 @@
+package kr.co.zumo.app.lifeplus.view.custom.event;
+
+/**
+ * EventCheckVIEW
+ * <pre>
+ * </pre>
+ *
+ * @author 하세미
+ * @version 1.0
+ * @history 하세미   [2019-01-10]   [최초 작성]
+ * @since 2019-01-10
+ */
+public class EventCombinedSelectView {
+}

+ 8 - 8
app/src/main/java/kr/co/zumo/app/lifeplus/view/custom/event/EventSelectView.java

@@ -25,21 +25,21 @@ import kr.co.zumo.app.lifeplus.view.IEventListener;
  * @history 하세미   [2019-01-08]   [최초 작성]
  * @since 2019-01-08
  */
-public class EventSelectView extends ConstraintLayout {
+public class EventEnterTypeSelectView extends ConstraintLayout {
 
   private RecyclerView recyclerView;
-  private EventSelectViewAdapter eventSelectViewAdapter;
+  private EventEnterTypeSelectViewAdapter eventEnterTypeSelectViewAdapter;
 
 
-  public EventSelectView(Context context) {
+  public EventEnterTypeSelectView(Context context) {
     super(context);
   }
 
-  public EventSelectView(Context context, AttributeSet attrs) {
+  public EventEnterTypeSelectView(Context context, AttributeSet attrs) {
     super(context, attrs);
   }
 
-  public EventSelectView(Context context, AttributeSet attrs, int defStyleAttr) {
+  public EventEnterTypeSelectView(Context context, AttributeSet attrs, int defStyleAttr) {
     super(context, attrs, defStyleAttr);
   }
 
@@ -52,14 +52,14 @@ public class EventSelectView extends ConstraintLayout {
     recyclerView.setNestedScrollingEnabled(false);
     recyclerView.setLayoutManager(new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false));
 
-    eventSelectViewAdapter = new EventSelectViewAdapter(context, new IEventListener() {
+    eventEnterTypeSelectViewAdapter = new EventEnterTypeSelectViewAdapter(context, new IEventListener() {
       @Override
       public void onEvent(Event event) {
 
       }
     });
 
-    recyclerView.setAdapter(eventSelectViewAdapter);
+    recyclerView.setAdapter(eventEnterTypeSelectViewAdapter);
     recyclerView.addOnItemTouchListener(touchEventListener);
 
     recyclerView.addItemDecoration(new RecyclerView.ItemDecoration() {
@@ -99,6 +99,6 @@ public class EventSelectView extends ConstraintLayout {
     recyclerView.setLayoutManager(null);
     recyclerView.setAdapter(null);
     recyclerView = null;
-    eventSelectViewAdapter = null;
+    eventEnterTypeSelectViewAdapter = null;
   }
 }

+ 5 - 5
app/src/main/java/kr/co/zumo/app/lifeplus/view/custom/event/EventSelectViewAdapter.java

@@ -20,13 +20,13 @@ import kr.co.zumo.app.lifeplus.view.IEventListener;
  * @history 하세미   [2019-01-08]   [최초 작성]
  * @since 2019-01-08
  */
-public class EventSelectViewAdapter extends RecyclerView.Adapter<EventSelectViewHolder> {
+public class EventEnterTypeSelectViewAdapter extends RecyclerView.Adapter<EventEnterTypeSelectViewHolder> {
 
   private IEventListener listener;
   private Context context;
   private LayoutInflater inflater;
 
-  public EventSelectViewAdapter(Context context, IEventListener listener) {
+  public EventEnterTypeSelectViewAdapter(Context context, IEventListener listener) {
     this.listener = listener;
     this.context = context;
     this.inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
@@ -34,13 +34,13 @@ public class EventSelectViewAdapter extends RecyclerView.Adapter<EventSelectView
 
   @NonNull
   @Override
-  public EventSelectViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+  public EventEnterTypeSelectViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
     View view = inflater.inflate(R.layout.event_select_view_item, parent, false);
-    return new EventSelectViewHolder(view);
+    return new EventEnterTypeSelectViewHolder(view);
   }
 
   @Override
-  public void onBindViewHolder(@NonNull EventSelectViewHolder holder, int position) {
+  public void onBindViewHolder(@NonNull EventEnterTypeSelectViewHolder holder, int position) {
     holder.bind(listener);
 
   }

+ 2 - 2
app/src/main/java/kr/co/zumo/app/lifeplus/view/custom/event/EventSelectViewHolder.java

@@ -20,7 +20,7 @@ import kr.co.zumo.app.lifeplus.view.IEventListener;
  * @history 하세미   [2019-01-08]   [최초 작성]
  * @since 2019-01-08
  */
-public class EventSelectViewHolder extends RecyclerView.ViewHolder {
+public class EventEnterTypeSelectViewHolder extends RecyclerView.ViewHolder {
 
   private View dim;
   private ImageView imageViewCheck;
@@ -28,7 +28,7 @@ public class EventSelectViewHolder extends RecyclerView.ViewHolder {
   private ImageView imageView;
   private TextView textViewDetail;
 
-  public EventSelectViewHolder(View itemView) {
+  public EventEnterTypeSelectViewHolder(View itemView) {
     super(itemView);
     dim = itemView.findViewById(R.id.dim);
     imageViewCheck = itemView.findViewById(R.id.image_view_check);

+ 31 - 18
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/event/EventDetailAdapter.java

@@ -22,14 +22,15 @@ import kr.co.zumo.app.lifeplus.view.IEventListener;
  */
 public class EventDetailAdapter extends RecyclerView.Adapter<EventDetailView> {
 
-  private static final int TYPE_EVENT_COVER = 0; //커버
+  private static final int TYPE_EVENT_COVER = 0; //커버는 모든 이벤트 유형 공통사용
 
   private static final int TYPE_EVENT_ENTER_CONTENTS = 1; //응모형 내용
   private static final int TYPE_EVENT_ENTER_LAST = 2; //응모형 내용
 
-  private static final int TYPE_EVENT_SELECT = 3; //항목 선택형 투표화면
-  private static final int TYPE_EVENT_SELECT_RESULT = 4; //항목선택형 투표 결과
-  private static final int TYPE_EVENT_SELECT_RECOMMEND = 5; //투표결과에서 함께 보면 좋은 콘텐츠 화면 진입
+  private static final int TYPE_EVENT_SELECT_COMBINED = 3; //항목 선택형 복합형
+  private static final int TYPE_EVENT_SELECT_TEXT = 4; //항목선택형 글자형
+  private static final int TYPE_EVENT_SELECT_RESULT = 5; //항목선택형 결과
+  private static final int TYPE_EVENT_RECOMMEND = 6; //추천컨텐츠
 
   private Context context;
   private IEventListener listener;
@@ -58,13 +59,16 @@ public class EventDetailAdapter extends RecyclerView.Adapter<EventDetailView> {
       case TYPE_EVENT_ENTER_LAST:
         view = inflater.inflate(R.layout.event_enter_type_last, parent, false);
         return new EventEnterLastHolder(view);
-      case TYPE_EVENT_SELECT:
-        view = inflater.inflate(R.layout.event_select_type, parent, false);
-        return new EventSelectHolder(view);
+      case TYPE_EVENT_SELECT_COMBINED:
+        view = inflater.inflate(R.layout.event_select_type_combined, parent, false);
+        return new EventSelectCombinedHolder(view);
+      case TYPE_EVENT_SELECT_TEXT:
+        view = inflater.inflate(R.layout.event_select_type_text, parent, false);
+        return new EventSelectTextHolder(view);
       case TYPE_EVENT_SELECT_RESULT:
         view = inflater.inflate(R.layout.event_select_type_result, parent, false);
         return new EventSelectResultHolder(view);
-      case TYPE_EVENT_SELECT_RECOMMEND:
+      case TYPE_EVENT_RECOMMEND:
         view = inflater.inflate(R.layout.event_select_type_recommend, parent, false);
         return new EventSelectRecommendHolder(view);
       default:
@@ -86,10 +90,10 @@ public class EventDetailAdapter extends RecyclerView.Adapter<EventDetailView> {
   @Override
   public int getItemViewType(int position) {
     //커버는 모두 동일
-    if(position == 0){
+    if (position == 0) {
       return TYPE_EVENT_COVER;
     }
-    
+
     if (type == 0) { //첫번째 인덱스는 응모형 임시구현
       switch (position) {
         case 4:
@@ -97,17 +101,26 @@ public class EventDetailAdapter extends RecyclerView.Adapter<EventDetailView> {
         default:
           return TYPE_EVENT_ENTER_CONTENTS;
       }
-    }else if(type == 1) { //두번째 인덱스는 항목선택 복합형 임시구현
+    }
+    else if (type == 1) { //두번째 인덱스는 항목선택 복합형 임시구현
       switch (position) {
-        case 1:
-          return TYPE_EVENT_SELECT;
-        case 2:
+        case 3:
           return TYPE_EVENT_SELECT_RESULT;
-          default:
-            return TYPE_EVENT_SELECT_RECOMMEND;
+        case 4:
+          return TYPE_EVENT_RECOMMEND;
+        default:
+          return TYPE_EVENT_SELECT_COMBINED;
+      }
+    }
+    else { //항목선택 글자형
+      switch (position) {
+        case 3:
+          return TYPE_EVENT_SELECT_RESULT;
+        case 4:
+          return TYPE_EVENT_RECOMMEND;
+        default:
+          return TYPE_EVENT_SELECT_TEXT;
       }
     }
-
-    return 0;
   }
 }

+ 6 - 6
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/event/EventSelectHolder.java

@@ -9,7 +9,7 @@ import kr.co.zumo.app.R;
 import kr.co.zumo.app.lifeplus.util.ResourceUtil;
 import kr.co.zumo.app.lifeplus.view.Event;
 import kr.co.zumo.app.lifeplus.view.IEventListener;
-import kr.co.zumo.app.lifeplus.view.custom.event.EventSelectView;
+import kr.co.zumo.app.lifeplus.view.custom.event.EventEnterTypeSelectView;
 
 /**
  * EventSelectHolder
@@ -21,21 +21,21 @@ import kr.co.zumo.app.lifeplus.view.custom.event.EventSelectView;
  * @history 하세미   [2019-01-07]   [최초 작성]
  * @since 2019-01-07
  */
-public class EventSelectHolder extends EventDetailView {
+public class EventSelectCombinedHolder extends EventDetailView {
 
   private TextView textViewQuestionTitle;
   private TextView textViewQuestionSubTitle;
-  private EventSelectView eventSelectView;
+  private EventEnterTypeSelectView eventEnterTypeSelectView;
   private ImageView imageViewIconConfirm;
   private TextView textViewConfirm;
   private Button buttonVote;
 
-  public EventSelectHolder(View itemView) {
+  public EventSelectCombinedHolder(View itemView) {
     super(itemView);
 
     textViewQuestionTitle = itemView.findViewById(R.id.text_view_question_title);
     textViewQuestionSubTitle = itemView.findViewById(R.id.text_view_question_sub_title);
-    eventSelectView = itemView.findViewById(R.id.event_select_area);
+    eventEnterTypeSelectView = itemView.findViewById(R.id.event_select_area);
     imageViewIconConfirm = itemView.findViewById(R.id.icon_info);
     textViewConfirm = itemView.findViewById(R.id.text_view_confirm);
     buttonVote = itemView.findViewById(R.id.button_vote);
@@ -48,7 +48,7 @@ public class EventSelectHolder extends EventDetailView {
     textViewQuestionTitle.setText("어느 핫플레이스가\n마음에 드는지 골라주세요");
     textViewQuestionSubTitle.setText("투표 참여는 1인 1회만 가능하며\n당첨 확인은 MY>이벤트에서 확인 가능합니다.");
 
-    eventSelectView.init(itemView.getContext(), listener);
+    eventEnterTypeSelectView.init(itemView.getContext(), listener);
 
     //유의사항 팝업 노출
     imageViewIconConfirm.setOnClickListener(view -> {listener.onEvent(new Event.Builder(Event.DETAIL).build());});

+ 23 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/event/EventSelectTextHolder.java

@@ -0,0 +1,23 @@
+package kr.co.zumo.app.lifeplus.view.screen.event;
+
+import android.view.View;
+
+import kr.co.zumo.app.lifeplus.util.ResourceUtil;
+
+/**
+ * EventSelectTextHolder
+ * <pre>
+ * </pre>
+ *
+ * @author 하세미
+ * @version 1.0
+ * @history 하세미   [2019-01-10]   [최초 작성]
+ * @since 2019-01-10
+ */
+public class EventSelectTextHolder extends EventDetailView {
+
+  public EventSelectTextHolder(View view) {
+    super(view);
+    itemView.setPadding(0, ResourceUtil.getStatusBarHeightManual(), 0, 0);
+  }
+}

+ 2 - 2
app/src/main/res/drawable/custom_rectangle_radio_selector.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
-  <item android:drawable="@drawable/custom_rectangle_radio_off" android:state_checked="false" />
-  <item android:drawable="@drawable/custom_rectangle_radio_on" android:state_checked="true"/>
+<item android:drawable="@drawable/custom_rectangle_radio_off" android:state_checked="false" />
+<item android:drawable="@drawable/custom_rectangle_radio_on" android:state_checked="true"/>
 </selector>

+ 9 - 0
app/src/main/res/drawable/event_select_custom_radio_off.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+  <item>
+    <shape android:shape="rectangle">
+      <corners android:radius="27dp"/>
+      <stroke android:color="@color/CFFFFFF" android:width="1dp" />
+    </shape>
+  </item>
+</selector>

+ 10 - 0
app/src/main/res/drawable/event_select_custom_radio_on.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+  <item>
+    <shape android:shape="rectangle">
+      <corners android:radius="27dp"/>
+      <solid android:color="@color/CFFFFFF"/>
+      <stroke android:color="@color/CFFFFFF" android:width="1dp" />
+    </shape>
+  </item>
+</selector>

+ 5 - 0
app/src/main/res/drawable/event_select_custom_radio_selector.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+  <item android:drawable="@drawable/event_select_custom_radio_off" android:state_checked="false" />
+  <item android:drawable="@drawable/event_select_custom_radio_on" android:state_checked="true"/>
+</selector>

+ 6 - 0
app/src/main/res/drawable/event_select_custom_text_selector.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+  <item android:state_pressed="true" android:color="@color/C000000"/>
+  <item android:state_checked="true" android:color="@color/C000000"/>
+  <item android:color="@color/CFFFFFF"/>
+</selector>

+ 27 - 0
app/src/main/res/layout/event_select_custom_radio.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout
+  xmlns:android="http://schemas.android.com/apk/res/android"
+  xmlns:tools="http://schemas.android.com/tools"
+  android:layout_width="wrap_content"
+  android:layout_height="wrap_content"
+  tools:background="@color/C999999">
+
+  <CheckBox
+    android:id="@+id/check_box"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_marginEnd="9dp"
+    android:background="@drawable/event_select_custom_radio_selector"
+    android:button="@null"
+    tools:checked="false"
+    android:lineSpacingExtra="4sp"
+    android:paddingStart="22dp"
+    android:paddingTop="12dp"
+    android:paddingEnd="22dp"
+    android:paddingBottom="12dp"
+    android:textAlignment="center"
+    android:textColor="@drawable/event_select_custom_text_selector"
+    android:textSize="12sp"
+    tools:text="#따뜻한 분위기"
+    />
+</FrameLayout>

+ 1 - 1
app/src/main/res/layout/event_select_type.xml

@@ -38,7 +38,7 @@
     tools:text="투표 참여는 1인 1회만 가능하며
 당첨 확인은 MY&gt;이벤트에서 확인 가능합니다."/>
 
-  <kr.co.zumo.app.lifeplus.view.custom.event.EventSelectView
+  <kr.co.zumo.app.lifeplus.view.custom.event.EventEnterTypeSelectView
     android:id="@+id/event_select_area"
     android:layout_width="match_parent"
     android:layout_height="225dp"

+ 139 - 0
app/src/main/res/layout/event_select_type_text.xml

@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout
+  xmlns:android="http://schemas.android.com/apk/res/android"
+  xmlns:app="http://schemas.android.com/apk/res-auto"
+  xmlns:tools="http://schemas.android.com/tools"
+  android:layout_width="match_parent"
+  android:layout_height="match_parent">
+
+
+  <View
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:layout_marginStart="33dp"
+    android:layout_marginTop="101dp"
+    android:layout_marginEnd="33dp"
+    android:layout_marginBottom="91dp"
+    android:background="@color/CE5E5E5"
+    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toTopOf="parent"/>
+
+  <View
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:layout_marginStart="29dp"
+    android:layout_marginTop="101dp"
+    android:layout_marginEnd="29dp"
+    android:layout_marginBottom="95dp"
+    android:background="@color/CC5C5C5"
+    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toTopOf="parent"/>
+
+  <ImageView
+    android:id="@+id/image_view_background"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:layout_marginStart="25dp"
+    android:layout_marginTop="101dp"
+    android:layout_marginEnd="25dp"
+    android:layout_marginBottom="100dp"
+    android:scaleType="centerCrop"
+    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toTopOf="parent"
+    android:src="@drawable/img_bookmark_default"
+    />
+
+  <View
+    android:id="@+id/dim"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:layout_marginStart="25dp"
+    android:layout_marginTop="101dp"
+    android:layout_marginEnd="25dp"
+    android:layout_marginBottom="100dp"
+    android:background="@color/C66000000"
+    app:layout_constraintBottom_toBottomOf="@+id/image_view_background"
+    app:layout_constraintEnd_toEndOf="@+id/image_view_background"
+    app:layout_constraintStart_toStartOf="@+id/image_view_background"
+    app:layout_constraintTop_toTopOf="@+id/image_view_background"/>
+
+  <TextView
+    android:id="@+id/text_view_q"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_marginTop="40dp"
+    android:gravity="center_horizontal"
+    android:lineSpacingExtra="10sp"
+    android:shadowColor="#80000000"
+    android:shadowDy="1"
+    android:shadowRadius="3"
+    android:textColor="@color/CFFFFFF"
+    android:textSize="25sp"
+    app:layout_constraintEnd_toEndOf="@+id/image_view_background"
+    app:layout_constraintStart_toStartOf="@+id/image_view_background"
+    app:layout_constraintTop_toTopOf="@+id/image_view_background"
+    tools:text="Q."/>
+
+  <TextView
+    android:id="@+id/text_view_question"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_marginTop="5dp"
+    android:gravity="center_horizontal"
+    android:lineSpacingExtra="10sp"
+    android:shadowColor="#80000000"
+    android:shadowDy="1"
+    android:shadowRadius="3"
+    android:textColor="@color/CFFFFFF"
+    android:textSize="25sp"
+    app:layout_constraintEnd_toEndOf="@+id/image_view_background"
+    app:layout_constraintStart_toStartOf="@+id/image_view_background"
+    app:layout_constraintTop_toBottomOf="@+id/text_view_q"
+    tools:text="평소에 좋아하는
+분위기는 무엇입니까?"/>
+
+  <TextView
+    android:id="@+id/text_view_sub_question"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_marginTop="9dp"
+    android:gravity="center_horizontal"
+    android:lineSpacingExtra="3sp"
+    android:textColor="@color/CFFFFFF"
+    android:textSize="12sp"
+    app:layout_constraintEnd_toEndOf="@+id/image_view_background"
+    app:layout_constraintStart_toStartOf="@+id/image_view_background"
+    app:layout_constraintTop_toBottomOf="@+id/text_view_question"
+    tools:text="나를 잘 표현할 수 있는 태그를 선택해주세요."/>
+
+  <ImageView
+    android:id="@+id/icon_info"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_marginStart="19dp"
+    android:layout_marginTop="28dp"
+    android:padding="7dp"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toBottomOf="@+id/image_view_background"
+    app:srcCompat="@drawable/icon_info_alert"/>
+
+  <TextView
+    android:id="@+id/text_view_confirm"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:lineSpacingExtra="3.5sp"
+    android:paddingTop="7dp"
+    android:paddingBottom="7dp"
+    android:text="@string/go_confirm"
+    android:textColor="@color/C999999"
+    android:textSize="12sp"
+    app:layout_constraintStart_toEndOf="@+id/icon_info"
+    app:layout_constraintTop_toTopOf="@+id/icon_info"
+    />
+</android.support.constraint.ConstraintLayout>