|
|
@@ -23,6 +23,7 @@ import java.util.List;
|
|
|
import cn.muchinfo.rma.R;
|
|
|
import cn.muchinfo.rma.global.GlobalDataCollection;
|
|
|
import cn.muchinfo.rma.global.ViewEnumUtils;
|
|
|
+import cn.muchinfo.rma.global.data.ContractData;
|
|
|
import cn.muchinfo.rma.global.data.PaTradeLinkData;
|
|
|
import cn.muchinfo.rma.global.data.PaTradeLinkDetailData;
|
|
|
import cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView;
|
|
|
@@ -60,14 +61,24 @@ public class RelationalRecordContentAdapter extends RecyclerView.Adapter<Relatio
|
|
|
notifyDataSetChanged();
|
|
|
}
|
|
|
|
|
|
- private void setPosition(int position) {
|
|
|
- if (this.position == position) {
|
|
|
- this.position = -1;
|
|
|
- notifyItemChanged(index);
|
|
|
- } else {
|
|
|
- this.position = position;
|
|
|
- notifyItemChanged(position);
|
|
|
+ private void setOnItemClick(int position){
|
|
|
+ List<PaTradeLinkDetailData> newDataList = new ArrayList<>();
|
|
|
+ for (int i = 0;i < datas.size();i++){
|
|
|
+ if (position == i){
|
|
|
+ PaTradeLinkDetailData data1 = datas.get(i);
|
|
|
+ if (data1.isOnClick() == 0){
|
|
|
+ data1.setOnClick(1);
|
|
|
+ }else {
|
|
|
+ data1.setOnClick(0);
|
|
|
+ }
|
|
|
+ newDataList.add(data1);
|
|
|
+ }else {
|
|
|
+ PaTradeLinkDetailData newData = datas.get(i);
|
|
|
+ newData.setOnClick(0);
|
|
|
+ newDataList.add(newData);
|
|
|
+ }
|
|
|
}
|
|
|
+ setDatas(newDataList);
|
|
|
}
|
|
|
|
|
|
@NonNull
|
|
|
@@ -103,7 +114,7 @@ public class RelationalRecordContentAdapter extends RecyclerView.Adapter<Relatio
|
|
|
}
|
|
|
itemViewHolder.allView.setVisibility(View.GONE);
|
|
|
|
|
|
- if (i == this.position) {
|
|
|
+ if (data.isOnClick() == 1) {
|
|
|
itemViewHolder.roots_view.setBackgroundColor(context.getResources().getColor(R.color.rma_list_select_color));
|
|
|
itemViewHolder.allView.setVisibility(View.VISIBLE);
|
|
|
} else {
|
|
|
@@ -113,7 +124,7 @@ public class RelationalRecordContentAdapter extends RecyclerView.Adapter<Relatio
|
|
|
itemViewHolder.all_click_View.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
|
- setPosition(i);
|
|
|
+ setOnItemClick(i);
|
|
|
}
|
|
|
});
|
|
|
if (GlobalDataCollection.Companion.getInstance().getFourLevelMenu("client_spots", "client_spots_link", "client_spots_link_logs", "client_spots_link_logs_unlink")) {
|