|
|
@@ -7,11 +7,12 @@ import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
|
|
|
import kr.co.zumo.app.R;
|
|
|
+import kr.co.zumo.app.lifeplus.view.model.SignUpListItem;
|
|
|
+import kr.co.zumo.app.lifeplus.view.model.SignUpViewModel;
|
|
|
|
|
|
/**
|
|
|
- * [클래스 개요]
|
|
|
+ * 회원 가입 리스트 뷰 화면의 관리하는 어댑터 클래스
|
|
|
* <pre>
|
|
|
- * [클래스 상세 설명 또는 사용 시 주의점]
|
|
|
* </pre>
|
|
|
*
|
|
|
* @author 하세미
|
|
|
@@ -21,10 +22,10 @@ import kr.co.zumo.app.R;
|
|
|
*/
|
|
|
public class SignUpAdapter extends RecyclerView.Adapter {
|
|
|
|
|
|
- private static final int SIGN_UP_HELLO = 0;
|
|
|
- private static final int SIGN_UP_BENEFIT = 1;
|
|
|
+ private SignUpViewModel signUpViewModel;
|
|
|
|
|
|
- public SignUpAdapter() {
|
|
|
+ public SignUpAdapter(SignUpViewModel signUpViewModel) {
|
|
|
+ this.signUpViewModel = signUpViewModel;
|
|
|
}
|
|
|
|
|
|
@NonNull
|
|
|
@@ -32,16 +33,16 @@ public class SignUpAdapter extends RecyclerView.Adapter {
|
|
|
public BaseViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
|
|
BaseViewHolder holder = null;
|
|
|
switch (viewType) {
|
|
|
- case SIGN_UP_HELLO:
|
|
|
+ case SignUpListItem.SIGN_UP_HELLO:
|
|
|
View textView = LayoutInflater.from(parent.getContext()).inflate(R.layout.sign_up_text_view, parent, false);
|
|
|
holder = new TextViewHolder(textView);
|
|
|
holder.draw();
|
|
|
break;
|
|
|
- case SIGN_UP_BENEFIT:
|
|
|
+// case SignUpListItem.SIGN_UP_BENEFIT:
|
|
|
// dataObj = viewModel.getCurrentData();
|
|
|
// holder = new BenefitHolder(parent, dataObj);
|
|
|
// View SignUpBenefitView = LayoutInflater.from(parent.getContext()).inflate(R.layout.signup_benefit_view, parent, false);
|
|
|
- break;
|
|
|
+// break;
|
|
|
default:
|
|
|
break;
|
|
|
|
|
|
@@ -60,14 +61,8 @@ public class SignUpAdapter extends RecyclerView.Adapter {
|
|
|
|
|
|
@Override
|
|
|
public int getItemViewType(int position) {
|
|
|
- switch (position) {
|
|
|
- case 0:
|
|
|
- return SIGN_UP_HELLO;
|
|
|
- case 1:
|
|
|
- return SIGN_UP_BENEFIT;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
- return 0;
|
|
|
+ SignUpListItem item = signUpViewModel.getLastItem();
|
|
|
+ int itemType = item.getItemType();
|
|
|
+ return itemType;
|
|
|
}
|
|
|
}
|