package com.airbnb.android.react.maps;

import com.facebook.react.common.MapBuilder;
import com.facebook.react.uimanager.LayoutShadowNode;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.ViewGroupManager;
import com.facebook.react.uimanager.annotations.ReactProp;

import java.util.Map;

import javax.annotation.Nullable;

public class GaodeMapCalloutManager extends ViewGroupManager<AirMapCallout> {

    @Override
    public String getName() {
        return "AIRGaodeMapCallout";
    }

    @Override
    public AirMapCallout createViewInstance(ThemedReactContext context) {
        return new AirMapCallout(context);
    }

    @ReactProp(name = "tooltip", defaultBoolean = false)
    public void setTooltip(AirMapCallout view, boolean tooltip) {
        view.setTooltip(tooltip);
    }

    @Override
    @Nullable
    public Map getExportedCustomDirectEventTypeConstants() {
        return MapBuilder.of("onPress", MapBuilder.of("registrationName", "onPress"));
    }

    @Override
    public LayoutShadowNode createShadowNodeInstance() {
        // we use a custom shadow node that emits the width/height of the view
        // after layout with the updateExtraData method. Without this, we can't generate
        // a bitmap of the appropriate width/height of the rendered view.
        return new SizeReportingShadowNode();
    }

    @Override
    public void updateExtraData(AirMapCallout view, Object extraData) {
        // This method is called from the shadow node with the width/height of the rendered
        // marker view.
        //noinspection unchecked
        Map<String, Float> data = (Map<String, Float>) extraData;
        float width = data.get("width");
        float height = data.get("height");
        view.width = (int) width;
        view.height = (int) height;
    }

}

@@ -421,19 +421,21 @@
 Manager%3C
-Air
+Gaode
 MapCallo
@@ -554,19 +554,21 @@
  public 
-Air
+Gaode
 MapCallo
@@ -638,19 +638,21 @@
 urn new 
-Air
+Gaode
 MapCallo
@@ -755,19 +755,21 @@
 Tooltip(
-Air
+Gaode
 MapCallo
@@ -1436,11 +1436,13 @@
 ata(
-Air
+Gaode
 MapC

fix type error