Remove android auto print margin (Closes #81)
This commit is contained in:
parent
ea404a0acd
commit
147f562d0a
@ -28,6 +28,8 @@ import android.print.PrintAttributes;
|
||||
import android.print.PrintDocumentAdapter;
|
||||
import android.print.PrintJob;
|
||||
import android.print.PrintManager;
|
||||
import android.view.View;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
|
||||
@ -158,8 +160,20 @@ public class Printer extends CordovaPlugin {
|
||||
private void initWebView (JSONObject props) {
|
||||
Activity ctx = cordova.getActivity();
|
||||
view = new WebView(ctx);
|
||||
WebSettings settings = view.getSettings();
|
||||
|
||||
view.getSettings().setDatabaseEnabled(true);
|
||||
settings.setDatabaseEnabled(true);
|
||||
settings.setGeolocationEnabled(true);
|
||||
settings.setSaveFormData(true);
|
||||
settings.setUseWideViewPort(true);
|
||||
view.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
Method setMixedContentModeMethod = getMethod(settings.getClass(),
|
||||
"setMixedContentMode", int.class);
|
||||
|
||||
invokeMethod(settings, setMixedContentModeMethod, 2);
|
||||
}
|
||||
|
||||
setWebViewClient(props);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user