Ver código fonte

[회원가입][NEW] 회원가입 구현 중 약관동의 구현

Hasemi 7 anos atrás
pai
commit
78401b5b50

+ 6 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/fragment/signup/SignUpAdapter.java

@@ -99,7 +99,7 @@ public class SignUpAdapter extends RecyclerView.Adapter<BaseViewHolder> {
         holder = new SignUpTermsHolder(view);
         break;
       case SignUpItem.SIGN_UP_TEXT_WITH_TITLE:
-        view = LayoutInflater.from(parent.getContext()).inflate(R.layout.sign_up_text_view, parent, false);
+        view = LayoutInflater.from(parent.getContext()).inflate(R.layout.sign_up_identify, parent, false);
         view = getAlignedView(parent, view, alignType);
         holder = new SignUpTextWithTitleHolder(view);
         break;
@@ -113,6 +113,11 @@ public class SignUpAdapter extends RecyclerView.Adapter<BaseViewHolder> {
         view = getAlignedView(parent, view, alignType);
         holder = new SignUpDividerHolder(view);
         break;
+      case SignUpItem.SIGN_UP_AGREE:
+        view = LayoutInflater.from(parent.getContext()).inflate(R.layout.sign_up_agree, parent, false);
+        view = getAlignedView(parent, view, alignType);
+        holder = new SignUpAgreeHolder(view);
+        break;
       default:
         break;
     }

+ 55 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/fragment/signup/SignUpAgreeHolder.java

@@ -0,0 +1,55 @@
+/*
+ * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
+ */
+package kr.co.zumo.app.lifeplus.view.fragment.signup;
+
+import android.view.View;
+import android.widget.CheckBox;
+
+import kr.co.zumo.app.R;
+import kr.co.zumo.app.databinding.SignUpAgreeBinding;
+import kr.co.zumo.app.lifeplus.model.SuperModel;
+import kr.co.zumo.app.lifeplus.view.model.SignUpViewModel;
+
+/**
+ * SignUpAgreeHolder
+ * <pre>
+ * </pre>
+ *
+ * @author 하세미
+ * @version 1.0
+ * @history 하세미   [2018-09-12]   [최초 작성]
+ * @since 2018-09-12
+ */
+public class SignUpAgreeHolder extends BaseViewHolder{
+  public SignUpAgreeHolder(View itemView) {
+    super(itemView);
+  }
+
+  @Override
+  void draw(int index) {
+
+    SignUpAgreeBinding  signUpAgreeBinding = SignUpAgreeBinding.bind(itemView);
+    SignUpViewModel model = (SignUpViewModel) SuperModel.getInstance().getViewModel();
+    signUpAgreeBinding.setModel(model);
+
+    CheckBox checkBox1 = (CheckBox)itemView.findViewById(R.id.agree_check1);
+    CheckBox checkBox2 = (CheckBox)itemView.findViewById(R.id.agree_check2);
+    CheckBox checkBox3 = (CheckBox)itemView.findViewById(R.id.agree_check3);
+    CheckBox checkBox4 = (CheckBox)itemView.findViewById(R.id.agree_check4);
+    CheckBox checkBox5 = (CheckBox)itemView.findViewById(R.id.agree_check5);
+    CheckBox checkBox6 = (CheckBox)itemView.findViewById(R.id.agree_check6);
+
+
+    checkBox1.setText(R.string.all_agree);
+    checkBox2.setText(R.string.service_agree1);
+    checkBox3.setText(R.string.service_agree2);
+    checkBox4.setText(R.string.service_agree3);
+    checkBox5.setText(R.string.service_agree4);
+    checkBox6.setText(R.string.service_agree5);
+    checkBox6.setText(R.string.service_agree6);
+
+
+
+  }
+}

+ 4 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/fragment/signup/SignUpFragment.java

@@ -27,6 +27,7 @@ import kr.co.zumo.app.lifeplus.view.model.SignUpViewModel;
 import kr.co.zumo.app.lifeplus.view.model.ViewModel;
 import kr.co.zumo.app.lifeplus.view.model.bean.SignUpBenefitBean;
 import kr.co.zumo.app.lifeplus.view.model.bean.SignUpBenefitListBean;
+import kr.co.zumo.app.lifeplus.view.model.bean.SignUpTextWithTitleBean;
 import kr.co.zumo.app.lifeplus.view.model.bean.TextBean;
 
 /**
@@ -92,8 +93,10 @@ public class SignUpFragment extends FragmentBase {
     ((SignUpViewModel) viewModel).addItem(new SignUpItem(SignUpItem.SIGN_UP_NOTICE, SignUpItem.ALIGN_START, new TextBean("SIGN_UP_NOTICE").toJson()));
     ((SignUpViewModel) viewModel).addItem(new SignUpItem(SignUpItem.SIGN_UP_TERMS, SignUpItem.ALIGN_CENTER, new TextBean("SIGN_UP_TERMS").toJson()));
     ((SignUpViewModel) viewModel).addItem(new SignUpItem(SignUpItem.SIGN_UP_DIVIDER));
-    ((SignUpViewModel) viewModel).addItem(new SignUpItem(SignUpItem.SIGN_UP_TEXT_WITH_TITLE, SignUpItem.ALIGN_CENTER, new TextBean("SIGN_UP_TEXT_WITH_TITLE").toJson()));
+    ((SignUpViewModel) viewModel).addItem(new SignUpItem(SignUpItem.SIGN_UP_TEXT_WITH_TITLE, SignUpItem.ALIGN_START, new SignUpTextWithTitleBean("title" , "content\n content\n ").toJson()));
     ((SignUpViewModel) viewModel).addItem(new SignUpItem(SignUpItem.SIGN_UP_WAITING, SignUpItem.ALIGN_START, new TextBean("SIGN_UP_WAITING").toJson()));
+    ((SignUpViewModel) viewModel).addItem(new SignUpItem(SignUpItem.SIGN_UP_AGREE, SignUpItem.ALIGN_START, new TextBean("SIGN_UP_WAITING").toJson()));
+
     adapter.notifyDataSetChanged();
     return viewModel;
   }

+ 2 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/model/Event.java

@@ -18,4 +18,6 @@ public class Event {
   public static final int BACK = 1;
   public static final int SIGN_UP = 2;
   public static final int LOGIN = 3;
+  public static final int CHECK = 4;
+  public static final int UNCHECK = 5;
 }

+ 1 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/model/SignUpItem.java

@@ -27,6 +27,7 @@ public class SignUpItem {
   public static final int SIGN_UP_COIN = 7;
   public static final int SIGN_UP_NOTICE = 8;
   public static final int SIGN_UP_DIVIDER = 9;
+  public static final int SIGN_UP_AGREE = 10;
 
   public static final int ALIGN_START = 0;
   public static final int ALIGN_CENTER = 1;

+ 6 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/model/SignUpViewModel.java

@@ -40,6 +40,12 @@ public class SignUpViewModel extends ViewModel {
       case Event.BACK:
         exitTo(ScreenID.LOGIN);
         break;
+      case Event.CHECK:
+        Log.e("APP#  SignUpViewModel | onEvent", "|" + "check");
+        break;
+      case Event.UNCHECK:
+        Log.e("APP#  SignUpViewModel | onEvent", "|" + "uncheck");
+        break;
       default:
         break;
     }

+ 83 - 0
app/src/main/res/layout/sign_up_agree.xml

@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout
+  xmlns:android="http://schemas.android.com/apk/res/android"
+
+  >
+  <data>
+    <import type="kr.co.zumo.app.lifeplus.view.model.Event"/>
+    <variable
+      name="model"
+      type="kr.co.zumo.app.lifeplus.view.model.ViewModel"/>
+  </data>
+
+  <LinearLayout
+    android:layout_width="300dp"
+    android:layout_height="wrap_content"
+    android:layout_margin="25dp"
+    android:orientation="vertical">
+
+    <CheckBox
+      android:id="@+id/agree_check1"
+      android:layout_width="match_parent"
+      android:layout_height="wrap_content"
+      android:layout_marginBottom="3pt"
+      android:layout_marginLeft="5pt"
+      android:textIsSelectable="false"
+      android:textSize="15dp"
+      android:onCheckedChanged="@{(view, isChecked)-> isChecked ? model.onEvent(Event.CHECK, 0) : model.onEvent(Event.UNCHECK, 0)}"
+      />
+
+    <View
+      android:layout_width="match_parent"
+      android:layout_height="2dp"
+      android:layout_centerInParent="true"
+      android:layout_marginLeft="5pt"
+      android:layout_marginRight="5pt"
+      android:background="@color/colorAccent"/>
+
+
+    <CheckBox
+      android:id="@+id/agree_check2"
+      android:layout_width="match_parent"
+      android:layout_height="wrap_content"
+      android:layout_marginLeft="5pt"
+      android:layout_marginTop="3pt"
+      android:textSize="15dp"
+      />
+
+    <CheckBox
+      android:id="@+id/agree_check3"
+      android:layout_width="match_parent"
+      android:layout_height="wrap_content"
+      android:layout_marginLeft="5pt"
+      android:textSize="15dp"
+      />
+
+    <CheckBox
+      android:id="@+id/agree_check4"
+      android:layout_width="match_parent"
+      android:layout_height="wrap_content"
+      android:layout_marginLeft="5pt"
+      android:textSize="15dp"
+      />
+
+    <CheckBox
+      android:id="@+id/agree_check5"
+      android:layout_width="match_parent"
+      android:layout_height="wrap_content"
+      android:layout_marginLeft="5pt"
+      android:text="1"
+      android:textSize="15dp"
+      />
+
+    <CheckBox
+      android:id="@+id/agree_check6"
+      android:layout_width="match_parent"
+      android:layout_height="wrap_content"
+      android:layout_marginLeft="5pt"
+      android:text="1"
+      android:textSize="15dp"
+      />
+
+  </LinearLayout>
+</layout>

+ 8 - 0
app/src/main/res/values/strings.xml

@@ -9,4 +9,12 @@
   <string name="sign_up">회원가입</string>
   <string name="login">로그인</string>
   <string name="main_text">메 인</string>
+
+  <string name="all_agree">Lifeplus 가입 약관 전체 동의 > </string>
+  <string name="service_agree1">필수) LifePlus 서비스 이용 약관 동의 > </string>
+  <string name="service_agree2">필수) 개인정보 수집 및 활용 동의 > </string>
+  <string name="service_agree3">선택) 개인정보 수집 및 활용 동의 > </string>
+  <string name="service_agree4">선택) 제휴사 서비스 이용을 위한 개인 정보 수집 및 활용 동의 > </string>
+  <string name="service_agree5">선택) 위치기반 서비스 이용 동의 > </string>
+  <string name="service_agree6">선택) 마케팅 정보 수집 동의 > </string>
 </resources>