Small changes

This commit is contained in:
Victor Shcherb 2015-03-25 19:03:34 +01:00
parent f1ac046580
commit d6a000caee
23 changed files with 58 additions and 40 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 B

View file

@ -274,7 +274,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
});
lst.setVisibility(View.VISIBLE);
if (visibleType == DashboardType.DASHBOARD) {
lst.setImageDrawable(iconsCache.getActionBarIcon(R.drawable.ic_navigation_drawer_dark));
lst.setImageDrawable(iconsCache.getActionBarIcon(R.drawable.ic_navigation_drawer));
} else if (visibleType == DashboardType.LIST_MENU) {
lst.setImageDrawable(iconsCache.getActionBarIcon(R.drawable.ic_dashboard_dark));
}
@ -363,7 +363,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
if(visible == this.visible && type == visibleType) {
return;
}
this.previousVisibleType = this.visible ? null : visibleType;
this.previousVisibleType = this.visible ? visibleType : null;
this.visible = visible;
boolean refresh = this.visibleType == type;
this.visibleType = type;

View file

@ -179,7 +179,11 @@ public class DashTrackFragment extends DashBaseFragment {
}
OsmandSettings settings = getMyApplication().getSettings();
settings.setMapLocationToShow(file.getLastPoint().lat, file.getLastPoint().lon, settings.getLastKnownMapZoom());
if(file.getLastPoint() != null) {
settings.setMapLocationToShow(file.getLastPoint().lat, file.getLastPoint().lon, settings.getLastKnownMapZoom());
} else if(file.findPointToShow() != null) {
settings.setMapLocationToShow(file.findPointToShow().lat, file.findPointToShow().lon, settings.getLastKnownMapZoom());
}
getMyApplication().getSelectedGpxHelper().setGpxFileToDisplay(file);
MapActivity.launchMapActivityMoveToTop(getActivity());
}

View file

