This commit is contained in:
GaidamakUA 2015-10-06 15:24:24 +03:00
commit 16348e1343
16 changed files with 129 additions and 41 deletions

View file

@ -2072,4 +2072,28 @@ s často kladenými otázkami.</string>
<string name="address_unknown">Adresa ještě není známa</string>
<string name="are_you_sure">Jste si jisti?</string>
<string name="unsaved_changes_will_be_lost">Neuložené změny budou ztraceny. Pokračovat?</string>
</resources>
<string name="srtm_plugin_disabled">Vrstevnice vypnuté</string>
<string name="favorite_category_add_new">Přidat nový</string>
<string name="favorite_category_select">Zvolte kategorii</string>
<string name="default_speed_system_descr">Zvolte způsob měření rychlosti</string>
<string name="default_speed_system">Měření rychlosti</string>
<string name="nm">nm</string>
<string name="si_nm">Námořní míle</string>
<string name="si_kmh">Kilometry za hodinu</string>
<string name="si_mph">Míle za hodinu</string>
<string name="si_m_s">Metrů za sekundu</string>
<string name="si_min_km">Minut za kilometr</string>
<string name="si_min_m">Minut za míli</string>
<string name="si_nm_h">Námořní míle za hodinu (uzly)</string>
<string name="nm_h">nm/h</string>
<string name="min_mile">min/m</string>
<string name="min_km">min/km</string>
<string name="m_s">m/s</string>
<string name="shared_string_trip_recording">Záznam cesty</string>
<string name="shared_string_navigation">Navigace</string>
<string name="osmand_running_in_background">Běh na pozadí</string>
<string name="favourites_edit_dialog_title">Informace o oblíbeném bodu</string>
<string name="simulate_your_location_stop_descr">Ukončit simulaci vaší polohy</string>
<string name="simulate_your_location_descr">Simulovat pomocí zaznamenané GPX nebo vypočítané trasy</string>
</resources>

View file

@ -1794,4 +1794,27 @@
<string name="poi_resource_zinc">Zink</string>
<string name="poi_resource_zircon">Zirkon</string>
<string name="poi_wetland_wet_meadow">Vådområde</string>
<string name="poi_wetland_bog">Mose</string>
<string name="poi_wetland_marsh">Marsk</string>
<string name="poi_wetland_reedbed">Siv</string>
<string name="poi_wetland_swamp">Sump</string>
<string name="poi_wetland_saltern">Saltsyderiet</string>
<string name="poi_wetland_tidalflat">Vade</string>
<string name="poi_wetland_saltmarsh">Strandeng</string>
<string name="poi_wetland_mangrove">Mangrove</string>
<string name="poi_wetland_string_bog">Højmose</string>
<string name="poi_wetland_fen">Lavmose</string>
<string name="poi_wetland_palsa_bog">Pals</string>
<string name="poi_wetland_mud">Mudder</string>
<string name="poi_beach_sand">Strandtype: sand</string>
<string name="poi_beach_shingle">Strandtype: rullesten</string>
<string name="poi_beach_rocky">Strandtype: stenet</string>
<string name="poi_chimney">Skorsten</string>
<string name="poi_palm">Palme</string>
<string name="poi_cypress">Cypres</string>
<string name="poi_flagpole">Flagstang</string>
</resources>

View file

@ -2165,4 +2165,6 @@
<string name="show_free_version_banner">Vis banner for gratis version</string>
<string name="show_free_version_banner_description">"Selvom du har en betalt version kan du stadig se banner for den gratis version"</string>
<string name="downloading_number_of_files">Henter - %1$d fil</string>
<string name="buy">KØB</string>
<string name="hillshade_layer_disabled">Relieflag deaktiveret</string>
</resources>

View file

@ -2209,4 +2209,6 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz
<string name="show_free_version_banner">Mostra il banner della versione gratuita</string>
<string name="show_free_version_banner_description">Anche se hai la versione a pagamento puoi comunque vedere il banner della versione gratuita</string>
<string name="downloading_number_of_files">In download - %1$d file</string>
</resources>
<string name="hillshade_layer_disabled">Livello Ombreggiatura rilievi disabilitato</string>
<string name="buy">ACQUISTA</string>
</resources>

