Skip to content

Commit

Permalink
Merge pull request #330 from onaio/329-remove-gps-accuracy-toast
Browse files Browse the repository at this point in the history
 Remove GPS accuracy toast message
  • Loading branch information
Rkareko authored Mar 4, 2020
2 parents 4952c67 + 4c341cc commit 3b9d6e9
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 25 deletions.
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ apply plugin: 'realm-android'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'

version '0.8.2'
version '0.8.3'
project.version = this.version

task sourceJar(type: Jar) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
import com.google.android.gms.location.LocationSettingsResult;
import com.google.android.gms.location.LocationSettingsStatusCodes;

import java.util.Locale;

import io.ona.kujaku.KujakuLibrary;
import io.ona.kujaku.R;
import io.ona.kujaku.utils.LocationSettingsHelper;
import timber.log.Timber;
Expand Down Expand Up @@ -129,8 +126,6 @@ public void requestLocationUpdates(@NonNull LocationListener locationListener) {
Location location = locationManager.getLastKnownLocation(getProvider());
if (location != null && (lastLocation == null || (location != null && isBetterLocation(location, lastLocation)))) {
lastLocation = location;
KujakuLibrary.getInstance()
.showToast(String.format(Locale.ENGLISH, "A new location received : \nProvider: %s\nAccuracy: %f\nPoint (%f, %f)", location.getProvider(), location.getAccuracy(), location.getLatitude(), location.getLongitude()));
locationListener.onLocationChanged(lastLocation);
} else {
// Enable snackbar in the activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
import com.google.android.gms.location.LocationSettingsStatusCodes;
import com.google.android.gms.tasks.OnSuccessListener;

import java.util.Locale;

import io.ona.kujaku.KujakuLibrary;
import io.ona.kujaku.R;
import io.ona.kujaku.utils.LocationSettingsHelper;
import timber.log.Timber;
Expand Down Expand Up @@ -96,12 +93,6 @@ public void requestLocationUpdates(@NonNull android.location.LocationListener lo
.addOnSuccessListener((Activity) context, new OnSuccessListener<Location>() {
@Override
public void onSuccess(Location location) {
if (location != null) {
KujakuLibrary.getInstance()
.showToast(String.format(Locale.ENGLISH, "A new location received : \nProvider: %s\nAccuracy: %f\nPoint (%f, %f)"
, location.getProvider(), location.getAccuracy(), location.getLatitude(), location.getLongitude()));
}

if (lastLocation == null || (location != null && isBetterLocation(location, lastLocation))) {
lastLocation = location;
}
Expand Down
10 changes: 0 additions & 10 deletions library/src/main/java/io/ona/kujaku/views/KujakuMapView.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Toast;

import com.cocoahero.android.geojson.Feature;
import com.cocoahero.android.geojson.Point;
Expand Down Expand Up @@ -57,15 +56,12 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;

import io.ona.kujaku.KujakuLibrary;
import io.ona.kujaku.R;
import io.ona.kujaku.callbacks.AddPointCallback;
import io.ona.kujaku.callbacks.OnLocationServicesEnabledCallBack;
import io.ona.kujaku.enums.LocationClient;
import io.ona.kujaku.exceptions.TrackingServiceNotInitializedException;
import io.ona.kujaku.exceptions.WmtsCapabilitiesException;
import io.ona.kujaku.helpers.MapboxLocationComponentWrapper;
Expand Down Expand Up @@ -313,12 +309,6 @@ private void warmUpLocationServices() {
locationClient.requestLocationUpdates(new BaseLocationListener() {
@Override
public void onLocationChanged(Location location) {
if (location != null) {
KujakuLibrary.getInstance()
.showToast(String.format(Locale.ENGLISH, "A new location received : \nProvider: %s\nAccuracy: %f\nPoint (%f, %f)"
, location.getProvider(), location.getAccuracy(), location.getLatitude(), location.getLongitude()));
}

float distanceMoved = -1;
if (location != null) {
if (latestLocation != null) {
Expand Down

0 comments on commit 3b9d6e9

Please sign in to comment.