|
|
@@ -18,9 +18,9 @@ import android.widget.TextView;
|
|
|
import java.util.List;
|
|
|
|
|
|
import kr.co.zumo.app.R;
|
|
|
-import kr.co.zumo.app.lifeplus.bean.TextImageBean;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.AddMyBucketListBean;
|
|
|
import kr.co.zumo.app.lifeplus.manager.ActionBarManager;
|
|
|
-import kr.co.zumo.app.lifeplus.model.MyBucketListModel;
|
|
|
+import kr.co.zumo.app.lifeplus.model.AddMyBucketListModel;
|
|
|
import kr.co.zumo.app.lifeplus.view.Event;
|
|
|
import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
|
|
|
|
|
|
@@ -34,7 +34,7 @@ import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
|
|
|
* @history 하세미 [2018-10-18] [최초 작성]
|
|
|
* @since 2018-10-18
|
|
|
*/
|
|
|
-public class AddMyBucketListFragment extends FragmentBase<MyBucketListPresenter> implements IMyBucketListView {
|
|
|
+public class AddMyBucketListFragment extends FragmentBase<AddMyBucketListPresenter> implements IAddMyBucketListView {
|
|
|
|
|
|
private RecyclerView recyclerViewImageList;
|
|
|
private EditText editTextMyBucketTitle;
|
|
|
@@ -55,6 +55,7 @@ public class AddMyBucketListFragment extends FragmentBase<MyBucketListPresenter>
|
|
|
editTextMyBucketTitle = findViewById(R.id.edit_text_my_bucket);
|
|
|
textViewMyBucketDetail = findViewById(R.id.text_view_my_bucket_detail);
|
|
|
buttonAddMyBucket = findViewById(R.id.button_add_my_bucket);
|
|
|
+ imageViewBack = findViewById(R.id.image_background);
|
|
|
|
|
|
editTextMyBucketTitle.requestFocus();
|
|
|
editTextMyBucketTitle.addTextChangedListener(new TextWatcher() {
|
|
|
@@ -96,12 +97,10 @@ public class AddMyBucketListFragment extends FragmentBase<MyBucketListPresenter>
|
|
|
|
|
|
}
|
|
|
|
|
|
- public void init(List<TextImageBean> myBucketListData) {
|
|
|
- AddMyBucketListAdapter addMyBucketListAdapter = new AddMyBucketListAdapter(getActivity(), myBucketListData, new AddMyBucketListAdapter.IClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(int index) {
|
|
|
- presenter.onEvent(new Event.Builder(Event.CLICK).integer(index).build());
|
|
|
- }
|
|
|
+ public void init(List<AddMyBucketListBean> myBucketListData) {
|
|
|
+ int selectedIndex = presenter.getSelectedIndex();
|
|
|
+ AddMyBucketListAdapter addMyBucketListAdapter = new AddMyBucketListAdapter(getActivity(), myBucketListData, selectedIndex, index -> {
|
|
|
+ presenter.onEvent(new Event.Builder(Event.CLICK).integer(index).build());
|
|
|
});
|
|
|
recyclerViewImageList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
|
|
|
recyclerViewImageList.setAdapter(addMyBucketListAdapter);
|
|
|
@@ -119,11 +118,10 @@ public class AddMyBucketListFragment extends FragmentBase<MyBucketListPresenter>
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- protected MyBucketListPresenter definePresenter() {
|
|
|
- return new MyBucketListPresenter(getModel(MyBucketListModel.class), this);
|
|
|
+ protected AddMyBucketListPresenter definePresenter() {
|
|
|
+ return new AddMyBucketListPresenter(getModel(AddMyBucketListModel.class), this);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 등록 버튼 보이기 안보이기
|
|
|
*
|
|
|
@@ -149,11 +147,11 @@ public class AddMyBucketListFragment extends FragmentBase<MyBucketListPresenter>
|
|
|
|
|
|
@Override
|
|
|
public void changeBackground(int drawableId) {
|
|
|
-
|
|
|
+ imageViewBack.setImageResource(drawableId);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void changeDescription(int stringId) {
|
|
|
-
|
|
|
+ textViewMyBucketDetail.setText(stringId);
|
|
|
}
|
|
|
}
|