This commit is contained in:
GaidamakUA 2015-10-28 11:47:34 +02:00
commit f61b37fbcf
5 changed files with 49 additions and 13 deletions

View file

@ -1999,4 +1999,5 @@
<string name="map_downloaded_descr">Kort over %1$ s er hentet. Gå tilbage til kortet for at begynde at bruge det.</string> <string name="map_downloaded_descr">Kort over %1$ s er hentet. Gå tilbage til kortet for at begynde at bruge det.</string>
<string name="go_to_map">Gå til kortet</string> <string name="go_to_map">Gå til kortet</string>
<string name="shared_string_qr_code">QR kode</string> <string name="shared_string_qr_code">QR kode</string>
<string name="enter_country_name">Indtast landenavn</string>
</resources> </resources>

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources><string name="offline_edition">Modifications hors-ligne</string> <?xml version='1.0' encoding='utf-8'?>
<resources><string name="offline_edition">Modifications hors-ligne</string>
<string name="offline_edition_descr">Toujours utiliser l\'édition hors-ligne</string> <string name="offline_edition_descr">Toujours utiliser l\'édition hors-ligne</string>
<string name="update_poi_does_not_change_indexes">Les modifications de PI dans l\'application sont sans effet sur les cartes téléchargées, les modifications sont enregistrées dans un fichier.</string> <string name="update_poi_does_not_change_indexes">Les modifications de PI dans l\'application sont sans effet sur les cartes téléchargées, les modifications sont enregistrées dans un fichier.</string>
@ -2073,4 +2074,6 @@ Afghanistan, Albanie, Algérie, Allemagne, Andorre, Angola, Anguilla, Antigua-et
<string name="map_downloaded">Carte téléchargée</string> <string name="map_downloaded">Carte téléchargée</string>
<string name="go_to_map">Aller à la carte</string> <string name="go_to_map">Aller à la carte</string>
<string name="map_downloaded_descr">La carte %1$s a été téléchargée. Allez à la carte pour lutiliser.</string> <string name="map_downloaded_descr">La carte %1$s a été téléchargée. Allez à la carte pour lutiliser.</string>
<string name="shared_string_qr_code">QR-code</string>
<string name="enter_country_name">Saisissez le pays</string>
</resources> </resources>

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources><string name="screen_is_locked">För att låsa upp skärmen tryck på låsikonen</string> <?xml version='1.0' encoding='utf-8'?>
<resources><string name="screen_is_locked">För att låsa upp skärmen tryck på låsikonen</string>
<string name="ChooseCountry">Välj land</string> <string name="ChooseCountry">Välj land</string>
<string name="choose_city">Välj stad</string> <string name="choose_city">Välj stad</string>
<string name="choose_building">Välj byggnad</string> <string name="choose_building">Välj byggnad</string>
@ -1950,4 +1951,5 @@
<string name="map_downloaded">Karta hämtad</string> <string name="map_downloaded">Karta hämtad</string>
<string name="map_downloaded_descr">Karta över %1$s har hämtats. Gå tillbaka till kartan för att börja använda den.</string> <string name="map_downloaded_descr">Karta över %1$s har hämtats. Gå tillbaka till kartan för att börja använda den.</string>
<string name="go_to_map">Gå till kartan</string> <string name="go_to_map">Gå till kartan</string>
<string name="shared_string_qr_code">QR-kod</string>
</resources> </resources>

View file