View file

@ -1632,5 +1632,15 @@
<string name="poi_second_hand_no">無二手商品</string>
<string name="poi_second_hand_only">只有二手商品</string>
<string name="poi_service_parts">零件</string>
<string name="poi_service_parts">零配件</string>
<string name="poi_service_dealer">經銷商</string>
<string name="poi_service_repair">維修</string>
<string name="poi_service_repair_no">無維修</string>
<string name="poi_service_electrical">電動車維修</string>
<string name="poi_motorcycle_repair">機車維修</string>
<string name="poi_self_service_yes">自助服務</string>
<string name="poi_self_service_no">無自助服務</string>
<string name="poi_automated_yes">自動化</string>
<string name="poi_automated_no">無自動化</string>
<string name="poi_full_service_yes">全方位服務</string>
</resources>

View file

@ -2144,4 +2144,5 @@
<string name="show_free_version_banner">顯示免費版標題</string>
<string name="show_free_version_banner_description">即使您已是付費版本,您仍然可以看到免費版本的標題</string>
<string name="downloading_number_of_files">正在下載 - %1$d 檔案</string>
</resources>
<string name="buy">購買</string>
</resources>

View file

@ -9,6 +9,7 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
<string name="hillshade_layer_disabled">Hillshade layer disabled</string>
<string name="srtm_plugin_disabled">Contour lines disabled</string>
<string name="favorite_category_add_new">Add new</string>
<string name="favorite_category_select">Select category</string>

View file

