Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2015-04-17 02:00:25 +02:00
commit 96f795ab6b
9 changed files with 56 additions and 40 deletions

View file

@ -6,34 +6,42 @@
android:paddingRight="7dp" android:paddingRight="7dp"
android:stretchColumns="1"> android:stretchColumns="1">
<TableRow> <TableRow android:minHeight="@dimen/list_item_height"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/shared_string_show_on_map" />
<CheckBox
android:id="@+id/Visibility"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" />
</TableRow>
<TableRow
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/shared_string_show_on_map" />
<CheckBox
android:id="@+id/Visibility"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="15dp"
android:layout_marginRight="10dp" />
</TableRow>
<TableRow
android:minHeight="@dimen/list_item_height"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/gpx_split_interval"></TextView> android:text="@string/gpx_split_interval"></TextView>
<Spinner <Spinner
android:id="@+id/Spinner" android:id="@+id/Spinner"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"></Spinner> android:layout_marginRight="5dp"></Spinner>
</TableRow> </TableRow>

View file

@ -4,7 +4,7 @@
android:singleLine="true" android:singleLine="true"
android:background="?attr/expandable_list_background" android:background="?attr/expandable_list_background"
android:textSize="@dimen/default_list_text_size" android:textSize="@dimen/default_list_text_size"
android:layout_width="wrap_content" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="10dp" android:padding="10dp"
android:ellipsize="marquee"/> android:ellipsize="marquee"/>

View file

@ -372,8 +372,8 @@ public class GpxSelectionHelper {
return sf; return sf;
} }
public SelectedGpxFile selectGpxFile(GPXFile gpx, boolean show, boolean showNavigationDialog) { public SelectedGpxFile selectGpxFile(GPXFile gpx, boolean show, boolean notShowNavigationDialog) {
SelectedGpxFile sf = selectGpxFileImpl(gpx, show, showNavigationDialog); SelectedGpxFile sf = selectGpxFileImpl(gpx, show, notShowNavigationDialog);
saveCurrentSelections(); saveCurrentSelections();
return sf; return sf;
} }

View file

@ -201,7 +201,7 @@ public class BaseDownloadActivity extends ActionBarProgressActivity {
builder.setNegativeButton(R.string.shared_string_no, null); builder.setNegativeButton(R.string.shared_string_no, null);
builder.show(); builder.show();
} else { } 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 { } else {
downloadFilesPreCheckSpace(); downloadFilesPreCheckSpace();

View file

@ -14,6 +14,7 @@ import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import net.osmand.IndexConstants; import net.osmand.IndexConstants;
import net.osmand.PlatformUtil; import net.osmand.PlatformUtil;
import net.osmand.access.AccessibleToast; 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.helpers.DatabaseHelper;
import net.osmand.plus.resources.ResourceManager; import net.osmand.plus.resources.ResourceManager;
import net.osmand.util.Algorithms; import net.osmand.util.Algorithms;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException;
@ -125,7 +128,9 @@ public class DownloadIndexesThread {
return indexFiles != null && indexFiles.isDownloadedFromInternet(); return indexFiles != null && indexFiles.isDownloadedFromInternet();
} }
public List<IndexItem> getItemsToUpdate() { return itemsToUpdate;} public List<IndexItem> getItemsToUpdate() {
return itemsToUpdate;
}
public class DownloadIndexesAsyncTask extends BasicProgressAsyncTask<IndexItem, Object, String> implements DownloadFileShowWarning { public class DownloadIndexesAsyncTask extends BasicProgressAsyncTask<IndexItem, Object, String> implements DownloadFileShowWarning {

View file

@ -3,7 +3,6 @@ package net.osmand.plus.download;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection; import java.net.URLConnection;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;

View file

@ -1,5 +1,17 @@
package net.osmand.plus.download; 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.app.Activity;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
@ -18,19 +30,6 @@ import android.widget.ListView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; 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 * Created by Denis
* on 09.09.2014. * on 09.09.2014.
@ -105,7 +104,11 @@ public class UpdatesIndexFragment extends ListFragment {
updateHeader(); updateHeader();
if (indexItems.size() == 0) { if (indexItems.size() == 0) {
indexItems.clear(); 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 = new UpdateIndexAdapter(getDownloadActivity(), R.layout.download_index_list_item, indexItems);
listAdapter.sort(new Comparator<IndexItem>() { listAdapter.sort(new Comparator<IndexItem>() {
@ -267,7 +270,8 @@ public class UpdatesIndexFragment extends ListFragment {
TextView updateDescr = (TextView) v.findViewById(R.id.update_descr); TextView updateDescr = (TextView) v.findViewById(R.id.update_descr);
final CheckBox ch = (CheckBox) v.findViewById(R.id.check_download_item); final CheckBox ch = (CheckBox) v.findViewById(R.id.check_download_item);
IndexItem e = items.get(position); 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()); name.setText(e.getFileName());
description.setText(""); description.setText("");
ch.setVisibility(View.INVISIBLE); ch.setVisibility(View.INVISIBLE);
@ -288,7 +292,7 @@ public class UpdatesIndexFragment extends ListFragment {
Map<String, String> indexActivatedFileNames = getMyApplication().getResourceManager().getIndexFileNames(); Map<String, String> indexActivatedFileNames = getMyApplication().getResourceManager().getIndexFileNames();
String dt = indexActivatedFileNames.get(sfName); String dt = indexActivatedFileNames.get(sfName);
updateDescr.setText(""); updateDescr.setText("");
if(dt != null ) { if (dt != null) {
try { try {
Date tm = format.parse(dt); Date tm = format.parse(dt);
long days = Math.max(1, (e.getTimestamp() - tm.getTime()) / (24 * 60 * 60 * 1000) + 1); long days = Math.max(1, (e.getTimestamp() - tm.getTime()) / (24 * 60 * 60 * 1000) + 1);

View file

@ -826,7 +826,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
checkItem.setOnClickListener(new View.OnClickListener() { checkItem.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
selectedGpxHelper.selectGpxFile(child.gpx, !isChecked, true); selectedGpxHelper.selectGpxFile(child.gpx, !isChecked, false);
notifyDataSetChanged(); notifyDataSetChanged();
} }
}); });

View file

@ -317,7 +317,7 @@ public class SelectedGPXFragment extends ListFragment {
@Override @Override
public void onClick(DialogInterface dialog, int which) { 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) { if (groups.size() > 0) {
updateSplit(groups, distanceSplit, timeSplit, sp.getSelectedItemPosition(), vis.isChecked() ? sf updateSplit(groups, distanceSplit, timeSplit, sp.getSelectedItemPosition(), vis.isChecked() ? sf
: null); : null);