Browse Source

Merge branch 'develop' of https://github.com/swict/LifeplusAndroid into develop

hyodong.min 7 years ago
parent
commit
ce0ed5a2ea

+ 0 - 32
app/src/main/java/kr/co/zumo/app/lifeplus/view/custom/EventMultipleChoice.java

@@ -1,32 +0,0 @@
-/*
- * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
- */
-package kr.co.zumo.app.lifeplus.view.custom;
-
-import android.content.Context;
-import android.support.constraint.ConstraintLayout;
-import android.util.AttributeSet;
-
-/**
- * EventMultipleChoice
- * <pre>
- * </pre>
- *
- * @author 하세미
- * @version 1.0
- * @history 하세미   [2019-01-16]   [최초 작성]
- * @since 2019-01-16
- */
-public class EventMultipleChoice extends ConstraintLayout {
-  public EventMultipleChoice(Context context) {
-    super(context);
-  }
-
-  public EventMultipleChoice(Context context, AttributeSet attrs) {
-    super(context, attrs);
-  }
-
-  public void init(Context context){
-
-  }
-}

+ 56 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/custom/EventParticipationCheckbox.java

@@ -0,0 +1,56 @@
+/*
+ * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
+ */
+package kr.co.zumo.app.lifeplus.view.custom;
+
+import android.content.Context;
+import android.support.constraint.ConstraintLayout;
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.CheckBox;
+
+import kr.co.zumo.app.R;
+
+/**
+ * EventMultipleChoice
+ * <pre>
+ * </pre>
+ *
+ * @author 하세미
+ * @version 1.0
+ * @history 하세미   [2019-01-16]   [최초 작성]
+ * @since 2019-01-16
+ */
+public class EventParticipationCheckbox extends ConstraintLayout {
+
+  private LayoutInflater inflater;
+  private CheckBox checkBox;
+
+
+  public EventParticipationCheckbox(Context context) {
+    super(context);
+    init(context);
+  }
+
+  public EventParticipationCheckbox(Context context, AttributeSet attrs) {
+    super(context, attrs);
+    init(context);
+  }
+
+  private void init(Context context) {
+    if (null != context) {
+      inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+      View view = inflater.inflate(R.layout.event_participation_checkbox, this);
+      checkBox = view.findViewById(R.id.check_box);
+    }
+  }
+
+  public void setText(String text) {
+    checkBox.setText(text);
+  }
+
+  public boolean isChecked() {
+    return checkBox.isChecked();
+  }
+}

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

@@ -84,7 +84,7 @@ public class EventParticipationAdapter extends RecyclerView.Adapter<EventPartici
 
   @Override
   public void onBindViewHolder(@NonNull EventParticipationView holder, int position) {
-
+    holder.init(listener);
   }
 
   @Override

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

@@ -3,7 +3,14 @@
  */
 package kr.co.zumo.app.lifeplus.view.screen.event;
 
+import android.util.Log;
 import android.view.View;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import kr.co.zumo.app.R;
+import kr.co.zumo.app.lifeplus.view.IEventListener;
+import kr.co.zumo.app.lifeplus.view.custom.EventParticipationCheckbox;
 
 /**
  * EventParticipationMultipleChoiceViewHolder
@@ -16,5 +23,23 @@ import android.view.View;
  * @since 2019-01-16
  */
 class EventParticipationMultipleChoiceViewHolder extends EventParticipationView {
-  public EventParticipationMultipleChoiceViewHolder(View view) {super(view);}
+
+  private TextView textViewTitle;
+  private LinearLayout layoutChoiceView;
+
+  public EventParticipationMultipleChoiceViewHolder(View view) {
+    super(view);
+    textViewTitle = view.findViewById(R.id.text_view_title);
+    layoutChoiceView = view.findViewById(R.id.choice_view);
+  }
+
+  @Override
+  public void init(IEventListener listener) {
+    Log.e("APP#  EventParticipationMultipleChoiceViewHolder | init", "|");
+    textViewTitle.setText("Lifeplus 설치하게 된 경로를 선택해주세요.");
+
+    EventParticipationCheckbox checkbox = new EventParticipationCheckbox(itemView.getContext());
+    checkbox.setText("테스트");
+    layoutChoiceView.addView(checkbox);
+  }
 }

+ 30 - 0
app/src/main/res/layout/event_participation_checkbox.xml

@@ -0,0 +1,30 @@
+<?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="wrap_content">
+  <CheckBox
+    android:id="@+id/check_box"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="@drawable/custom_rectangle_radio_selector"
+    android:button="@null"
+    android:drawableLeft="@drawable/custom_check_box"
+    android:drawablePadding="8dp"
+    android:lineSpacingExtra="4sp"
+    android:paddingStart="23dp"
+    android:paddingTop="17dp"
+    android:paddingEnd="23dp"
+    android:paddingBottom="17dp"
+    android:saveEnabled="false"
+    android:textColor="@drawable/my_faq_radio_text_selector"
+    android:textSize="12sp"
+    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toTopOf="parent"
+    tools:text="옥외광고를 보고 설치함"
+    />
+</android.support.constraint.ConstraintLayout>

+ 8 - 29
app/src/main/res/layout/event_participation_item_multiple_choice.xml

@@ -24,40 +24,19 @@
     tools:text="Lifeplus 설치하게 된 경로를 선택해주세요."
     />
 
-  <android.support.constraint.ConstraintLayout
+  <LinearLayout
     android:id="@+id/choice_view"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:layout_marginStart="25dp"
     android:layout_marginTop="15dp"
     android:layout_marginEnd="25dp"
-    android:background="@drawable/custom_rectangle_radio_selector"
-    app:layout_constraintTop_toBottomOf="@+id/text_view_title">
-
-    <CheckBox
-      android:id="@+id/check_box"
-      android:layout_width="match_parent"
-      android:layout_height="wrap_content"
-      android:background="@null"
-      android:button="@null"
-      android:drawableLeft="@drawable/custom_check_box"
-      android:drawablePadding="8dp"
-      android:lineSpacingExtra="4sp"
-      android:paddingStart="23dp"
-      android:paddingTop="17dp"
-      android:paddingEnd="23dp"
-      android:paddingBottom="17dp"
-      android:saveEnabled="false"
-      android:textColor="@drawable/my_faq_radio_text_selector"
-      android:textSize="12sp"
-      app:layout_constraintBottom_toBottomOf="parent"
-      app:layout_constraintEnd_toEndOf="parent"
-      app:layout_constraintStart_toStartOf="parent"
-      app:layout_constraintTop_toTopOf="parent"
-      tools:text="옥외광고를 보고 설치함"
-      />
-
-  </android.support.constraint.ConstraintLayout>
-
+    android:orientation="vertical"
+    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintTop_toTopOf="parent"
+    tools:background="@color/C666666">
+  </LinearLayout>
 
 </android.support.constraint.ConstraintLayout>