|
|
@@ -5,6 +5,8 @@ package kr.co.zumo.app.lifeplus.view.fragment.signup;
|
|
|
|
|
|
import android.databinding.DataBindingUtil;
|
|
|
import android.os.Bundle;
|
|
|
+import android.support.annotation.NonNull;
|
|
|
+import android.support.annotation.Nullable;
|
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
|
import android.support.v7.widget.RecyclerView;
|
|
|
import android.view.LayoutInflater;
|
|
|
@@ -20,6 +22,7 @@ import kr.co.zumo.app.lifeplus.view.fragment.factory.BasicFragmentFactory;
|
|
|
import kr.co.zumo.app.lifeplus.view.model.SignUpListItem;
|
|
|
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.SignUpTextBean;
|
|
|
|
|
|
/**
|
|
|
* 회원 가입 화면
|
|
|
@@ -31,23 +34,26 @@ import kr.co.zumo.app.lifeplus.view.model.ViewModel;
|
|
|
* @history 민효동 [2018. 9. 5.] [최초 작성]
|
|
|
* @since 2018. 9. 5.
|
|
|
*/
|
|
|
+
|
|
|
public class SignUpFragment extends FragmentBase {
|
|
|
|
|
|
+ private SignUpAdapter adapter;
|
|
|
+
|
|
|
public SignUpFragment() {
|
|
|
// Required empty public constructor
|
|
|
}
|
|
|
|
|
|
+ @Nullable
|
|
|
@Override
|
|
|
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
|
|
- // Inflate the layout for this fragment
|
|
|
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
|
|
return DataBindingUtil.inflate(inflater, R.layout.fragment_sign_up, container, false).getRoot();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
protected ViewModel defineViewModel() {
|
|
|
ScreenChangerHelper helper = ScreenChangerHelper.getInstance();
|
|
|
SignUpViewModel signUpViewModel = new SignUpViewModel(new FragmentChanger(helper.getFragmentActivity(), helper.getContainerId(), new BasicFragmentFactory()));
|
|
|
- signUpViewModel.addItem(new SignUpListItem(SignUpListItem.SIGN_UP_HELLO, App.getInstance().getString(R.string.sign_up_hello_text)));
|
|
|
SignUpAdapter adapter = new SignUpAdapter(signUpViewModel);
|
|
|
RecyclerView recyclerView = getActivity().findViewById(R.id.sign_up_list);
|
|
|
recyclerView.setHasFixedSize(true);
|
|
|
@@ -58,4 +64,13 @@ public class SignUpFragment extends FragmentBase {
|
|
|
return viewModel;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void onStart() {
|
|
|
+ super.onStart();
|
|
|
+
|
|
|
+
|
|
|
+ // fixme for test
|
|
|
+ ((SignUpViewModel) viewModel).addItem(new SignUpListItem(SignUpListItem.SIGN_UP_HELLO, new SignUpTextBean(App.getInstance().getString(R.string.sign_up_hello_text)).toJson()));
|
|
|
+ adapter.notifyDataSetChanged();
|
|
|
+ }
|
|
|
}
|