From 199158443facf98c1f2af360bd98a8d2684c545a Mon Sep 17 00:00:00 2001 From: sonora Date: Fri, 6 Jan 2017 14:38:36 +0100 Subject: [PATCH] Scale web view font size with system font size --- OsmAnd/src/net/osmand/plus/views/POIMapLayer.java | 1 + .../android/sample1/mapcontextmenu/ContextMenuHelper.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java index 966c14c673..9de343ff3d 100644 --- a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java @@ -370,6 +370,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon settings.setDisplayZoomControls(false); settings.setSupportZoom(true); if (android.os.Build.VERSION.SDK_INT >= 14) { + //Scale web view font size with system font size settings.setTextZoom((int) (ctx.getResources().getDisplayMetrics().density * 100f)); } diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/mapcontextmenu/ContextMenuHelper.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/mapcontextmenu/ContextMenuHelper.java index d2dc486fe4..3aa25201cc 100644 --- a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/mapcontextmenu/ContextMenuHelper.java +++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/mapcontextmenu/ContextMenuHelper.java @@ -105,6 +105,10 @@ public class ContextMenuHelper { settings.setBuiltInZoomControls(true); settings.setDisplayZoomControls(false); settings.setSupportZoom(true); + if (android.os.Build.VERSION.SDK_INT >= 14) { + //Scale web view font size with system font size + settings.setTextZoom((int) (ctx.getResources().getDisplayMetrics().density * 100f)); + } wv.loadDataWithBaseURL(null, content, "text/html", "UTF-8", null); // wv.loadUrl(OsMoService.SIGN_IN_URL + app.getSettings().OSMO_DEVICE_KEY.get());