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:stretchColumns="1">
<TableRow>
<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
<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/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>
<Spinner
android:id="@+id/Spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"></Spinner>
</TableRow>

View file

@ -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"/>

View file

@ -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;
}

View file

@ -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();

View file

@ -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<IndexItem> getItemsToUpdate() { return itemsToUpdate;}
public List<IndexItem> getItemsToUpdate() {
return itemsToUpdate;
}
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.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.util.HashMap;
import java.util.List;

View file

@ -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<IndexItem>() {
@ -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<String, String> 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);

View file

@ -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();
}
});

View file

@ -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);