-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #357 Locus integration not working #358
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
/* | ||
* This file is part of WhereYouGo. | ||
* | ||
* | ||
* WhereYouGo is free software: you can redistribute it and/or modify it under the terms of the GNU | ||
* General Public License as published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* | ||
* WhereYouGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without | ||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* | ||
* You should have received a copy of the GNU General Public License along with WhereYouGo. If not, | ||
* see <http://www.gnu.org/licenses/>. | ||
* | ||
* | ||
* Copyright (C) 2012 Menion <[email protected]> | ||
*/ | ||
|
||
|
@@ -147,7 +147,7 @@ public static Location getLastKnownLocation(Activity activity) { | |
|
||
public static Location getLocation() { | ||
if (location == null) | ||
return new Location(TAG); | ||
return new Location(); | ||
return new Location(location); | ||
} | ||
|
||
|
@@ -331,7 +331,7 @@ static void onLocationChanged(Location location) { | |
// if first location from Network, and new from GPS but with worst precision, do not set | ||
if (LocationState.location.getProvider().equals(LocationManager.NETWORK_PROVIDER) | ||
&& location.getProvider().equals(LocationManager.GPS_PROVIDER) | ||
&& (LocationState.location.getAccuracy() * 3) < location.getAccuracy()) { | ||
&& (LocationState.location.getAccuracyHor() * 3) < location.getAccuracyHor()) { | ||
bekuno marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
/* | ||
* This file is part of WhereYouGo. | ||
* | ||
* | ||
* WhereYouGo is free software: you can redistribute it and/or modify it under the terms of the GNU | ||
* General Public License as published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* | ||
* WhereYouGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without | ||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* | ||
* You should have received a copy of the GNU General Public License along with WhereYouGo. If not, | ||
* see <http://www.gnu.org/licenses/>. | ||
* | ||
* | ||
* Copyright (C) 2012 Menion <[email protected]> | ||
*/ | ||
|
||
|
@@ -132,7 +132,7 @@ public void onOrientationChanged(float azimuth, float pitch, float roll) { | |
viewLat.setText(UtilsFormat.formatLatitude(loc.getLatitude())); | ||
viewLon.setText(UtilsFormat.formatLongitude(loc.getLongitude())); | ||
viewAlt.setText(UtilsFormat.formatAltitude(loc.getAltitude(), true)); | ||
viewAcc.setText(UtilsFormat.formatDistance((double) loc.getAccuracy(), false)); | ||
viewAcc.setText(UtilsFormat.formatDistance((double) loc.getAccuracyHor(), false)); | ||
bekuno marked this conversation as resolved.
Show resolved
Hide resolved
|
||
viewSpeed.setText(UtilsFormat.formatSpeed(loc.getSpeed(), false)); | ||
|
||
repaint(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
/* | ||
* This file is part of WhereYouGo. | ||
* | ||
* | ||
* WhereYouGo is free software: you can redistribute it and/or modify it under the terms of the GNU | ||
* General Public License as published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* | ||
* WhereYouGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without | ||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* | ||
* You should have received a copy of the GNU General Public License along with WhereYouGo. If not, | ||
* see <http://www.gnu.org/licenses/>. | ||
* | ||
* | ||
* Copyright (C) 2012 Menion <[email protected]> | ||
*/ | ||
|
||
|
@@ -49,7 +49,8 @@ | |
import cz.matejcik.openwig.Engine; | ||
import cz.matejcik.openwig.formats.CartridgeFile; | ||
import locus.api.objects.extra.Location; | ||
import locus.api.objects.extra.Waypoint; | ||
|
||
//import locus.api.objects.extra.Waypoint; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From history: |
||
|
||
import menion.android.whereyougo.MainApplication; | ||
import menion.android.whereyougo.R; | ||
|
@@ -179,9 +180,6 @@ public static void refreshCartridges() { | |
File[] files = FileSystem.getFiles(FileSystem.ROOT, "gwc"); | ||
cartridgeFiles = new Vector<>(); | ||
|
||
// add cartridges to map | ||
ArrayList<Waypoint> wpts = new ArrayList<>(); | ||
|
||
File actualFile = null; | ||
if (files != null) { | ||
for (File file : files) { | ||
|
@@ -190,26 +188,14 @@ public static void refreshCartridges() { | |
CartridgeFile cart = CartridgeFile.read(new WSeekableFile(file), new WSaveFile(file)); | ||
if (cart != null) { | ||
cart.filename = file.getAbsolutePath(); | ||
|
||
Location loc = new Location(TAG); | ||
loc.setLatitude(cart.latitude); | ||
loc.setLongitude(cart.longitude); | ||
Waypoint waypoint = new Waypoint(cart.name, loc); | ||
|
||
cartridgeFiles.add(cart); | ||
wpts.add(waypoint); | ||
} | ||
} catch (Exception e) { | ||
Logger.w(TAG, "refreshCartridge(), file:" + actualFile + ", e:" + e.toString()); | ||
ManagerNotify.toastShortMessage(Locale.getString(R.string.invalid_cartridge, actualFile.getName())); | ||
// file.delete(); | ||
} | ||
} | ||
} | ||
|
||
if (wpts.size() > 0) { | ||
// TODO add items on map | ||
} | ||
} | ||
|
||
public static void openCartridge(final CartridgeFile cartridgeFile) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
/* | ||
* This file is part of WhereYouGo. | ||
* | ||
* | ||
* WhereYouGo is free software: you can redistribute it and/or modify it under the terms of the GNU | ||
* General Public License as published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* | ||
* WhereYouGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without | ||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* | ||
* You should have received a copy of the GNU General Public License along with WhereYouGo. If not, | ||
* see <http://www.gnu.org/licenses/>. | ||
* | ||
* | ||
* Copyright (C) 2012 Menion <[email protected]> | ||
*/ | ||
|
||
|
@@ -162,7 +162,7 @@ public void run() { | |
((TextView) findViewById(R.id.text_view_altitude)).setText(UtilsFormat.formatAltitude( | ||
location.getAltitude(), true)); | ||
((TextView) findViewById(R.id.text_view_accuracy)).setText(UtilsFormat.formatDistance( | ||
location.getAccuracy(), false)); | ||
location.getAccuracyHor(), false)); | ||
((TextView) findViewById(R.id.text_view_speed)).setText(UtilsFormat.formatSpeed( | ||
location.getSpeed(), false)); | ||
((TextView) findViewById(R.id.text_view_declination)).setText(UtilsFormat | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
/* | ||
* This file is part of WhereYouGo. | ||
* | ||
* | ||
* WhereYouGo is free software: you can redistribute it and/or modify it under the terms of the GNU | ||
* General Public License as published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* | ||
* WhereYouGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without | ||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* | ||
* You should have received a copy of the GNU General Public License along with WhereYouGo. If not, | ||
* see <http://www.gnu.org/licenses/>. | ||
* | ||
* | ||
* Copyright (C) 2012 Menion <[email protected]> | ||
*/ | ||
|
||
|
@@ -175,7 +175,7 @@ public DataInfo setImageRight(Bitmap image) { | |
} | ||
|
||
public Location getLocation() { | ||
Location loc = new Location(TAG); | ||
Location loc = new Location(); | ||
loc.setLatitude(value01); | ||
loc.setLongitude(value02); | ||
return loc; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should now delete L105
//noinspection GradleDependency