com.facebook.react.uimanager.ReactProp Java Examples

The following examples show how to use com.facebook.react.uimanager.ReactProp. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BaiduMapViewManager.java    From BaiduMapKit with MIT License 6 votes vote down vote up
/**
 * 显示地理标记
 *
 * @param mapView
 * @param array
 */
@ReactProp(name="marker")
public void setMarker(MapView mapView, ReadableArray array) {
    Log.d(TAG, "marker:" + array);
    if (array != null) {
        for (int i = 0; i < array.size(); i++) {
            ReadableArray sub = array.getArray(i);
            //定义Maker坐标点
            LatLng point = new LatLng(sub.getDouble(0), sub.getDouble(1));
            //构建Marker图标
            BitmapDescriptor bitmap = BitmapDescriptorFactory.fromResource(R.drawable.icon_gcoding);
            //构建MarkerOption,用于在地图上添加Marker
            OverlayOptions option = new MarkerOptions()
                    .position(point)
                    .icon(bitmap)
                    .draggable(true);
            //在地图上添加Marker,并显示
            mapView.getMap().addOverlay(option);
        }
    }
}
 
Example #2
Source File: PPTGoogleMapManager.java    From react-native-maps with MIT License 5 votes vote down vote up
/**
 * Controls whether scroll gestures are enabled (default) or disabled.
 *
 * @param map
 * @param scrollGestures
 */
@ReactProp(name = "scrollGestures")
public void setScrollGestures(MapView map, boolean scrollGestures) {
    this.scrollGestures = scrollGestures;

    map.getMapAsync(this);
}
 
Example #3
Source File: PPTGoogleMapManager.java    From react-native-maps with MIT License 5 votes vote down vote up
/**
 * Enables or disables the My Location button.
 *
 * @param map
 * @param myLocationButton
 */
@ReactProp(name = "myLocationButton")
public void setMyLocationButton(MapView map, boolean myLocationButton) {
    this.myLocationButton = myLocationButton;

    map.getMapAsync(this);
}
 
Example #4
Source File: PPTGoogleMapManager.java    From react-native-maps with MIT License 5 votes vote down vote up
/**
 * Enables or disables the compass.
 *
 * @param map
 * @param compassButton
 */
@ReactProp(name = "compassButton")
public void setCompassButton(MapView map, boolean compassButton) {
    this.compassButton = compassButton;

    map.getMapAsync(this);
}
 
Example #5
Source File: PPTGoogleMapManager.java    From react-native-maps with MIT License 5 votes vote down vote up
/**
 * Controls whether rotate gestures are enabled (default) or disabled.
 *
 * @param map
 * @param rotateGestures
 */
@ReactProp(name = "rotateGestures")
public void setRotateGestures(MapView map, boolean rotateGestures) {
    this.rotateGestures = rotateGestures;

    map.getMapAsync(this);
}
 
Example #6
Source File: PPTGoogleMapManager.java    From react-native-maps with MIT License 5 votes vote down vote up
/**
 * Controls whether tilt gestures are enabled (default) or disabled.
 *
 * @param map
 * @param tiltGestures
 */
@ReactProp(name = "tiltGestures")
public void setTiltGestures(MapView map, boolean tiltGestures) {
    this.tiltGestures = tiltGestures;

    map.getMapAsync(this);
}
 
Example #7
Source File: PPTGoogleMapManager.java    From react-native-maps with MIT License 5 votes vote down vote up
/**
 * Controls whether zoom gestures are enabled (default) or disabled.
 *
 * @param map
 * @param zoomGestures
 */
@ReactProp(name = "zoomGestures")
public void setZoomGestures(MapView map, boolean zoomGestures) {
    this.zoomGestures = zoomGestures;

    map.getMapAsync(this);
}
 
Example #8
Source File: PPTGoogleMapManager.java    From react-native-maps with MIT License 5 votes vote down vote up
/**
 * Sets the user's location marker, if it has been enabled.
 *
 * @param showsUserLocation
 */
@ReactProp(name = "showsUserLocation")
public void setShowsUserLocation(MapView map, boolean showsUserLocation) {
    this.showsUserLocation = showsUserLocation;

    map.getMapAsync(this);
}
 
