Add autoOnline mode & fetch markers only when screen is on #70
@ -439,7 +439,7 @@ public class MapActivity extends BaseActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
LatLng toDestination = new LatLng(element.getLatitude(), element.getLongitude());
|
LatLng toDestination = new LatLng(element.getLatitude(), element.getLongitude());
|
||||||
// TODO fix flickiering markers
|
|
||||||
ValueAnimator markerAnimator = ObjectAnimator.ofObject(marker, "position",
|
ValueAnimator markerAnimator = ObjectAnimator.ofObject(marker, "position",
|
||||||
new MapUtils.LatLngEvaluator(),
|
new MapUtils.LatLngEvaluator(),
|
||||||
marker.getPosition(),
|
marker.getPosition(),
|
||||||
@ -606,7 +606,6 @@ public class MapActivity extends BaseActivity
|
|||||||
super.onStop();
|
super.onStop();
|
||||||
mapView.onStop();
|
mapView.onStop();
|
||||||
shouldFetchNewCoords = false;
|
shouldFetchNewCoords = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -49,6 +49,7 @@ import io.reactivex.observers.DisposableSingleObserver;
|
|||||||
import io.reactivex.schedulers.Schedulers;
|
import io.reactivex.schedulers.Schedulers;
|
||||||
import okhttp3.ResponseBody;
|
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.presenceApproximatedName;
|
||||||
import static com.uam.wmi.findmytutor.utils.Const.presenceLatitude;
|
import static com.uam.wmi.findmytutor.utils.Const.presenceLatitude;
|
||||||
import static com.uam.wmi.findmytutor.utils.Const.presenceLongitude;
|
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 String TAG = "MyLocationService";
|
||||||
private static final int LOCATION_INTERVAL = 1000;
|
private static final int LOCATION_INTERVAL = 1000;
|
||||||
private static final float LOCATION_DISTANCE = 5f;
|
private static final float LOCATION_DISTANCE = 5f;
|
||||||
private static long notify_interval = 10000;
|
private static long notify_interval = defaultBackgroundLocationInterval;
|
||||||
private static long notify_interval_inside_building = 10000;
|
private static long notify_interval_inside_building = defaultBackgroundLocationInterval;
|
||||||
private static long notify_interval_outside_building = 360000;
|
private static long notify_interval_outside_building = 360000;
|
||||||
private static int coordinatesHistoryLength = 10;
|
private static int coordinatesHistoryLength = 10;
|
||||||
private Location mLastLocation;
|
private Location mLastLocation;
|
||||||
|
@ -6,6 +6,7 @@ import java.util.Arrays;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class Const {
|
public class Const {
|
||||||
|
public final static Integer defaultBackgroundLocationInterval = 15000;
|
||||||
public final static Integer defaultMapZoom = 17;
|
public final static Integer defaultMapZoom = 17;
|
||||||
public final static Integer searchMapZoom = 13;
|
public final static Integer searchMapZoom = 13;
|
||||||
public final static Double presenceLatitude = 52.466365;
|
public final static Double presenceLatitude = 52.466365;
|
||||||
|
Loading…
Reference in New Issue
Block a user