Skip to content

Commit

Permalink
Better user feedback on location button presses; more reliable map po…
Browse files Browse the repository at this point in the history
…int retrieval
  • Loading branch information
pgmccann committed Jun 6, 2018
1 parent c7e1556 commit d5e395e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,21 @@ public void startTrackingLocation(View v) {

public void stopTrackingLocation(View v) {
stopService(new Intent(this, CatchLocationService.class));
Toast.makeText(getBaseContext(), getString(R.string.stopped_tracking_location),
Toast.LENGTH_LONG).show();
}

public void startFishing(View v) {
((CatchApplication) this.getApplication()).setFishing(true);
this.startTrackingLocation(v);
Toast.makeText(getBaseContext(), getString(R.string.started_fishing),
Toast.LENGTH_LONG).show();
}

public void stopFishing(View v) {
((CatchApplication) this.getApplication()).setFishing(false);
Toast.makeText(getBaseContext(), getString(R.string.stopped_fishing),
Toast.LENGTH_LONG).show();
}

private void startLocationService() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,7 @@ private void getPoints() {
@Override
public void run() {
Calendar cal = Calendar.getInstance();
cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
if (cal.after(new Date())) {
cal.add(Calendar.DATE, -7);
}
cal.add(Calendar.DATE, -1 * (cal.get(Calendar.DAY_OF_WEEK) - 1));
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
Expand Down
3 changes: 3 additions & 0 deletions catch/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
<string name="stop_fishing">Stop Fishing</string>
<string name="submit_track">Submit last 1000 location points</string>
<string name="fish_1_form_summary">%s\n%s -\n%s</string>
<string name="stopped_tracking_location">Stopped tracking location</string>
<string name="started_fishing">Recorded location information will now indicate that you are fishing</string>
<string name="stopped_fishing">Recorded location information will no longer indicate that you are fishing</string>

<!-- FISH1 Form Creation -->

Expand Down

0 comments on commit d5e395e

Please sign in to comment.