Example #9
Source File: PPTGoogleMapManager.java    From react-native-maps with MIT License 5 votes vote down vote up
/**
 * Adds marker icons to the map.
 *
 * @param map
 * @param markers
 */
@ReactProp(name = "markers")
public void setMarkers(MapView map, ReadableArray markers) {
    this.markers = markers;

    map.getMapAsync(this);
}
 
Example #10
Source File: PPTGoogleMapManager.java    From react-native-maps with MIT License 5 votes vote down vote up
/**
 * Sets the user's location marker, if it has been enabled.
 *
 * @param map
 * @param cameraPosition
 */
@ReactProp(name = "cameraPosition")
public void setCameraPosition(MapView map, ReadableMap cameraPosition) {
    float zoom = (float) cameraPosition.getDouble("zoom");

    if (cameraPosition.hasKey("auto") && cameraPosition.getBoolean("auto")) {
        Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);

        if (location == null) {
            return;
        }

        cameraUpdate = CameraUpdateFactory.newLatLngZoom(
                new LatLng(location.getLatitude(), location.getLongitude()),
                zoom
        );

        map.getMapAsync(this);
    } else {
        cameraUpdate = CameraUpdateFactory.newLatLngZoom(
                new LatLng(
                        cameraPosition.getDouble("latitude"),
                        cameraPosition.getDouble("longitude")
                ), zoom
        );

        map.getMapAsync(this);
    }
}
 
Example #11
Source File: RNCameraViewManager.java    From react-native-camera-android with MIT License 4 votes vote down vote up
@ReactProp(name = "viewFinderBorderWidth")
public void setViewFinderBorderWidth(RNCameraView view, @Nullable Integer viewFinderBorderWidth) {
    if (viewFinderBorderWidth != null) {
        view.setBorderStrokeWidth(viewFinderBorderWidth);
    }
}
 
Example #12
Source File: RNCameraViewManager.java    From react-native-camera-android with MIT License 4 votes vote down vote up
@ReactProp(name = "viewFinderBackgroundColor")
public void setViewFinderBackgroundColor(RNCameraView view, @Nullable String viewFinderBackgroundColor) {
    if (viewFinderBackgroundColor != null) {
        view.setMaskColor(viewFinderBackgroundColor);
    }
}
 
Example #13
Source File: BlurryOverlayManager.java    From react-native-android-blurryoverlay with MIT License 4 votes vote down vote up
@ReactProp(name = "color")
public void setColor(BlurryOverlayView view, String color) {
    view.setColorAndUpdate(color);
}
 
Example #14
Source File: BlurryOverlayManager.java    From react-native-android-blurryoverlay with MIT License 4 votes vote down vote up
@ReactProp(name = "sampling", defaultInt = 0)
public void setSampling(BlurryOverlayView view, int sampling) {
    view.setSamplingAndUpdate(sampling);
}
 
Example #15
Source File: BlurryOverlayManager.java    From react-native-android-blurryoverlay with MIT License 4 votes vote down vote up
@ReactProp(name = "radius", defaultInt = 0)
public void setRadius(BlurryOverlayView view, int radius) {
    view.setRadiusAndUpdate(radius);
}
 
Example #16
Source File: RNCameraViewManager.java    From react-native-camera-android with MIT License 4 votes vote down vote up
@ReactProp(name = "viewFinderBorderColor")
public void setViewFinderBorderColor(RNCameraView view, @Nullable String viewFinderBorderColor) {
    if (viewFinderBorderColor != null) {
        view.setBorderColor(viewFinderBorderColor);
    }
}
 
Example #17
Source File: RNCameraViewManager.java    From react-native-camera-android with MIT License 4 votes vote down vote up
@ReactProp(name = "autoFocus")
public void setAutoFocus(RNCameraView view, @Nullable Boolean autoFocus) {
    if (autoFocus != null) {
        view.setAutoFocus(autoFocus);
    }
}
 
