sephiroth74 / ImageViewZoom

Android ImageView widget with zoom and pan capabilities
Other
1.9k stars 533 forks source link

min_zoom does not take effect #72

Open osemen-remit opened 9 years ago

osemen-remit commented 9 years ago

Hi, I'm trying to make image fit screen in the min_zoom like this:

        image.setDisplayType(ImageViewTouchBase.DisplayType.FIT_TO_SCREEN);

        Glide.with(this)
                .load(imageUrl)
                .dontAnimate()
                .into(new SimpleTarget<GlideDrawable>() {
                    @Override
                    public void onResourceReady(GlideDrawable resource, GlideAnimation<? super GlideDrawable> glideAnimation) {
                        float screen_w = getApplicationContext().getResources().getDisplayMetrics().widthPixels;
                        float drawable_w = resource.getIntrinsicWidth();
                        float min_scale = screen_w / drawable_w;
                        image.setImageDrawable(resource, null, min_scale, 3 * min_scale);
                    }
                });

for instance screen_widh = 1080 and drawable_width=640 so min_scale = 1.6875 but in any case it scales down to 640.