Fix bugs with navigation menu & with banner image

This commit is contained in:
Victor Shcherb 2018-05-16 16:07:44 +02:00
parent 0c403d8a32
commit 18a8449fd8

View file

@ -2,6 +2,7 @@ package net.osmand.plus.wikivoyage.data;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.net.URLEncoder;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
@ -111,6 +112,11 @@ public class TravelArticle {
System.err.println(e.getMessage()); System.err.println(e.getMessage());
} }
String[] hash = getHash(imageTitle); String[] hash = getHash(imageTitle);
try {
imageTitle = URLEncoder.encode(imageTitle, "UTF-8");
} catch (UnsupportedEncodingException e) {
System.err.println(e.getMessage());
}
String prefix = thumbnail ? THUMB_PREFIX : REGULAR_PREFIX; String prefix = thumbnail ? THUMB_PREFIX : REGULAR_PREFIX;
return IMAGE_ROOT_URL + "thumb/" + hash[0] + "/" + hash[1] + "/" + imageTitle + "/" + prefix + imageTitle; return IMAGE_ROOT_URL + "thumb/" + hash[0] + "/" + hash[1] + "/" + imageTitle + "/" + prefix + imageTitle;
} }