I’m trying to get the zoom control on my webview.
I have seen many times this solution :
private static final FrameLayout.LayoutParams ZOOM_PARAMS = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM);
FrameLayout mContentView = (FrameLayout) getWindow().
getDecorView().findViewById(android.R.id.content);
final View zoom = this.objetview.getZoomControls();
mContentView.addView(zoom, ZOOM_PARAMS);
zoom.setVisibility(View.GONE);
It works pretty well but is it possible to do it without having to use a webview layout in an xml file ? How can I add it to a simple code like this one :
public class Affiche extends Activity
{
public String lien;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
MyWebView webview = new MyWebView(this);
String lien_changed = CreateLien(chapitre , nom_livre_changed);
webview.loadUrl(lien_changed);
setContentView(webview);
}
class MyWebView extends WebView implements OnGestureListener
{ ..... // MyWebView to implement Gesture Detector ...
Thanks !
I found the answer to my question. In fact, the code I used is deprecated… This is what works for me now :
Thanks !