diff --git a/OsmAnd/res/layout/selected_track_edit.xml b/OsmAnd/res/layout/selected_track_edit.xml
index 3c173939de..024fa4e2a7 100644
--- a/OsmAnd/res/layout/selected_track_edit.xml
+++ b/OsmAnd/res/layout/selected_track_edit.xml
@@ -6,34 +6,42 @@
android:paddingRight="7dp"
android:stretchColumns="1">
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/OsmAnd/res/layout/spinner_dropdown_item.xml b/OsmAnd/res/layout/spinner_dropdown_item.xml
index 12957bbd3f..c77dabdf03 100644
--- a/OsmAnd/res/layout/spinner_dropdown_item.xml
+++ b/OsmAnd/res/layout/spinner_dropdown_item.xml
@@ -4,7 +4,7 @@
android:singleLine="true"
android:background="?attr/expandable_list_background"
android:textSize="@dimen/default_list_text_size"
- android:layout_width="wrap_content"
+ android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:ellipsize="marquee"/>
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java b/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java
index 0f986adacb..4b07d1f373 100644
--- a/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java
+++ b/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java
@@ -372,8 +372,8 @@ public class GpxSelectionHelper {
return sf;
}
- public SelectedGpxFile selectGpxFile(GPXFile gpx, boolean show, boolean showNavigationDialog) {
- SelectedGpxFile sf = selectGpxFileImpl(gpx, show, showNavigationDialog);
+ public SelectedGpxFile selectGpxFile(GPXFile gpx, boolean show, boolean notShowNavigationDialog) {
+ SelectedGpxFile sf = selectGpxFileImpl(gpx, show, notShowNavigationDialog);
saveCurrentSelections();
return sf;
}
diff --git a/OsmAnd/src/net/osmand/plus/download/BaseDownloadActivity.java b/OsmAnd/src/net/osmand/plus/download/BaseDownloadActivity.java
index 82867ab5de..8eb99cfae4 100644
--- a/OsmAnd/src/net/osmand/plus/download/BaseDownloadActivity.java
+++ b/OsmAnd/src/net/osmand/plus/download/BaseDownloadActivity.java
@@ -201,7 +201,7 @@ public class BaseDownloadActivity extends ActionBarProgressActivity {
builder.setNegativeButton(R.string.shared_string_no, null);
builder.show();
} else {
- AccessibleToast.makeText(this, R.string.no_internet_connection, Toast.LENGTH_LONG).show();
+ AccessibleToast.makeText(this, R.string.no_index_file_to_download, Toast.LENGTH_LONG).show();
}
} else {
downloadFilesPreCheckSpace();
diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java
index 17ed5a8fdf..7d9d957b99 100644
--- a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java
+++ b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java
@@ -14,6 +14,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
+
import net.osmand.IndexConstants;
import net.osmand.PlatformUtil;
import net.osmand.access.AccessibleToast;
@@ -26,7 +27,9 @@ import net.osmand.plus.download.DownloadFileHelper.DownloadFileShowWarning;
import net.osmand.plus.helpers.DatabaseHelper;
import net.osmand.plus.resources.ResourceManager;
import net.osmand.util.Algorithms;
+
import org.apache.commons.logging.Log;
+
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.ActivityNotFoundException;
@@ -125,7 +128,9 @@ public class DownloadIndexesThread {
return indexFiles != null && indexFiles.isDownloadedFromInternet();
}
- public List getItemsToUpdate() { return itemsToUpdate;}
+ public List getItemsToUpdate() {
+ return itemsToUpdate;
+ }
public class DownloadIndexesAsyncTask extends BasicProgressAsyncTask implements DownloadFileShowWarning {
diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadOsmandIndexesHelper.java b/OsmAnd/src/net/osmand/plus/download/DownloadOsmandIndexesHelper.java
index 1a05a7ba98..6a8e074d7c 100644
--- a/OsmAnd/src/net/osmand/plus/download/DownloadOsmandIndexesHelper.java
+++ b/OsmAnd/src/net/osmand/plus/download/DownloadOsmandIndexesHelper.java
@@ -3,7 +3,6 @@ package net.osmand.plus.download;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
-import java.net.URL;
import java.net.URLConnection;
import java.util.HashMap;
import java.util.List;
diff --git a/OsmAnd/src/net/osmand/plus/download/UpdatesIndexFragment.java b/OsmAnd/src/net/osmand/plus/download/UpdatesIndexFragment.java
index 57a2fa15e5..39eea32936 100644
--- a/OsmAnd/src/net/osmand/plus/download/UpdatesIndexFragment.java
+++ b/OsmAnd/src/net/osmand/plus/download/UpdatesIndexFragment.java
@@ -1,5 +1,17 @@
package net.osmand.plus.download;
+import java.text.MessageFormat;
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import net.osmand.access.AccessibleToast;
+import net.osmand.map.OsmandRegions;
+import net.osmand.plus.OsmandApplication;
+import net.osmand.plus.R;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
@@ -18,19 +30,6 @@ import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
-import net.osmand.access.AccessibleToast;
-import net.osmand.map.OsmandRegions;
-import net.osmand.plus.OsmandApplication;
-import net.osmand.plus.R;
-
-import java.text.MessageFormat;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
/**
* Created by Denis
* on 09.09.2014.
@@ -105,7 +104,11 @@ public class UpdatesIndexFragment extends ListFragment {
updateHeader();
if (indexItems.size() == 0) {
indexItems.clear();
- indexItems.add(new IndexItem(getString(R.string.everything_up_to_date), "", 0, "", 0, 0, null));
+ if (DownloadActivity.downloadListIndexThread.isDownloadedFromInternet()) {
+ indexItems.add(new IndexItem(getString(R.string.everything_up_to_date), "", 0, "", 0, 0, null));
+ } else {
+ indexItems.add(new IndexItem(getString(R.string.no_index_file_to_download), "", 0, "", 0, 0, null));
+ }
}
listAdapter = new UpdateIndexAdapter(getDownloadActivity(), R.layout.download_index_list_item, indexItems);
listAdapter.sort(new Comparator() {
@@ -267,7 +270,8 @@ public class UpdatesIndexFragment extends ListFragment {
TextView updateDescr = (TextView) v.findViewById(R.id.update_descr);
final CheckBox ch = (CheckBox) v.findViewById(R.id.check_download_item);
IndexItem e = items.get(position);
- if (e.getFileName().equals(getString(R.string.everything_up_to_date))) {
+ if (e.getFileName().equals(getString(R.string.everything_up_to_date)) ||
+ e.getFileName().equals(getString(R.string.no_index_file_to_download))) {
name.setText(e.getFileName());
description.setText("");
ch.setVisibility(View.INVISIBLE);
@@ -288,7 +292,7 @@ public class UpdatesIndexFragment extends ListFragment {
Map indexActivatedFileNames = getMyApplication().getResourceManager().getIndexFileNames();
String dt = indexActivatedFileNames.get(sfName);
updateDescr.setText("");
- if(dt != null ) {
+ if (dt != null) {
try {
Date tm = format.parse(dt);
long days = Math.max(1, (e.getTimestamp() - tm.getTime()) / (24 * 60 * 60 * 1000) + 1);
diff --git a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java
index 1377661436..4f3a24b008 100644
--- a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java
+++ b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java
@@ -826,7 +826,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
checkItem.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- selectedGpxHelper.selectGpxFile(child.gpx, !isChecked, true);
+ selectedGpxHelper.selectGpxFile(child.gpx, !isChecked, false);
notifyDataSetChanged();
}
});
diff --git a/OsmAnd/src/net/osmand/plus/myplaces/SelectedGPXFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/SelectedGPXFragment.java
index be2ea9f808..e3972fe329 100644
--- a/OsmAnd/src/net/osmand/plus/myplaces/SelectedGPXFragment.java
+++ b/OsmAnd/src/net/osmand/plus/myplaces/SelectedGPXFragment.java
@@ -317,7 +317,7 @@ public class SelectedGPXFragment extends ListFragment {
@Override
public void onClick(DialogInterface dialog, int which) {
- SelectedGpxFile sf = app.getSelectedGpxHelper().selectGpxFile(groups.get(0).getGpx(), vis.isChecked(), true);
+ SelectedGpxFile sf = app.getSelectedGpxHelper().selectGpxFile(groups.get(0).getGpx(), vis.isChecked(), false);
if (groups.size() > 0) {
updateSplit(groups, distanceSplit, timeSplit, sp.getSelectedItemPosition(), vis.isChecked() ? sf
: null);