@ -258,46 +258,58 @@ public class SelectedGPXFragment extends ListFragment {
protected void selectSplitDistance() {
final List<GpxDisplayGroup> groups = filterGroups(GpxDisplayItemType.TRACK_SEGMENT);
if(groups.size() == 0) {
return;
}
View view = getMyActivity().getLayoutInflater().inflate(R.layout.selected_track_edit, null);
final Spinner sp = (Spinner) view.findViewById(R.id.Spinner);
Builder bld = new AlertDialog.Builder(getMyActivity());
int[] checkedItem = new int[] {!groups.get(0).isSplitDistance() && !groups.get(0).isSplitTime()? 0 : -1};
List<String> options = new ArrayList<String>();
final List<Double> distanceSplit = new ArrayList<Double>();
final TIntArrayList timeSplit = new TIntArrayList();
View view = getMyActivity().getLayoutInflater().inflate(R.layout.selected_track_edit, null);
if(groups.size() == 0) {
sp.setVisibility(View.GONE);
} else {
sp.setVisibility(View.VISIBLE);
int[] checkedItem = new int[] { !groups.get(0).isSplitDistance() && !groups.get(0).isSplitTime() ? 0 : -1 };
List<String> options = new ArrayList<String>();
options.add(app.getString(R.string.none));
distanceSplit.add(-1d);
timeSplit.add(-1);
addOptionSplit(30, true, options, distanceSplit, timeSplit, checkedItem, groups); // 100 feet, 50 yards, 50
// m
addOptionSplit(60, true, options, distanceSplit, timeSplit, checkedItem, groups); // 200 feet, 100 yards,
// 100 m
addOptionSplit(150, true, options, distanceSplit, timeSplit, checkedItem, groups); // 500 feet, 200 yards,
// 200 m
addOptionSplit(300, true, options, distanceSplit, timeSplit, checkedItem, groups); // 1000 feet, 500 yards,
// 500 m
addOptionSplit(600, true, options, distanceSplit, timeSplit, checkedItem, groups); // 2000 feet, 1000 yards,
// 1km
addOptionSplit(1500, true, options, distanceSplit, timeSplit, checkedItem, groups); // 1mi, 2km
addOptionSplit(3000, true, options, distanceSplit, timeSplit, checkedItem, groups); // 2mi, 5km
addOptionSplit(8000, true, options, distanceSplit, timeSplit, checkedItem, groups); // 5mi, 10km
addOptionSplit(15, false, options, distanceSplit, timeSplit, checkedItem, groups);
addOptionSplit(30, false, options, distanceSplit, timeSplit, checkedItem, groups);
addOptionSplit(60, false, options, distanceSplit, timeSplit, checkedItem, groups);
addOptionSplit(120, false, options, distanceSplit, timeSplit, checkedItem, groups);
addOptionSplit(150, false, options, distanceSplit, timeSplit, checkedItem, groups);
addOptionSplit(300, false, options, distanceSplit, timeSplit, checkedItem, groups);
addOptionSplit(600, false, options, distanceSplit, timeSplit, checkedItem, groups);
addOptionSplit(900, false, options, distanceSplit, timeSplit, checkedItem, groups);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(getMyActivity(),
android.R.layout.simple_spinner_item, options);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
sp.setAdapter(adapter);
if (checkedItem[0] > 0) {
sp.setSelection(checkedItem[0]);
}
}
options.add(app.getString(R.string.none));
distanceSplit.add(-1d);
timeSplit.add(-1);
addOptionSplit(30, true, options, distanceSplit, timeSplit, checkedItem, groups); // 100 feet, 50 yards, 50 m
addOptionSplit(60, true, options, distanceSplit, timeSplit, checkedItem, groups); // 200 feet, 100 yards, 100 m
addOptionSplit(150, true, options, distanceSplit, timeSplit, checkedItem, groups); // 500 feet, 200 yards, 200 m
addOptionSplit(300, true, options, distanceSplit, timeSplit, checkedItem, groups); // 1000 feet, 500 yards, 500 m
addOptionSplit(600, true, options, distanceSplit, timeSplit, checkedItem, groups); // 2000 feet, 1000 yards, 1km
addOptionSplit(1500, true, options, distanceSplit, timeSplit, checkedItem, groups); // 1mi, 2km
addOptionSplit(3000, true, options, distanceSplit, timeSplit, checkedItem, groups); // 2mi, 5km
addOptionSplit(8000, true, options, distanceSplit, timeSplit, checkedItem, groups); // 5mi, 10km
addOptionSplit(15, false, options, distanceSplit, timeSplit, checkedItem, groups);
addOptionSplit(30, false, options, distanceSplit, timeSplit, checkedItem, groups);
addOptionSplit(60, false, options, distanceSplit, timeSplit, checkedItem, groups);
addOptionSplit(120, false, options, distanceSplit, timeSplit, checkedItem, groups);
addOptionSplit(150, false, options, distanceSplit, timeSplit, checkedItem, groups);
addOptionSplit(300, false, options, distanceSplit, timeSplit, checkedItem, groups);
addOptionSplit(600, false, options, distanceSplit, timeSplit, checkedItem, groups);
addOptionSplit(900, false, options, distanceSplit, timeSplit, checkedItem, groups);
final CheckBox vis = (CheckBox) view.findViewById(R.id.Visibility);
vis.setChecked(app.getSelectedGpxHelper().getSelectedFileByPath(getGpx().path) != null);
final Spinner sp = (Spinner) view.findViewById(R.id.Spinner);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(getMyActivity(), android.R.layout.simple_spinner_item, options);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
sp.setAdapter(adapter);
if(checkedItem[0] > 0) {
sp.setSelection(checkedItem[0]);
}
bld.setView(view);
bld.setNegativeButton(R.string.shared_string_cancel, null);
@ -306,8 +318,10 @@ 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);
updateSplit(groups, distanceSplit, timeSplit, sp.getSelectedItemPosition(),
vis.isChecked() ? sf : null);
if (groups.size() > 0) {
updateSplit(groups, distanceSplit, timeSplit, sp.getSelectedItemPosition(), vis.isChecked() ? sf
: null);
}
}
});

View file

@ -108,7 +108,7 @@ public class TourViewActivity extends OsmandActionBarActivity {
}
});
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.ic_navigation_drawer_light,
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.ic_navigation_drawer,
R.string.shared_string_more_actions, R.string.shared_string_close);
if (getMyApplication().isApplicationInitializing()) {
FragmentManager fragmentManager = getSupportFragmentManager();