From bf6d67010594ac9c8ab5d6305a22c1a7b2876f9a Mon Sep 17 00:00:00 2001 From: Chumva Date: Mon, 7 May 2018 18:47:39 +0300 Subject: [PATCH] added support for right to left layouts --- .../plus/wikipedia/WikipediaDialogFragment.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaDialogFragment.java b/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaDialogFragment.java index d224c0ced4..fc7a4b6382 100644 --- a/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaDialogFragment.java @@ -38,7 +38,9 @@ import net.osmand.plus.helpers.FileNameTranslationHelper; import net.osmand.util.Algorithms; import java.io.File; +import java.util.Arrays; import java.util.HashMap; +import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.TreeSet; @@ -54,6 +56,7 @@ public class WikipediaDialogFragment extends WikiArticleBaseDialogFragment { private String lang; private String title; private String article; + private String langSelected; public void setAmenity(Amenity amenity) { this.amenity = amenity; @@ -131,6 +134,10 @@ public class WikipediaDialogFragment extends WikiArticleBaseDialogFragment { @NonNull protected String createHtmlContent() { StringBuilder sb = new StringBuilder(HEADER_INNER); + String[] rtlLanguages = new String[]{"ar", "dv", "he", "iw", "fa", "nqo", "ps", "sd", "ug", "ur", "yi"}; + Set rtls = new HashSet<>(Arrays.asList(rtlLanguages)); + String bodyTag = rtls.contains(langSelected) ? "\n" : "\n"; + sb.append(bodyTag); String nightModeClass = nightMode ? " nightmode" : ""; sb.append("