[android] - remove reflection lookup for MarkerViewAdapter intialisation

This commit is contained in:
tobrun
2018-06-26 11:00:59 +02:00
committed by Tobrun
parent 50ff53ae3b
commit 95fd7ee742
3 changed files with 5 additions and 7 deletions

View File

@@ -637,7 +637,7 @@ public class MarkerViewManager implements MapView.OnMapChangedListener {
private LayoutInflater inflater;
ImageMarkerViewAdapter(Context context) {
super(context);
super(context, MarkerView.class);
inflater = LayoutInflater.from(context);
}

View File

@@ -45,7 +45,6 @@ import com.mapbox.mapboxsdk.style.layers.Layer;
import com.mapbox.mapboxsdk.style.light.Light;
import com.mapbox.mapboxsdk.style.sources.Source;
import java.lang.reflect.ParameterizedType;
import java.util.HashMap;
import java.util.List;
@@ -2525,10 +2524,9 @@ public final class MapboxMap {
*
* @param context the context associated to a MapView
*/
@SuppressWarnings("unchecked")
public MarkerViewAdapter(Context context) {
public MarkerViewAdapter(Context context, Class<U> persistentClass) {
this.context = context;
persistentClass = (Class<U>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];
this.persistentClass = persistentClass;
viewReusePool = new Pools.SimplePool<>(10000);
}