|
|
@@ -9,8 +9,10 @@ import android.view.View;
|
|
|
import android.widget.CheckBox;
|
|
|
|
|
|
import kr.co.zumo.app.R;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.CategoryCheckBean;
|
|
|
import kr.co.zumo.app.lifeplus.view.Event;
|
|
|
import kr.co.zumo.app.lifeplus.view.IEventListener;
|
|
|
+import kr.co.zumo.app.lifeplus.view.screen.category.CategoryID;
|
|
|
|
|
|
/**
|
|
|
* SearchResultCategoryHolder
|
|
|
@@ -33,10 +35,41 @@ public class SearchResultCategoryHolder extends RecyclerView.ViewHolder {
|
|
|
|
|
|
}
|
|
|
|
|
|
- public void bind(String categoryName, boolean isChecked, IEventListener listener) {
|
|
|
- if (null != categoryName) {
|
|
|
- checkBox.setText(categoryName);
|
|
|
+ public void bind(CategoryCheckBean bean, IEventListener listener) {
|
|
|
+ String tag = bean.getCategoryName();
|
|
|
+ boolean isChecked = bean.isChecked();
|
|
|
|
|
|
+ if (null != tag) {
|
|
|
+ int tagRes = 0;
|
|
|
+ switch (bean.getCategoryNo()) {
|
|
|
+ case CategoryID
|
|
|
+ .CATEGORY_1:
|
|
|
+ tagRes = R.string.book_mark_category1;
|
|
|
+ break;
|
|
|
+ case CategoryID
|
|
|
+ .CATEGORY_2:
|
|
|
+ tagRes = R.string.book_mark_category2;
|
|
|
+ break;
|
|
|
+ case CategoryID
|
|
|
+ .CATEGORY_3:
|
|
|
+ tagRes = R.string.book_mark_category3;
|
|
|
+ break;
|
|
|
+ case CategoryID
|
|
|
+ .CATEGORY_4:
|
|
|
+ tagRes = R.string.book_mark_category4;
|
|
|
+ break;
|
|
|
+ case CategoryID
|
|
|
+ .CATEGORY_5:
|
|
|
+ tagRes = R.string.book_mark_category5;
|
|
|
+ break;
|
|
|
+ case "":
|
|
|
+ tagRes = R.string.search_category_all;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+
|
|
|
+ }
|
|
|
+ checkBox.setText(tagRes);
|
|
|
checkBox.setChecked(isChecked);
|
|
|
checkBox.setOnClickListener(v -> {
|
|
|
listener.onEvent(new Event.Builder(Event.CATEGORY_CLICK).index(getAdapterPosition()).bool(checkBox.isChecked()).build());
|