@ -105,7 +105,7 @@ public class WorldRegion implements Serializable {
}
public void initWorld() {
regionId = null;
regionId = "";
downloadsIdPrefix = "world_";
name = null;
superregion = null;
@ -284,11 +284,11 @@ public class WorldRegion implements Serializable {
}
public WorldRegion getRegionById(String regionId) {
if (regionId == null) {
if (regionId.length() == 0) {
return this;
} else {
for (WorldRegion region : flattenedSubregions) {
if (region.getRegionId().equals(regionId)) {
if (region != null && region.getRegionId().equals(regionId)) {
return region;
}
}

View file

@ -124,12 +124,7 @@ public class BaseDownloadActivity extends ActionBarProgressActivity {
}
public ItemsListBuilder getItemsBuilder() {
if (downloadListIndexThread.isDataPrepared()) {
return new ItemsListBuilder(getMyApplication(), null, downloadListIndexThread.getResourcesByRegions(),
downloadListIndexThread.getVoiceRecItems(), downloadListIndexThread.getVoiceTTSItems());
} else {
return null;
}
return getItemsBuilder("");
}
public ItemsListBuilder getItemsBuilder(String regionId) {

View file

@ -30,35 +30,41 @@ public class DownloadActivityType implements Parcelable {
private static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd.MM.yyyy");
private static Map<String, DownloadActivityType> byTag = new HashMap<>();
public static final DownloadActivityType NORMAL_FILE = new DownloadActivityType(R.string.download_regular_maps, "map");
public static final DownloadActivityType NORMAL_FILE =
new DownloadActivityType(R.string.download_regular_maps, "map", 10);
public static final DownloadActivityType VOICE_FILE =
new DownloadActivityType(R.string.voices, R.drawable.ic_action_volume_up, "voice");
public static final DownloadActivityType ROADS_FILE = new DownloadActivityType(R.string.download_roads_only_maps, "road_map");
new DownloadActivityType(R.string.voices, R.drawable.ic_action_volume_up, "voice", 20);
public static final DownloadActivityType ROADS_FILE =
new DownloadActivityType(R.string.download_roads_only_maps, "road_map", 30);
public static final DownloadActivityType SRTM_COUNTRY_FILE =
new DownloadActivityType(R.string.download_srtm_maps,
R.drawable.ic_plugin_srtm, "srtm_map");
R.drawable.ic_plugin_srtm, "srtm_map", 40);
public static final DownloadActivityType HILLSHADE_FILE =
new DownloadActivityType(R.string.download_hillshade_maps,
R.drawable.ic_action_hillshade_dark, "hillshade");
R.drawable.ic_action_hillshade_dark, "hillshade", 50);
public static final DownloadActivityType WIKIPEDIA_FILE =
new DownloadActivityType(R.string.download_wikipedia_maps,
R.drawable.ic_world_globe_dark, "wikimap");
public static final DownloadActivityType LIVE_UPDATES_FILE = new DownloadActivityType(R.string.download_live_updates, "live_updates");
R.drawable.ic_world_globe_dark, "wikimap", 60);
public static final DownloadActivityType LIVE_UPDATES_FILE =
new DownloadActivityType(R.string.download_live_updates, "live_updates", 70);
private final int stringResource;
private final int iconResource;
private String tag;
private int orderIndex;
public DownloadActivityType(int stringResource, int iconResource, String tag) {
public DownloadActivityType(int stringResource, int iconResource, String tag, int orderIndex) {
this.stringResource = stringResource;
this.tag = tag;
this.orderIndex = orderIndex;
byTag.put(tag, this);
this.iconResource = iconResource;
}
public DownloadActivityType(int stringResource, String tag) {
public DownloadActivityType(int stringResource, String tag, int orderIndex) {
this.stringResource = stringResource;
this.tag = tag;
this.orderIndex = orderIndex;
byTag.put(tag, this);
iconResource = R.drawable.ic_map;
}
@ -75,6 +81,9 @@ public class DownloadActivityType implements Parcelable {
return tag;
}
public int getOrderIndex() {
return orderIndex;
}
public static boolean isCountedInDownloads(IndexItem es) {
DownloadActivityType tp = es.getType();

View file

@ -38,7 +38,7 @@ public class IndexItem implements Comparable<IndexItem>, HasName, Parcelable {
public IndexItem(String fileName, String description, long timestamp, String size, long contentSize,
long containerSize, DownloadActivityType tp) {
this.fileName = fileName;
this.simplifiedFileName = fileName.toLowerCase().replace("_2.", ".");
this.simplifiedFileName = fileName.toLowerCase().replace("_2.", ".").replace("hillshade_", "");
this.description = description;
this.timestamp = timestamp;
this.size = size;

View file

@ -90,8 +90,13 @@ public class ItemViewHolder {
rightButtonAction = RightButtonAction.ASK_FOR_SEAMARKS_PLUGIN;
disabled = true;
}
if (indexItem.getType() == DownloadActivityType.SRTM_COUNTRY_FILE && srtmDisabled) {
nameTextView.setText(context.getString(R.string.srtm_plugin_disabled));
if ((indexItem.getType() == DownloadActivityType.SRTM_COUNTRY_FILE ||
indexItem.getType() == DownloadActivityType.HILLSHADE_FILE) && srtmDisabled) {
if (indexItem.getType() == DownloadActivityType.SRTM_COUNTRY_FILE) {
nameTextView.setText(context.getString(R.string.srtm_plugin_disabled));
} else {
nameTextView.setText(context.getString(R.string.hillshade_layer_disabled));
}
OsmandPlugin srtmPlugin = OsmandPlugin.getPlugin(SRTMPlugin.class);
if (srtmPlugin == null || srtmPlugin.needsInstallation()) {
rightButtonAction = RightButtonAction.ASK_FOR_SRTM_PLUGIN_PURCHASE;
@ -110,7 +115,8 @@ public class ItemViewHolder {
}
}
if (!showTypeInTitle && indexItem.getType() == DownloadActivityType.SRTM_COUNTRY_FILE && srtmDisabled) {
if (!showTypeInTitle && (indexItem.getType() == DownloadActivityType.SRTM_COUNTRY_FILE ||
indexItem.getType() == DownloadActivityType.HILLSHADE_FILE) && srtmDisabled) {
descrTextView.setText(indexItem.getType().getString(context));
} else if (showTypeInDesc) {
descrTextView.setText(indexItem.getType().getString(context) + "" + indexItem.getSizeDescription(context));

View file

@ -1,6 +1,8 @@
package net.osmand.plus.download.items;
import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
import net.osmand.PlatformUtil;
import net.osmand.map.OsmandRegions;
@ -13,6 +15,7 @@ import net.osmand.plus.download.IndexItem;
import net.osmand.plus.srtmplugin.SRTMPlugin;
import net.osmand.util.Algorithms;
import java.io.Serializable;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
@ -76,14 +79,14 @@ public class ItemsListBuilder {
str1 = ((WorldRegion) obj1).getName();
} else {
ResourceItem item = (ResourceItem) obj1;
str1 = item.title + item.getIndexItem().getType().getTag();
str1 = item.title + item.getIndexItem().getType().getOrderIndex();
}
if (obj2 instanceof WorldRegion) {
str2 = ((WorldRegion) obj2).getName();
} else {
ResourceItem item = (ResourceItem) obj2;
str2 = item.title + item.getIndexItem().getType().getTag();
str2 = item.title + item.getIndexItem().getType().getOrderIndex();
}
return str1.compareTo(str2);
@ -91,8 +94,9 @@ public class ItemsListBuilder {
}
public enum VoicePromptsType {
NONE,
RECORDED,
TTS
TTS;
}
private static final org.apache.commons.logging.Log LOG = PlatformUtil.getLog(ItemsListBuilder.class);
@ -106,6 +110,7 @@ public class ItemsListBuilder {
private boolean srtmDisabled;
private boolean hasSrtm;
private boolean hasHillshade;
public List<ResourceItem> getRegionMapItems() {
return regionMapItems;
@ -190,6 +195,7 @@ public class ItemsListBuilder {
private void collectSubregionsDataAndItems() {
srtmDisabled = OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) == null;
hasSrtm = false;
hasHillshade = false;
// Collect all regions (and their parents) that have at least one
// resource available in repository or locally.
@ -230,11 +236,19 @@ public class ItemsListBuilder {
resItem.setTitle(name);
if (region != this.region && srtmDisabled) {
if (hasSrtm && indexItem.getType() == DownloadActivityType.SRTM_COUNTRY_FILE)
continue;
if (!hasSrtm && indexItem.getType() == DownloadActivityType.SRTM_COUNTRY_FILE)
hasSrtm = true;
if (indexItem.getType() == DownloadActivityType.SRTM_COUNTRY_FILE) {
if (hasSrtm) {
continue;
} else {
hasSrtm = true;
}
} else if (indexItem.getType() == DownloadActivityType.HILLSHADE_FILE) {
if (hasHillshade) {
continue;
} else {
hasHillshade = true;
}
}
}

View file

@ -45,6 +45,8 @@ public class RegionDialogFragment extends DialogFragment {
if (regionId == null) {
regionId = getArguments().getString(REGION_ID_DLG_KEY);
}
if (regionId == null)
regionId = "";
Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
toolbar.setNavigationIcon(getMyApplication().getIconsCache().getIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha));
@ -55,7 +57,7 @@ public class RegionDialogFragment extends DialogFragment {
}
});
if (regionId != null) {
if (regionId.length() > 0) {
Fragment fragment = getChildFragmentManager().findFragmentById(R.id.fragmentContainer);
if (fragment == null) {
getChildFragmentManager().beginTransaction().add(R.id.fragmentContainer,

View file

@ -64,12 +64,15 @@ public class RegionItemsFragment extends OsmandExpandableListFragment {
regionId = getArguments().getString(REGION_ID_KEY);
}
if (regionId == null)
regionId = "";
ExpandableListView listView = (ExpandableListView) view.findViewById(android.R.id.list);
listAdapter = new RegionsItemsAdapter(getActivity());
listView.setAdapter(listAdapter);
setListView(listView);
if (regionId != null) {
if (regionId.length() > 0) {
ItemsListBuilder builder = getDownloadActivity().getItemsBuilder(regionId);
if (builder != null && builder.build()) {
fillRegionItemsAdapter(builder);

View file

@ -1,4 +0,0 @@
package net.osmand.plus.download.items;
public class VoiceItemsFragment {
}