This commit is contained in:
Vitaliy 2021-03-31 15:21:12 +03:00
parent f6212c216e
commit 80c807cc10

View file

@ -13,6 +13,9 @@ import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import net.osmand.AndroidUtils; import net.osmand.AndroidUtils;
import net.osmand.PlatformUtil; import net.osmand.PlatformUtil;
import net.osmand.data.Amenity; import net.osmand.data.Amenity;
@ -60,9 +63,6 @@ import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
public class AmenityMenuBuilder extends MenuBuilder { public class AmenityMenuBuilder extends MenuBuilder {
private static final String WIKI_LINK = ".wikipedia.org/w"; private static final String WIKI_LINK = ".wikipedia.org/w";
@ -346,7 +346,7 @@ public class AmenityMenuBuilder extends MenuBuilder {
boolean isWiki = false; boolean isWiki = false;
boolean isText = false; boolean isText = false;
boolean isDescription = false; boolean isDescription = false;
boolean needLinks = !("population".equals(key) || "height".equals(key)); boolean needLinks = !("population".equals(key) || "height".equals(key) || Amenity.OPENING_HOURS.equals(key));
boolean needIntFormatting = "population".equals(key); boolean needIntFormatting = "population".equals(key);
boolean isPhoneNumber = false; boolean isPhoneNumber = false;
boolean isUrl = false; boolean isUrl = false;
@ -371,7 +371,7 @@ public class AmenityMenuBuilder extends MenuBuilder {
if (vl.startsWith("http://") || vl.startsWith("https://") || vl.startsWith("HTTP://") || vl.startsWith("HTTPS://")) { if (vl.startsWith("http://") || vl.startsWith("https://") || vl.startsWith("HTTP://") || vl.startsWith("HTTPS://")) {
isUrl = true; isUrl = true;
} else { } else if (needLinks) {
socialMediaUrl = getSocialMediaUrl(key, vl); socialMediaUrl = getSocialMediaUrl(key, vl);
if (socialMediaUrl != null) { if (socialMediaUrl != null) {
isUrl = true; isUrl = true;