2018-03-23工作日志,点击广告跳转不同界面

工作日志系列,主要作用记录我的工作中遇到的问题或者需求。如对你有帮助,那很好,如没有帮助,请略过。

    /**
     * 广告布局
     *
     * @param holder
     * @param bean
     * @param position
     */
    private void bindADView(CommonRecycleViewHolder holder, BannerNavigation bean, int position) {
        ImageView img_ad_view = holder.getView(R.id.img_ad_view);
        LoadImageManage.loadImage((Activity) mContext, img_ad_view, bean.getImage_url());
        img_ad_view.setOnClickListener(v -> {
            StatisticsUtil.setClickNum(mContext, "zh-gz-gg");
            if (bean.getOther_type() == 1) {// 1、微整项目详情
                NextActivityUtil.toNextActivityInt((Activity) mContext, ProjectDetailsActivity.class, bean.getOther_id(), false);
            } else if (bean.getOther_type() == 2) {// 2、商品详情(前台不显示)
                // 医生分享视频详情
                Intent intent = new Intent(mContext, DoctorShareDetailActivity.class);
                intent.putExtra("id", bean.getOther_id());
                intent.putExtra("type", 2);
                mContext.startActivity(intent);
            } else if (bean.getOther_type() == 3) {//3名医圈详情
                // 医生分享图文详情
                Intent intentVideo = new Intent(mContext, DoctorShareDetailActivity.class);
                intentVideo.putExtra("id", bean.getOther_id());
                intentVideo.putExtra("type", 1);
                mContext.startActivity(intentVideo);
            } else if (bean.getOther_type() == 4) {//4 医院主页
                // 医院主页
                NextActivityUtil.toNextActivityInt((Activity) mContext, HospitalDetailActivity.class, bean.getOther_id(), false);
            } else if (bean.getOther_type() == 5) {//5 普通医生主页
                // 普通医生主页
                Bundle bundle = new Bundle();
                bundle.putInt("doctor_id", bean.getOther_id());
                NextActivityUtil.toNextActivity((Activity) mContext, DoctorInfoActivity.class, bundle, false);
            } else if (bean.getOther_type() == 6) {//6 内部链接(h5)
                NextActivityUtil.toNextActivity((Activity) mContext, WebViewActivity.class, new BengH5Bean("广告", bean.getImage_url(), -1), false);
            } else if (bean.getOther_type() == 7) {// 7 外部链接(h5)
                SystemUI.toBrower(mContext, bean.getWeb_url());
            } else if (bean.getOther_type() == 8) {// 8 微整项目
                NextActivityUtil.toNextActivity((Activity) mContext, ProjectListActivity.class, bean.getOther_id() + "|" + bean.getName(), false);
            } else if (bean.getOther_type() == 9) {//9视频问诊列表页
                //切换到视频面诊碎片
                Activity activity = (Activity) mContext;
                if (activity instanceof MainActivity) {
                    MainActivity mainActivity = (MainActivity) activity;
                    mainActivity.mainHomePageFragment.switchFragment(3);
                }
            } else if (bean.getOther_type() == 10) {//10不跳转

            } else if (bean.getOther_type() == 11) {// 11 名医项目
                NextActivityUtil.toNextActivity((Activity) mContext, ProjectListActivity.class, bean.getOther_id() + "|" + bean.getName(), false);
//                NextActivityUtil.toNextActivity((Activity) mContext, ProjectListActivity.class, bean.getOther_id(), false);
            } else if (bean.getOther_type() == 12) {//12 名医医生主页
                Bundle bundle = new Bundle();
                bundle.putInt("doctor_id", bean.getOther_id());
                NextActivityUtil.toNextActivity((Activity) mContext, DoctorInfoActivity.class, bundle, false);
            } else if (bean.getOther_type() == 13) {//13 名医项目详情
                NextActivityUtil.toNextActivity((Activity) mContext, ProjectDetailsActivity.class, bean.getOther_id(), false);
            }
        });
    }

你可能感兴趣的:(2018-03-23工作日志,点击广告跳转不同界面)