Don't show wiki in free version

This commit is contained in:
Victor Shcherb 2013-07-18 01:16:42 +02:00
parent 7f459e6b86
commit 18a3179df9

View file

@ -9,6 +9,7 @@ import java.util.TreeMap;
import net.osmand.plus.ClientContext;
import net.osmand.plus.R;
import net.osmand.plus.Version;
public class IndexItemCategory implements Comparable<IndexItemCategory> {
public final String name;
@ -26,6 +27,7 @@ public class IndexItemCategory implements Comparable<IndexItemCategory> {
}
public static List<IndexItemCategory> categorizeIndexItems(ClientContext ctx, Collection<IndexItem> indexItems) {
boolean skipWiki = Version.isFreeVersion(ctx);
final Map<String, IndexItemCategory> cats = new TreeMap<String, IndexItemCategory>();
for (IndexItem i : indexItems) {
int nameId = R.string.index_name_other;
@ -76,6 +78,9 @@ public class IndexItemCategory implements Comparable<IndexItemCategory> {
nameId = R.string.index_name_oceania;
order = 70;
} else if (lc.contains("_wiki_")) {
if(skipWiki) {
continue;
}
nameId = R.string.index_name_wiki;
order = 10;
}