Add autoOnline mode & fetch markers only when screen is on #70

Merged
s416204 merged 1 commits from bg-task-increase-interval into develop 2018-12-06 22:39:57 +01:00
3 changed files with 5 additions and 4 deletions

View File

@ -439,7 +439,7 @@ public class MapActivity extends BaseActivity
}
LatLng toDestination = new LatLng(element.getLatitude(), element.getLongitude());
// TODO fix flickiering markers
ValueAnimator markerAnimator = ObjectAnimator.ofObject(marker, "position",
new MapUtils.LatLngEvaluator(),
marker.getPosition(),
@ -606,7 +606,6 @@ public class MapActivity extends BaseActivity
super.onStop();
mapView.onStop();
shouldFetchNewCoords = false;
}
@Override

View File

@ -49,6 +49,7 @@ import io.reactivex.observers.DisposableSingleObserver;
import io.reactivex.schedulers.Schedulers;
import okhttp3.ResponseBody;
import static com.uam.wmi.findmytutor.utils.Const.defaultBackgroundLocationInterval;
import static com.uam.wmi.findmytutor.utils.Const.presenceApproximatedName;
import static com.uam.wmi.findmytutor.utils.Const.presenceLatitude;
import static com.uam.wmi.findmytutor.utils.Const.presenceLongitude;
@ -59,8 +60,8 @@ public class BackgroundLocalizationService extends Service {
private static final String TAG = "MyLocationService";
private static final int LOCATION_INTERVAL = 1000;
private static final float LOCATION_DISTANCE = 5f;
private static long notify_interval = 10000;
private static long notify_interval_inside_building = 10000;
private static long notify_interval = defaultBackgroundLocationInterval;
private static long notify_interval_inside_building = defaultBackgroundLocationInterval;
private static long notify_interval_outside_building = 360000;
private static int coordinatesHistoryLength = 10;
private Location mLastLocation;

View File

@ -6,6 +6,7 @@ import java.util.Arrays;
import java.util.List;
public class Const {
public final static Integer defaultBackgroundLocationInterval = 15000;
public final static Integer defaultMapZoom = 17;
public final static Integer searchMapZoom = 13;
public final static Double presenceLatitude = 52.466365;