0
votes

I'm using WebView to show some html content with different width. Initial scale is set up to show all page content. without horizontal scroll. This code is used:

webView.getSettings().setUseWideViewPort(true);
webView.getSettings().setLoadWithOverviewMode(true);

Now I want to forbid zoom out but keep zoom in enabled. Can anyone help to find the way?

UPD:

Some additional explanations.

I want to limit minimum scale for webView. For example, If scale=0.67 make page to fit the width of WebView I want to forbid user set scale less then 0.67, but keep the possibility to set scale greater than 0.67. Main problem here is that displaying content has different width and therefore minimal scale is different for different pages.

1

1 Answers

0
votes

I can tell you that what you are trying to achieve is a Bad UX. Zoom in and Zoom out are related to each other. If the user zoomed in by mistake, and found out that you are preventing him from zooming out. Expect disappointment and maybe 1 star on the market.

Even the WebView does not allow you to enable one and disable the other.

But if you really want to do that, then you need to implement the gesture by yourself and calculate the difference between the figures. If the difference is getting bigger (ZoomIn) otherwise (ZoomOut)

This link will help you implement the Zoom Gesture