[android] - allow setting an OkHttpClient
This commit is contained in:
@@ -234,4 +234,8 @@ class HTTPRequest implements Callback {
|
||||
static void enablePrintRequestUrlOnFailure(boolean enabled) {
|
||||
logRequestUrl = enabled;
|
||||
}
|
||||
|
||||
static void setOKHttpClient(OkHttpClient client) {
|
||||
mClient = client;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mapbox.mapboxsdk.http;
|
||||
|
||||
import okhttp3.OkHttpClient;
|
||||
|
||||
/**
|
||||
* Utility class for setting HttpRequest configurations
|
||||
*/
|
||||
@@ -28,8 +30,17 @@ public class HttpRequestUtil {
|
||||
*
|
||||
* @param enabled True will print urls, false will disable
|
||||
*/
|
||||
public static void setPrintRequestUrlOnFaillure(boolean enabled) {
|
||||
public static void setPrintRequestUrlOnFailure(boolean enabled) {
|
||||
HTTPRequest.enablePrintRequestUrlOnFailure(enabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the OkHttpClient used for requesting map resources.
|
||||
*
|
||||
* @param client the OkHttpClient
|
||||
*/
|
||||
public static void setOkHttpClient(OkHttpClient client) {
|
||||
HTTPRequest.setOKHttpClient(client);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -261,7 +261,7 @@ final class Transform implements MapView.OnMapChangedListener {
|
||||
setZoom(zoom, focalPoint, 0, false);
|
||||
}
|
||||
|
||||
void setZoom(double zoom, @NonNull PointF focalPoint, long duration, boolean isAnimator) {
|
||||
void setZoom(double zoom, @NonNull PointF focalPoint, long duration, final boolean isAnimator) {
|
||||
if (mapView != null) {
|
||||
mapView.addOnMapChangedListener(new MapView.OnMapChangedListener() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user