Merge pull request #5339 from osmandapp/WikipediaImprovements

Wikipedia improvements
This commit is contained in:
Alexander Sytnyk 2018-05-03 16:23:08 +03:00 committed by GitHub
commit 6df34a36f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -29,6 +29,7 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:textSize="@dimen/dialog_header_text_size" android:textSize="@dimen/dialog_header_text_size"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1"
osmand:typeface="@string/font_roboto_medium" osmand:typeface="@string/font_roboto_medium"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"/> android:layout_weight="1"/>

View file

@ -26,13 +26,17 @@ import android.webkit.WebView;
import android.widget.TextView; import android.widget.TextView;
import net.osmand.AndroidUtils; import net.osmand.AndroidUtils;
import net.osmand.IndexConstants;
import net.osmand.data.Amenity; import net.osmand.data.Amenity;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.OsmandSettings; import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.development.OsmandDevelopmentPlugin;
import net.osmand.plus.helpers.FileNameTranslationHelper; import net.osmand.plus.helpers.FileNameTranslationHelper;
import net.osmand.util.Algorithms; import net.osmand.util.Algorithms;
import java.io.File;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@ -117,6 +121,9 @@ public class WikipediaDialogFragment extends WikiArticleBaseDialogFragment {
sb.append("<h1>").append(title).append("</h1>"); sb.append("<h1>").append(title).append("</h1>");
sb.append(article); sb.append(article);
sb.append(FOOTER_INNER); sb.append(FOOTER_INNER);
if (OsmandPlugin.getEnabledPlugin(OsmandDevelopmentPlugin.class) != null) {
writeOutHTML(sb, new File(getMyApplication().getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR), "page.html"));
}
return sb.toString(); return sb.toString();
} }