Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
e2ec0347ac
2 changed files with 24 additions and 0 deletions
|
@ -372,6 +372,18 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
|
||||||
if (android.os.Build.VERSION.SDK_INT >= 14) {
|
if (android.os.Build.VERSION.SDK_INT >= 14) {
|
||||||
//Scale web view font size with system font size
|
//Scale web view font size with system font size
|
||||||
settings.setTextZoom((int) (ctx.getResources().getDisplayMetrics().density * 100f));
|
settings.setTextZoom((int) (ctx.getResources().getDisplayMetrics().density * 100f));
|
||||||
|
} else {
|
||||||
|
if (ctx.getResources().getDisplayMetrics().density <= 0.5f) {
|
||||||
|
settings.setTextSize(settings.TextSize.SMALLEST);
|
||||||
|
} else if (ctx.getResources().getDisplayMetrics().density <= 0.75f) {
|
||||||
|
settings.setTextSize(settings.TextSize.SMALLER);
|
||||||
|
} else if (ctx.getResources().getDisplayMetrics().density <= 1.0f) {
|
||||||
|
settings.setTextSize(settings.TextSize.NORMAL);
|
||||||
|
} else if (ctx.getResources().getDisplayMetrics().density <= 1.5f) {
|
||||||
|
settings.setTextSize(settings.TextSize.LARGER);
|
||||||
|
} else {
|
||||||
|
settings.setTextSize(settings.TextSize.LARGEST);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wv.loadDataWithBaseURL(null, content, "text/html", "UTF-8", null);
|
wv.loadDataWithBaseURL(null, content, "text/html", "UTF-8", null);
|
||||||
|
|
|
@ -108,6 +108,18 @@ public class ContextMenuHelper {
|
||||||
if (android.os.Build.VERSION.SDK_INT >= 14) {
|
if (android.os.Build.VERSION.SDK_INT >= 14) {
|
||||||
//Scale web view font size with system font size
|
//Scale web view font size with system font size
|
||||||
settings.setTextZoom((int) (ctx.getResources().getDisplayMetrics().density * 100f));
|
settings.setTextZoom((int) (ctx.getResources().getDisplayMetrics().density * 100f));
|
||||||
|
} else {
|
||||||
|
if (ctx.getResources().getDisplayMetrics().density <= 0.5f) {
|
||||||
|
settings.setTextSize(settings.TextSize.SMALLEST);
|
||||||
|
} else if (ctx.getResources().getDisplayMetrics().density <= 0.75f) {
|
||||||
|
settings.setTextSize(settings.TextSize.SMALLER);
|
||||||
|
} else if (ctx.getResources().getDisplayMetrics().density <= 1.0f) {
|
||||||
|
settings.setTextSize(settings.TextSize.NORMAL);
|
||||||
|
} else if (ctx.getResources().getDisplayMetrics().density <= 1.5f) {
|
||||||
|
settings.setTextSize(settings.TextSize.LARGER);
|
||||||
|
} else {
|
||||||
|
settings.setTextSize(settings.TextSize.LARGEST);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wv.loadDataWithBaseURL(null, content, "text/html", "UTF-8", null);
|
wv.loadDataWithBaseURL(null, content, "text/html", "UTF-8", null);
|
||||||
|
|
Loading…
Reference in a new issue