Skip to content
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

add ability to enter gps location manually #181

Merged
merged 5 commits into from
Dec 12, 2019

Conversation

constambeys
Copy link
Contributor

No description provided.

@ruleant ruleant self-assigned this Jul 28, 2019
@ruleant
Copy link
Owner

ruleant commented Jul 28, 2019

Thanks for the PR implementing #73 , @constambeys
On first glance it looks good. I'll review in more detail and test it soon.

@ruleant ruleant added this to the v0.7 milestone Jul 28, 2019
Copy link
Owner

@ruleant ruleant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice contribution. I like how you used method overloading and rewrote the storeLocation method a bit to make it more generic and available for reuse and thus avoid code duplication.
I've added some minor remarks as comments in the code.
As soon as I'm able to test I might add a few more remarks.

@constambeys
Copy link
Contributor Author

is it ok now?

@ruleant
Copy link
Owner

ruleant commented Sep 4, 2019

Great, thanks for the changes.

@ruleant
Copy link
Owner

ruleant commented Sep 4, 2019

Hi @constambeys
I did a quick test and I was able to enter a location using the form you created, so that's great!

However, input/boundary checking should be included :

  • A valid range for longitude : +180° to −180°
  • A valid range for latitude : +90 to -90°

I was unable to enter a negative number, so I guess you have to change the input type for the longitude and latitude input fields.
I was able to enter a number outside the valid range, the coordinate was rejected and as a result the location was not stored, but there should be a message telling the user one of the parameters was invalid.

builder.create().show();
}
public final void enterLocation() {
if (mBound) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be if (!mBound) {

@ruleant
Copy link
Owner

ruleant commented Sep 4, 2019

If you want to test the app, you can find some info on how to build and deploy the app using a vagrant box : https://github.com/ruleant/getback_gps/wiki/Development
Or if you use an IDE that integrates with Android, you can probably test using an emulated android device.
Let me know if you need help.

@constambeys
Copy link
Contributor Author

fixed check now

@ruleant
Copy link
Owner

ruleant commented Sep 7, 2019

Great stuff, @constambeys!
Can you just add the error strings to the strings.xml file, so they can be translated?

@constambeys
Copy link
Contributor Author

moved

Copy link
Owner

@ruleant ruleant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff, @constambeys
Again apologies for the late reaction. I'm a bit busy at the moment and unfortunately I can't find much time for working on the getback_gps android app, or testing/reviewing contributions. But that doesn't mean I don't appreciate your work and contribution, on the contrary.

I think your contributed 'manual location entry' form is nearly ready to merge with the code base. I've added a few cosmetic remarks regarding strings, that should be easy to fix.

After that, there's a few administrative things :

  • don't forget to add your name to the Copyright notice at the beginning of each code file you made changes to. Look for the Copyright line where my name is mentioned and add one with your name :
    Copyright (C) 2019 Timotheos Constambeys
  • add an entry to the Changelog file (in the 0.7 release section), something like : issue #73 : add form to manually enter a location, thanks to Timotheos Constambeys
  • can you rebase your branch to the master branch and squash all your commits into 1?
    That way your work on this feature is all in one commit, which makes the commit history cleaner.
    use git rebase -i upstream/master (where upstream is the name of my repo that you use in your config)
    Tip : For future work, it's better to use a separate branch to do your development (and rebase that branch regularly to upstream master), then you avoid those unnecesary merge commits.

<string name="cancel">Cancel</string>
<string name="store_location">Store Location</string>
<string name="enter_location">Enter Location</string>
Copy link
Owner

@ruleant ruleant Sep 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better : "Enter destination manually"
this way it indicates you can manually enter a destination.

MenuItem miRenameDest = menu.findItem(R.id.menu_renamedestination);
if (isBound()) {
// enable store location button if a location is set
miStoreLocation.setEnabled(mService.getLocation() != null);
miEnterLocation.setEnabled(mService.getLocation() != null);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manual entry can be enabled any time, it doesn't depend on a current location being present, so this can be miEnterLocation.setEnabled(true);

= (EditText) dialogView.findViewById(R.id.location_longtitude);
// Set the layout for the dialog
builder.setView(dialogView)
.setTitle(R.string.store_location)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should use the 'R.string.enter_location' string for the title

@ruleant
Copy link
Owner

ruleant commented Sep 29, 2019

After merging your feature, would you be interested in contributing some more?
You can have a look at new features you like to work on in the issues section.
Or perhaps you can improve the form you added and do some refactoring? I was thinking your form can be merged with the 'rename destination' form, where you can edit not only the name of the current destination, but also the coordinates. But this of course is work for another PR, it doesn't have to be done in this PR.

@constambeys
Copy link
Contributor Author

Thanks for your help and guidance. At the moment I don't have much free time but this is a great project and will keep an eye of it in the future !!

@ruleant ruleant merged commit 8de714a into ruleant:master Dec 12, 2019
@ruleant
Copy link
Owner

ruleant commented Dec 12, 2019

Merged! Thanks for your contribution. It will be part of the upcoming v0.7 release.

@ruleant
Copy link
Owner

ruleant commented Jan 16, 2021

@constambeys Version v0.7 was released, including the form you added!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants