图片放大

 View inflate = getLayoutInflater().inflate(R.layout.big_image_popupwindow, null);
        ViewPager vp = inflate.findViewById(R.id.img_vp);
        popupWindow = new PopupWindow(inflate, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, true);
        popupWindow.setTouchable(true);
        popupWindow.setBackgroundDrawable(new ColorDrawable());
        // 设置好参数之后再show
        popupWindow.showAtLocation(toolbarLook,Gravity.CENTER, 0, 0);
        if (views == null) {
            views = new ArrayList<>();
        }
        View bigInflate = getLayoutInflater().inflate(R.layout.big_img, null);
        ImageView img_big = bigInflate.findViewById(R.id.img_big_vp);
        GlideUtils.glide(s, img_big);
        views.add(img_big);
        GuideVpAdapter adapter = new GuideVpAdapter(views);
        vp.setAdapter(adapter);
        img_big.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                popupWindow.dismiss();
                views.clear();
            }
        });

你可能感兴趣的:(图片放大)