this is a RecyclerView, that slides from left to right. When I click on the first item follower, it becomes "followed", but when I slide to the right, some of the item data also change to "followed", and the data is still messed up when I slide back.
this is how I handle it, but I can"t:
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
//TODO:bug,.item
TextView tvNotFocus = view.findViewById(R.id.tv_related_theme_recommended_focus);//
String focus = tvNotFocus.getText().toString();
List<TopicRelatedRecommendedBean> data = getData();
TopicRelatedRecommendedBean topicRelatedRecommendedBean = data.get(position);
boolean select = topicRelatedRecommendedBean.isSelect();
Log.d(TAG, "1145= "+select);
if (view.getId() == R.id.tv_related_theme_recommended_focus) {
if (focus.equals("")) {
tvNotFocus.setText("");
tvNotFocus.setBackgroundResource(R.drawable.topic_already_focus_shape);
} else if (focus.equals("")) {
tvNotFocus.setText("");
tvNotFocus.setBackgroundResource(R.drawable.release_button_shape);
}
}
// if (select) {
// Toast.makeText(mContext, "", Toast.LENGTH_SHORT).show();
// topicRelatedRecommendedBean.setSelect(false);
// tvNotFocus.setText("");
// tvNotFocus.setBackgroundResource(R.drawable.release_button_shape);
// } else {
// Toast.makeText(mContext, "", Toast.LENGTH_SHORT).show();
// topicRelatedRecommendedBean.setSelect(true);
// tvNotFocus.setText("");
// tvNotFocus.setBackgroundResource(R.drawable.topic_already_focus_shape);
// }
}