Cherry pick v5.0.2 changes (#8586)

* [android] execute resource transform callback on the right thread

* [android] allow resetting of resource transform callback

* update CHANGELOG for v5.0.2

* [android] - correct anchoring when Icon is updated (#8519)
This commit is contained in:
Tobrun
2017-03-31 13:48:47 +02:00
committed by GitHub
parent a46d91f7c5
commit 8e538b4d06
5 changed files with 23 additions and 5 deletions

View File

@@ -389,6 +389,15 @@ public class MarkerView extends Marker {
}
}
/**
* Invalidates the MarkerView resulting in remeasuring the View.
*/
void invalidate() {
width = height = 0;
offsetX = offsetY = MapboxConstants.UNMEASURED;
markerViewManager.invalidateViewMarkersInVisibleRegion();
}
/**
* Get the String representation of a MarkerView.
*

View File

@@ -232,6 +232,7 @@ public class MarkerViewManager implements MapView.OnMapChangedListener {
View convertView = markerViewMap.get(markerView);
if (convertView != null && convertView instanceof ImageView) {
((ImageView) convertView).setImageBitmap(markerView.getIcon().getBitmap());
markerView.invalidate();
}
}

View File

@@ -123,9 +123,9 @@ public class FileSource {
* The callback will be executed on the main thread once for every requested URL.
* </p>
*
* @param callback the callback to be invoked
* @param callback the callback to be invoked or null to reset
*/
public native void setResourceTransform(@NonNull final ResourceTransformCallback callback);
public native void setResourceTransform(final ResourceTransformCallback callback);
private native void initialize(String accessToken, String cachePath, String apkPath);