@ -24,6 +24,7 @@ import net.osmand.access.AccessibleToast;
import net.osmand.map.WorldRegion; import net.osmand.map.WorldRegion;
import net.osmand.map.WorldRegion.RegionParams; import net.osmand.map.WorldRegion.RegionParams;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.OsmandSettings; import net.osmand.plus.OsmandSettings;
import net.osmand.plus.OsmandSettings.DrivingRegion; import net.osmand.plus.OsmandSettings.DrivingRegion;
import net.osmand.plus.OsmandSettings.MetricsConstants; import net.osmand.plus.OsmandSettings.MetricsConstants;
@ -41,6 +42,8 @@ import net.osmand.plus.download.ui.DownloadResourceGroupFragment;
import net.osmand.plus.download.ui.GoToMapFragment; import net.osmand.plus.download.ui.GoToMapFragment;
import net.osmand.plus.download.ui.LocalIndexesFragment; import net.osmand.plus.download.ui.LocalIndexesFragment;
import net.osmand.plus.download.ui.UpdatesIndexFragment; import net.osmand.plus.download.ui.UpdatesIndexFragment;
import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin;
import net.osmand.plus.srtmplugin.SRTMPlugin;
import net.osmand.plus.views.controls.PagerSlidingTabStrip; import net.osmand.plus.views.controls.PagerSlidingTabStrip;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
@ -85,6 +88,11 @@ public class DownloadActivity extends ActionBarProgressActivity implements Downl
private DownloadValidationManager downloadValidationManager; private DownloadValidationManager downloadValidationManager;
protected WorldRegion downloadItem; protected WorldRegion downloadItem;
private boolean srtmDisabled;
private boolean srtmNeedsInstallation;
private boolean nauticalPluginDisabled;
private boolean freeVersion;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
getMyApplication().applyTheme(this); getMyApplication().applyTheme(this);
@ -173,6 +181,7 @@ public class DownloadActivity extends ActionBarProgressActivity implements Downl
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
initAppStatusVariables();
getMyApplication().getAppCustomization().resumeActivity(DownloadActivity.class, this); getMyApplication().getAppCustomization().resumeActivity(DownloadActivity.class, this);
downloadThread.setUiActivity(this); downloadThread.setUiActivity(this);
downloadInProgress(); downloadInProgress();
@ -614,4 +623,29 @@ public class DownloadActivity extends ActionBarProgressActivity implements Downl
messageTextView.setText(R.string.device_memory); messageTextView.setText(R.string.device_memory);
} }
public boolean isSrtmDisabled() {
return srtmDisabled;
}
public boolean isSrtmNeedsInstallation() {
return srtmNeedsInstallation;
}
public boolean isNauticalPluginDisabled() {
return nauticalPluginDisabled;
}
public boolean isFreeVersion() {
return freeVersion;
}
public void initAppStatusVariables() {
srtmDisabled = OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) == null;
nauticalPluginDisabled = OsmandPlugin.getEnabledPlugin(NauticalMapsPlugin.class) == null;
freeVersion = Version.isFreeVersion(getMyApplication());
OsmandPlugin srtmPlugin = OsmandPlugin.getPlugin(SRTMPlugin.class);
srtmNeedsInstallation = srtmPlugin == null || srtmPlugin.needsInstallation();
}
} }

View file

@ -33,7 +33,6 @@ import net.osmand.plus.download.DownloadResources;
import net.osmand.plus.download.IndexItem; import net.osmand.plus.download.IndexItem;
import net.osmand.plus.download.ui.LocalIndexesFragment.LocalIndexOperationTask; import net.osmand.plus.download.ui.LocalIndexesFragment.LocalIndexOperationTask;
import net.osmand.plus.helpers.FileNameTranslationHelper; import net.osmand.plus.helpers.FileNameTranslationHelper;
import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin;
import net.osmand.plus.srtmplugin.SRTMPlugin; import net.osmand.plus.srtmplugin.SRTMPlugin;
import java.io.File; import java.io.File;
@ -121,14 +120,11 @@ public class ItemViewHolder {
this.showTypeInName = showTypeInName; this.showTypeInName = showTypeInName;
} }
// FIXME don't initialize on every row
private void initAppStatusVariables() { private void initAppStatusVariables() {
srtmDisabled = OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) == null; srtmDisabled = context.isSrtmDisabled();
nauticalPluginDisabled = OsmandPlugin.getEnabledPlugin(NauticalMapsPlugin.class) == null; nauticalPluginDisabled = context.isNauticalPluginDisabled();
freeVersion = Version.isFreeVersion(context.getMyApplication()); freeVersion = context.isFreeVersion();
OsmandPlugin srtmPlugin = OsmandPlugin.getPlugin(SRTMPlugin.class); srtmNeedsInstallation = context.isSrtmNeedsInstallation();
srtmNeedsInstallation = srtmPlugin == null || srtmPlugin.needsInstallation();
} }
public void bindIndexItem(final IndexItem indexItem, final DownloadResourceGroup parentOptional) { public void bindIndexItem(final IndexItem indexItem, final DownloadResourceGroup parentOptional) {