add srtmf map download option p1
This commit is contained in:
parent
b36d5a92d8
commit
684571ca34
5 changed files with 90 additions and 57 deletions
|
@ -60,6 +60,36 @@
|
|||
|
||||
</RelativeLayout>
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/additional_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/content_padding_small"
|
||||
android:letterSpacing="@dimen/description_letter_spacing"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="@dimen/content_padding"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingEnd="@dimen/content_padding"
|
||||
android:paddingRight="@dimen/content_padding"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
android:visibility="gone"
|
||||
app:typeface="@string/font_roboto_regular"
|
||||
tools:text="@string/srtm_download_list_help_message"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<include
|
||||
layout="@layout/custom_radio_buttons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/content_padding"
|
||||
android:layout_marginLeft="@dimen/content_padding"
|
||||
android:layout_marginEnd="@dimen/content_padding"
|
||||
android:layout_marginRight="@dimen/content_padding"
|
||||
android:layout_marginBottom="@dimen/content_padding_half"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/select_all_button"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -12,6 +12,10 @@
|
|||
|
||||
-->
|
||||
|
||||
<string name="srtm_download_single_help_message">Please select the needed format. You will need to re-download the file to change the format.</string>
|
||||
<string name="srtm_download_list_help_message">OsmAnd provides contour lines data in meters and feet. You will need to re-download the file to change the format.</string>
|
||||
<string name="srtm_unit_format">Contour lines unit format</string>
|
||||
<string name="shared_string_feets">feets</string>
|
||||
<string name="update_all_maps_added">Update all maps added to %1$s?</string>
|
||||
<string name="release_4_0_beta">
|
||||
• OsmAnd Live updates moved to \"Downloads > Updates\"\n\n
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package net.osmand.plus.resources;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import net.osmand.IndexConstants;
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.binary.BinaryMapIndexReader;
|
||||
|
@ -34,7 +32,6 @@ public class IncrementalChangesManager {
|
|||
private ResourceManager resourceManager;
|
||||
private final Map<String, RegionUpdateFiles> regions = new ConcurrentHashMap<String, IncrementalChangesManager.RegionUpdateFiles>();
|
||||
|
||||
|
||||
public IncrementalChangesManager(ResourceManager resourceManager) {
|
||||
this.resourceManager = resourceManager;
|
||||
}
|
||||
|
@ -48,7 +45,8 @@ public class IncrementalChangesManager {
|
|||
Set<String> existingFiles = new HashSet<String>();
|
||||
for (File f : files) {
|
||||
if (!f.getName().endsWith(IndexConstants.BINARY_WIKI_MAP_INDEX_EXT) &&
|
||||
!f.getName().endsWith(IndexConstants.BINARY_SRTM_MAP_INDEX_EXT)) {
|
||||
!f.getName().endsWith(IndexConstants.BINARY_SRTM_MAP_INDEX_EXT) &&
|
||||
!f.getName().endsWith(IndexConstants.BINARY_SRTM_FEET_MAP_INDEX_EXT)) {
|
||||
existingFiles.add(Algorithms.getFileNameWithoutExtension(f));
|
||||
}
|
||||
}
|
||||
|
@ -186,7 +184,6 @@ public class IncrementalChangesManager {
|
|||
public String errorMessage;
|
||||
public RegionUpdateFiles updateFiles;
|
||||
|
||||
|
||||
public boolean isPreferrableLimitForDayUpdates(String monthYearPart, List<IncrementalUpdate> dayUpdates) {
|
||||
List<RegionUpdate> lst = updateFiles.dayUpdates.get(monthYearPart);
|
||||
if (lst == null || lst.size() < 10) {
|
||||
|
@ -333,8 +330,6 @@ public class IncrementalChangesManager {
|
|||
return lst;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public IncrementalUpdateList getUpdatesByMonth(String fileName) {
|
||||
IncrementalUpdateList iul = new IncrementalUpdateList();
|
||||
RegionUpdateFiles ruf = regions.get(fileName.toLowerCase());
|
||||
|
|
|
@ -92,7 +92,8 @@ public class FileSettingsItem extends StreamSettingsItem {
|
|||
case OTHER:
|
||||
break;
|
||||
case SRTM_MAP:
|
||||
if (name.endsWith(IndexConstants.BINARY_SRTM_MAP_INDEX_EXT)) {
|
||||
if (name.endsWith(IndexConstants.BINARY_SRTM_MAP_INDEX_EXT)
|
||||
|| name.endsWith(IndexConstants.BINARY_SRTM_FEET_MAP_INDEX_EXT)) {
|
||||
return subtype;
|
||||
}
|
||||
break;
|
||||
|
@ -257,6 +258,8 @@ public class FileSettingsItem extends StreamSettingsItem {
|
|||
prefix = oldPath.substring(0, oldPath.lastIndexOf(IndexConstants.BINARY_WIKI_MAP_INDEX_EXT));
|
||||
} else if (oldPath.endsWith(IndexConstants.BINARY_SRTM_MAP_INDEX_EXT)) {
|
||||
prefix = oldPath.substring(0, oldPath.lastIndexOf(IndexConstants.BINARY_SRTM_MAP_INDEX_EXT));
|
||||
} else if (oldPath.endsWith(IndexConstants.BINARY_SRTM_FEET_MAP_INDEX_EXT)) {
|
||||
prefix = oldPath.substring(0, oldPath.lastIndexOf(IndexConstants.BINARY_SRTM_FEET_MAP_INDEX_EXT));
|
||||
} else if (oldPath.endsWith(IndexConstants.BINARY_ROAD_MAP_INDEX_EXT)) {
|
||||
prefix = oldPath.substring(0, oldPath.lastIndexOf(IndexConstants.BINARY_ROAD_MAP_INDEX_EXT));
|
||||
} else {
|
||||
|
|
|
@ -530,7 +530,8 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment {
|
|||
return getString(R.string.download_roads_only_item);
|
||||
} else if (file.getName().endsWith(IndexConstants.BINARY_WIKI_MAP_INDEX_EXT)) {
|
||||
return getString(R.string.download_wikipedia_maps);
|
||||
} else if (file.getName().endsWith(IndexConstants.BINARY_SRTM_MAP_INDEX_EXT)) {
|
||||
} else if (file.getName().endsWith(IndexConstants.BINARY_SRTM_MAP_INDEX_EXT)
|
||||
|| file.getName().endsWith(IndexConstants.BINARY_SRTM_FEET_MAP_INDEX_EXT)) {
|
||||
return getString(R.string.download_srtm_maps);
|
||||
} else if (file.getName().endsWith(IndexConstants.BINARY_MAP_INDEX_EXT)) {
|
||||
return getString(R.string.download_regular_maps);
|
||||
|
|
Loading…
Reference in a new issue