|
|
@@ -14,25 +14,16 @@ import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-
|
|
|
import kr.co.zumo.app.R;
|
|
|
+import kr.co.zumo.app.databinding.FragmentSignUpBinding;
|
|
|
import kr.co.zumo.app.lifeplus.application.App;
|
|
|
import kr.co.zumo.app.lifeplus.manager.ActionBarManager;
|
|
|
import kr.co.zumo.app.lifeplus.supervisor.FragmentChanger;
|
|
|
import kr.co.zumo.app.lifeplus.supervisor.ScreenChangerHelper;
|
|
|
-import kr.co.zumo.app.lifeplus.util.ResourceUtil;
|
|
|
import kr.co.zumo.app.lifeplus.view.fragment.FragmentBase;
|
|
|
import kr.co.zumo.app.lifeplus.view.fragment.factory.BasicFragmentFactory;
|
|
|
-import kr.co.zumo.app.lifeplus.view.model.SignUpItem;
|
|
|
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.SignUpButtonBean;
|
|
|
-import kr.co.zumo.app.lifeplus.view.model.bean.SignUpTextWithTitleBean;
|
|
|
-import kr.co.zumo.app.lifeplus.view.model.bean.TextBean;
|
|
|
|
|
|
/**
|
|
|
* 회원 가입 화면
|
|
|
@@ -65,61 +56,18 @@ public class SignUpFragment extends FragmentBase {
|
|
|
SignUpViewModel signUpViewModel = new SignUpViewModel(new FragmentChanger(helper.getFragmentActivity(), helper.getContainerId(), new BasicFragmentFactory()));
|
|
|
adapter = new SignUpAdapter(signUpViewModel);
|
|
|
|
|
|
+ FragmentSignUpBinding binding = DataBindingUtil.getBinding(getView());
|
|
|
+
|
|
|
RecyclerView recyclerView = getView().findViewById(R.id.sign_up_list);
|
|
|
recyclerView.setHasFixedSize(true);
|
|
|
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(App.getInstance().getContext());
|
|
|
recyclerView.setLayoutManager(layoutManager);
|
|
|
recyclerView.setAdapter(adapter);
|
|
|
|
|
|
+ binding.setModel(signUpViewModel);
|
|
|
+
|
|
|
viewModel = signUpViewModel;
|
|
|
|
|
|
-// viewModel.setEventListener(new IViewModelEventListener<SignUpViewModel>() {
|
|
|
-// @Override
|
|
|
-// public void onEventFromViewModel(SignUpViewModel viewModel, int eventId, int intValue, @Nullable String stringValue) {
|
|
|
-// switch (eventId) {
|
|
|
-// case Event.CLICK:
|
|
|
-// if (intValue == SignUpItem.BUTTON_ID_PIN) {
|
|
|
-// // 핀 번호 입력 다이얼 로그 호출
|
|
|
-// Log.i("APP# SignUpFragment | onEventFromViewModel", "| eventId: " + eventId + ", intValue: " + intValue);
|
|
|
-// }
|
|
|
-// break;
|
|
|
-// default:
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// });
|
|
|
-
|
|
|
- // fixme for test
|
|
|
-
|
|
|
- signUpViewModel.addItem(new SignUpItem(SignUpItem.SIGN_UP_TEXT, SignUpItem.ALIGN_START, new TextBean(ResourceUtil.getString(R.string.sign_up_hello_text)).toJson()));
|
|
|
-
|
|
|
- SignUpBenefitBean bean = new SignUpBenefitBean("1 번째 텍스트", R.drawable.common_full_open_on_phone, "benefit text1", "category text1");
|
|
|
- SignUpBenefitBean bean2 = new SignUpBenefitBean("2 번째 텍스트", R.drawable.common_full_open_on_phone, "benefit text2", "category text2");
|
|
|
- SignUpBenefitBean bean3 = new SignUpBenefitBean("3 번째 텍스트", R.drawable.common_full_open_on_phone, "benefit text3", "category text3");
|
|
|
- ArrayList<SignUpBenefitBean> list = new ArrayList<>(Arrays.asList(bean, bean2, bean3));
|
|
|
- signUpViewModel.addItem(new SignUpItem(SignUpItem.SIGN_UP_BENEFIT, SignUpItem.ALIGN_CENTER, new SignUpBenefitListBean(list).toJson()));
|
|
|
-
|
|
|
- signUpViewModel.addItem(new SignUpItem(SignUpItem.SIGN_UP_DIVIDER, new TextBean("본인인증").toJson()));
|
|
|
- signUpViewModel.addItem(new SignUpItem(SignUpItem.SIGN_UP_TEXT, SignUpItem.ALIGN_START, new TextBean(ResourceUtil.getString(R.string.sign_up_need_id)).toJson()));
|
|
|
- signUpViewModel.addItem(new SignUpItem(SignUpItem.SIGN_UP_TEXT, SignUpItem.ALIGN_END, new TextBean(ResourceUtil.getString(R.string.sign_up_mobile_confirm)).toJson()));
|
|
|
- signUpViewModel.addItem(new SignUpItem(SignUpItem.SIGN_UP_TEXT_WITH_TITLE, SignUpItem.ALIGN_START, new SignUpTextWithTitleBean(ResourceUtil.getString(R.string.sign_up_id_confirm_completed), "김한화, 남\n1982.02.20\n010-1234-5678").toJson()));
|
|
|
- signUpViewModel.addItem(new SignUpItem(SignUpItem.SIGN_UP_DIVIDER, new TextBean(ResourceUtil.getString(R.string.sign_up_input_pin)).toJson()));
|
|
|
- signUpViewModel.addItem(new SignUpItem(SignUpItem.SIGN_UP_TEXT, SignUpItem.ALIGN_START, new TextBean(ResourceUtil.getString(R.string.sign_up_need_pin)).toJson()));
|
|
|
- signUpViewModel.addItem(new SignUpItem(SignUpItem.SIGN_UP_BUTTON, SignUpItem.ALIGN_END, new SignUpButtonBean(ResourceUtil.getString(R.string.sign_up_input_pin), SignUpItem.BUTTON_ID_PIN).toJson()));
|
|
|
- signUpViewModel.addItem(new SignUpItem(SignUpItem.SIGN_UP_TEXT, SignUpItem.ALIGN_END, new TextBean(ResourceUtil.getString(R.string.sign_up_pin_confirm)).toJson()));
|
|
|
- signUpViewModel.addItem(new SignUpItem(SignUpItem.SIGN_UP_TEXT, SignUpItem.ALIGN_START, new TextBean(ResourceUtil.getString(R.string.sign_up_pin_confirm_completed)).toJson()));
|
|
|
- signUpViewModel.addItem(new SignUpItem(SignUpItem.SIGN_UP_DIVIDER, new TextBean("약관동의").toJson()));
|
|
|
- signUpViewModel.addItem(new SignUpItem(SignUpItem.SIGN_UP_AGREE, SignUpItem.ALIGN_START, new TextBean("SIGN_UP_WAITING").toJson()));
|
|
|
- signUpViewModel.addItem(new SignUpItem(SignUpItem.SIGN_UP_TEXT, SignUpItem.ALIGN_END, new TextBean(ResourceUtil.getString(R.string.sign_up_agree_completed)).toJson()));
|
|
|
- signUpViewModel.addItem(new SignUpItem(SignUpItem.SIGN_UP_DIVIDER, new TextBean("가입완료").toJson()));
|
|
|
- signUpViewModel.addItem(new SignUpItem(SignUpItem.SIGN_UP_TEXT, SignUpItem.ALIGN_START, new TextBean(ResourceUtil.getString(R.string.sign_up_completed, "한화")).toJson()));
|
|
|
- signUpViewModel.addItem(new SignUpItem(SignUpItem.SIGN_UP_COIN, SignUpItem.ALIGN_START, new TextBean("가입 완료 코인 300c 지급 완료").toJson()));
|
|
|
- signUpViewModel.addItem(new SignUpItem(SignUpItem.SIGN_UP_TWO_BUTTON, SignUpItem.ALIGN_CENTER, new TextBean("two button").toJson()));
|
|
|
- signUpViewModel.addItem(new SignUpItem(SignUpItem.SIGN_UP_NOTICE, SignUpItem.ALIGN_CENTER, new TextBean("SIGN_UP_NOTICE").toJson()));
|
|
|
- signUpViewModel.addItem(new SignUpItem(SignUpItem.SIGN_UP_WAITING, SignUpItem.ALIGN_CENTER, new TextBean("SIGN_UP_WAITING").toJson()));
|
|
|
-
|
|
|
-
|
|
|
- adapter.notifyDataSetChanged();
|
|
|
return viewModel;
|
|
|
}
|
|
|
|
|
|
@@ -130,4 +78,14 @@ public class SignUpFragment extends FragmentBase {
|
|
|
actionBarManager.setDisplayHomeAsUpEnabled(true);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ protected void start() {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void stop() {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|