Skip to content

banner的点击事件和其中view的点击事件是不是无效了? #8

@dongweiq

Description

@dongweiq

代码如下,其中view的点击事件不能被识别
` binding.banner.setPages(new CustomBanner.ViewCreator<HomeBean.RobotListBean>() {
@OverRide
public View createView(Context context, int i) {
View view = LayoutInflater.from(context).inflate(R.layout.item_manager_home_vp, null);
return view;
}

        @Override
        public void updateUI(Context context, View view, int i, HomeBean.RobotListBean robotListBean) {
            RelativeLayout rlrobot = view.findViewById(R.id.rl_robot);
            rlrobot.setOnClickListener(v -> {
                Intent intent = new Intent(getActivity(), RobotManageActivity.class);
                intent.putExtra("storeId", HttpRequstUtil.storeInfo.getStoreId());
                intent.putExtra("storeName", HttpRequstUtil.storeInfo.getStoreName());
                intent.putExtra("storeImage", HttpRequstUtil.storeInfo.getImageUrl());
                getActivity().startActivity(intent);
            });
            ((TextView) view.findViewById(R.id.tv_robot_name)).setText(robotListBean.getNickname());
            ImageView imageView = ((ImageView) view.findViewById(R.id.iv_vp_header));
            Glide.with(getActivity()).load(robotListBean.getAvatarUrl()).into(imageView);
            ((TextView) view.findViewById(R.id.tv_battery_floor)).setText("所在楼层: " + robotListBean.getCurrentFloor() + "F 电量: " + (int) robotListBean.getPowerPercent() + "%");
            ((TextView) view.findViewById(R.id.tv_status)).setText(Constant.getRobotStatus2String(robotListBean.getTaskStatus()) + "");

        }
    }, robotListBeans);`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions