Don't show wiki in free version
This commit is contained in:
parent
7f459e6b86
commit
18a3179df9
1 changed files with 5 additions and 0 deletions
|
@ -9,6 +9,7 @@ import java.util.TreeMap;
|
||||||
|
|
||||||
import net.osmand.plus.ClientContext;
|
import net.osmand.plus.ClientContext;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
|
import net.osmand.plus.Version;
|
||||||
|
|
||||||
public class IndexItemCategory implements Comparable<IndexItemCategory> {
|
public class IndexItemCategory implements Comparable<IndexItemCategory> {
|
||||||
public final String name;
|
public final String name;
|
||||||
|
@ -26,6 +27,7 @@ public class IndexItemCategory implements Comparable<IndexItemCategory> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<IndexItemCategory> categorizeIndexItems(ClientContext ctx, Collection<IndexItem> indexItems) {
|
public static List<IndexItemCategory> categorizeIndexItems(ClientContext ctx, Collection<IndexItem> indexItems) {
|
||||||
|
boolean skipWiki = Version.isFreeVersion(ctx);
|
||||||
final Map<String, IndexItemCategory> cats = new TreeMap<String, IndexItemCategory>();
|
final Map<String, IndexItemCategory> cats = new TreeMap<String, IndexItemCategory>();
|
||||||
for (IndexItem i : indexItems) {
|
for (IndexItem i : indexItems) {
|
||||||
int nameId = R.string.index_name_other;
|
int nameId = R.string.index_name_other;
|
||||||
|
@ -76,6 +78,9 @@ public class IndexItemCategory implements Comparable<IndexItemCategory> {
|
||||||
nameId = R.string.index_name_oceania;
|
nameId = R.string.index_name_oceania;
|
||||||
order = 70;
|
order = 70;
|
||||||
} else if (lc.contains("_wiki_")) {
|
} else if (lc.contains("_wiki_")) {
|
||||||
|
if(skipWiki) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
nameId = R.string.index_name_wiki;
|
nameId = R.string.index_name_wiki;
|
||||||
order = 10;
|
order = 10;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue