Fix gpx selection

This commit is contained in:
Victor Shcherb 2015-04-17 02:00:08 +02:00
parent 3bd522d523
commit e30d10761e
8 changed files with 43 additions and 36 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

@ -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;
@ -17,18 +29,6 @@ import android.widget.CheckBox;
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
@ -292,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);