Example usage for android.graphics Region setEmpty

List of usage examples for android.graphics Region setEmpty

Introduction

In this page you can find the example usage for android.graphics Region setEmpty.

Prototype

public void setEmpty() 

Source Link

Document

Set the region to the empty region

Usage

From source file:com.roger.lineselectionwebview.LSWebView.java

/**
 * Setups up the web view./*from   w  w w . j ava 2s. c  om*/
 * 
 * @param context
 */
@SuppressLint("SetJavaScriptEnabled")
protected void setup(Context context) {

    // On Touch Listener
    setOnLongClickListener(this);
    setOnTouchListener(this);

    // Webview setup
    getSettings().setJavaScriptEnabled(true);
    getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
    getSettings().setPluginState(WebSettings.PluginState.ON);
    // getSettings().setBuiltInZoomControls(true);

    // Webview client.
    setWebViewClient(new WebViewClient() {
        // This is how it is supposed to work, so I'll leave it in, but this
        // doesn't get called on pinch
        // So for now I have to use deprecated getScale method.
        @Override
        public void onScaleChanged(WebView view, float oldScale, float newScale) {
            super.onScaleChanged(view, oldScale, newScale);
            mCurrentScale = newScale;
        }
    });

    // Zoom out fully
    // getSettings().setLoadWithOverviewMode(true);
    // getSettings().setUseWideViewPort(true);

    // Javascript interfaces
    mTextSelectionJSInterface = new TextSelectionJavascriptInterface(context, this);
    addJavascriptInterface(mTextSelectionJSInterface, mTextSelectionJSInterface.getInterfaceName());

    // Create the selection handles
    createSelectionLayer(context);

    // Set to the empty region
    Region region = new Region();
    region.setEmpty();
    mLastSelectedRegion = region;

    // Load up the android asset file
    // String filePath = "file:///android_asset/content.html";

    // Load the url
    // this.loadUrl(filePath);

}