Update free version
This commit is contained in:
parent
56aaffd57f
commit
1b8126fdca
3 changed files with 10 additions and 4 deletions
|
@ -10,6 +10,7 @@ public class Version {
|
|||
|
||||
private final String appVersion;
|
||||
private final String appName;
|
||||
private final static String FREE_VERSION_NAME = "net.osmand";
|
||||
|
||||
private Version(Context ctx) {
|
||||
appVersion = ctx.getString(R.string.app_version);
|
||||
|
@ -52,6 +53,11 @@ public class Version {
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean isFreeVersion(Context ctx){
|
||||
return ctx.getPackageName().equals(FREE_VERSION_NAME);
|
||||
|
||||
}
|
||||
|
||||
public static String getVersionForTracker(Context ctx) {
|
||||
String v = Version.getAppName(ctx);
|
||||
if(Version.isProductionVersion(ctx)){
|
||||
|
|
|
@ -508,7 +508,7 @@ public class ResourceManager {
|
|||
progress.startTask(context.getString(R.string.indexing_map) + " " + f.getName(), -1); //$NON-NLS-1$
|
||||
try {
|
||||
BinaryMapIndexReader index = renderer.initializeNewResource(progress, f);
|
||||
if (index == null) {
|
||||
if (index == null || (Version.isFreeVersion(context) && f.getName().contains("_wiki"))) {
|
||||
warnings.add(MessageFormat.format(context.getString(R.string.version_index_is_not_supported), f.getName())); //$NON-NLS-1$
|
||||
} else {
|
||||
if(index.isBasemap()) {
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.util.TreeSet;
|
|||
|
||||
import net.osmand.Algoritms;
|
||||
import net.osmand.IProgress;
|
||||
import net.osmand.Version;
|
||||
import net.osmand.access.AccessibleToast;
|
||||
import net.osmand.data.IndexConstants;
|
||||
import net.osmand.plus.DownloadOsmandIndexesHelper;
|
||||
|
@ -89,7 +90,6 @@ public class DownloadIndexActivity extends OsmandExpandableListActivity {
|
|||
private Map<String, String> indexActivatedFileNames = null;
|
||||
private TreeMap<String, DownloadEntry> entriesToDownload = new TreeMap<String, DownloadEntry>();
|
||||
|
||||
private String FREE_VERSION_NAME = "net.osmand";
|
||||
private int MAXIMUM_AVAILABLE_FREE_DOWNLOADS = 8;
|
||||
|
||||
|
||||
|
@ -158,7 +158,7 @@ public class DownloadIndexActivity extends OsmandExpandableListActivity {
|
|||
} else {
|
||||
downloadIndexList();
|
||||
}
|
||||
if(getPackageName().equals(FREE_VERSION_NAME) && settings.checkFreeDownloadsNumberZero()){
|
||||
if(Version.isFreeVersion(this) && settings.checkFreeDownloadsNumberZero()){
|
||||
Builder msg = new AlertDialog.Builder(this);
|
||||
msg.setTitle(R.string.free_version_title);
|
||||
msg.setMessage(getString(R.string.free_version_message, MAXIMUM_AVAILABLE_FREE_DOWNLOADS+"", ""));
|
||||
|
@ -449,7 +449,7 @@ public class DownloadIndexActivity extends OsmandExpandableListActivity {
|
|||
}
|
||||
|
||||
protected void downloadFilesCheckFreeVersion() {
|
||||
if (getPackageName().equals(FREE_VERSION_NAME)) {
|
||||
if (Version.isFreeVersion(this)) {
|
||||
int total = settings.NUMBER_OF_FREE_DOWNLOADS.get() + entriesToDownload.size();
|
||||
boolean wiki = false;
|
||||
for (DownloadEntry es : entriesToDownload.values()) {
|
||||
|
|
Loading…
Reference in a new issue