@@ -0,0 +1,2576 @@
+package cn.diaovision.omnicontrol.widget.adapter;%0A%0Aimport android.support.v7.widget.RecyclerView;%0Aimport android.view.LayoutInflater;%0Aimport android.view.View;%0Aimport android.view.ViewGroup;%0Aimport android.widget.CheckBox;%0Aimport android.widget.ImageView;%0Aimport android.widget.RelativeLayout;%0Aimport android.widget.TextView;%0A%0Aimport java.util.List;%0A%0Aimport butterknife.BindView;%0Aimport butterknife.ButterKnife;%0Aimport cn.diaovision.omnicontrol.R;%0Aimport cn.diaovision.omnicontrol.core.model.device.endpoint.HiCamera;%0Aimport cn.diaovision.omnicontrol.widget.ItemSelectionSupport;%0A%0A/**%0A * Created by TaoYimin on 2017/6/8.%0A */%0A%0Apublic class CameraAdapter extends RecyclerView.Adapter%3CCameraAdapter.CameraViewHolder%3E%7B%0A    private List%3CHiCamera%3E cameras;%0A    private ItemSelectionSupport mSelectionSupport;%0A%0A    public CameraAdapter(List%3CHiCamera%3E cameras, ItemSelectionSupport mSelectionSupport) %7B%0A        this.cameras = cameras;%0A        this.mSelectionSupport = mSelectionSupport;%0A    %7D%0A%0A    public ItemSelectionSupport getSelectionSupport() %7B%0A        return mSelectionSupport;%0A    %7D%0A%0A    @Override%0A    public CameraViewHolder onCreateViewHolder(ViewGroup parent, int viewType) %7B%0A        return new CameraViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_port2, parent, false));%0A    %7D%0A%0A    @Override%0A    public void onBindViewHolder(CameraViewHolder holder, int position) %7B%0A        holder.portBg.setBackgroundResource(R.drawable.button_blue_selector);%0A        holder.portImage.setBackgroundResource(R.drawable.camera_blue_selector);%0A        //%E8%AE%BE%E7%BD%AE%E6%91%84%E5%83%8F%E6%9C%BA%E5%88%AB%E5%90%8D%0A        holder.portAlias.setText(cameras.get(position).getAlias());%0A        //%E8%AE%BE%E7%BD%AEitem%E7%9A%84%E9%80%89%E4%B8%AD%E7%8A%B6%E6%80%81%0A        boolean checked = getSelectionSupport().isItemChecked(position);%0A        holder.checkBox.setChecked(checked);%0A        if (checked) %7B%0A            holder.portBg.setSelected(true);%0A            holder.portImage.setSelected(true);%0A        %7D else %7B%0A            holder.portBg.setSelected(false);%0A            holder.portImage.setSelected(false);%0A        %7D%0A    %7D%0A%0A    @Override%0A    public int getItemCount() %7B%0A        return cameras.size();%0A    %7D%0A%0A    public class CameraViewHolder extends RecyclerView.ViewHolder %7B%0A        @BindView(R.id.port_bg)%0A        RelativeLayout portBg;%0A        @BindView(R.id.port_checkbox)%0A        CheckBox checkBox;%0A        @BindView(R.id.port_alias)%0A        TextView portAlias;%0A        @BindView(R.id.port_image)%0A        ImageView portImage;%0A%0A        public CameraViewHolder(View itemView) %7B%0A            super(itemView);%0A            ButterKnife.bind(this, itemView);%0A        %7D%0A    %7D%0A%7D%0A

add camera adapter