Example #18
Source File: RNCameraViewManager.java    From react-native-camera-android with MIT License 4 votes vote down vote up
@ReactProp(name = "viewFinderBorderLength")
public void setViewFinderBorderLength(RNCameraView view, @Nullable Integer viewFinderBorderLength) {
    if (viewFinderBorderLength != null) {
        view.setBorderLineLength(viewFinderBorderLength);
    }
}
 
Example #19
Source File: RNCameraViewManager.java    From react-native-camera-android with MIT License 4 votes vote down vote up
@ReactProp(name = "viewFinderDrawLaser")
public void setViewFinderDrawLaser(RNCameraView view, @Nullable Boolean viewFinderDrawLaser) {
    if (viewFinderDrawLaser != null) {
        view.setDrawLaser(viewFinderDrawLaser);
    }
}
 
Example #20
Source File: RNCameraViewManager.java    From react-native-camera-android with MIT License 4 votes vote down vote up
@ReactProp(name = "viewFinderLaserColor")
public void setViewFinderLaserColor(RNCameraView view, @Nullable String viewFinderLaserColor) {
    if (viewFinderLaserColor != null) {
        view.setLaserColor(viewFinderLaserColor);
    }
}
 
Example #21
Source File: RNCameraViewManager.java    From react-native-camera-android with MIT License 4 votes vote down vote up
@ReactProp(name = "viewFinderDisplay")
public void setViewFinderDisplay(RNCameraView view, @Nullable Boolean viewFinderDisplay) {
    if(viewFinderDisplay !=  null) {
        view.setViewFinderDisplay(viewFinderDisplay);
    }
}
 
Example #22
Source File: RNCameraViewManager.java    From react-native-camera-android with MIT License 4 votes vote down vote up
@ReactProp(name = "type")
public void setCameraType(RNCameraView view, @Nullable String cameraType) {
    if (cameraType != null) {
        view.setCameraType(cameraType);
    }
}
 
Example #23
Source File: RNCameraViewManager.java    From react-native-camera-android with MIT License 4 votes vote down vote up
@ReactProp(name = "torchMode")
public void setTorchMode(RNCameraView view, @Nullable String torchMode) {
    if (torchMode != null) {
        view.setTorchMode(torchMode);
    }
}
 
Example #24
Source File: PPTGoogleMapManager.java    From react-native-maps with MIT License 2 votes vote down vote up
/**
 * Controls whether gestures by users are completely consumed by the map view when gestures are enabled (default YES).
 *
 * @param map
 * @param consumesGesturesInView
 */
@ReactProp(name = "consumesGesturesInView")
public void setConsumesGesturesInView(MapView map, boolean consumesGesturesInView) {
    // Do nothing - this is an iOS feature that we're only implementing so that the Android
    // map package doesn't break.
}
 
Example #25
Source File: BaiduMapViewManager.java    From BaiduMapKit with MIT License 2 votes vote down vote up
/**
 * 地图模式
 *
 * @param mapView
 * @param type
 *  1. 普通
 *  2.卫星
 */
@ReactProp(name="mode", defaultInt = 1)
public void setMode(MapView mapView, int type) {
    Log.i(TAG, "mode:" + type);
    mapView.getMap().setMapType(type);
}
 
Example #26
Source File: BaiduMapViewManager.java    From BaiduMapKit with MIT License 2 votes vote down vote up
/**
 * 实时交通图
 *
 * @param mapView
 * @param isEnabled
 */
@ReactProp(name="trafficEnabled", defaultBoolean = false)
public void setTrafficEnabled(MapView mapView, boolean isEnabled) {
    Log.d(TAG, "trafficEnabled:" + isEnabled);
    mapView.getMap().setTrafficEnabled(isEnabled);
}
 
Example #27
Source File: BaiduMapViewManager.java    From BaiduMapKit with MIT License 2 votes vote down vote up
/**
 * 实时道路热力图
 *
 * @param mapView
 * @param isEnabled
 */
@ReactProp(name="heatMapEnabled", defaultBoolean = false)
public void setHeatMapEnabled(MapView mapView, boolean isEnabled) {
    Log.d(TAG, "heatMapEnabled" + isEnabled);
    mapView.getMap().setBaiduHeatMapEnabled(isEnabled);
}