Java 类com.facebook.react.uimanager.ReactProp 实例源码

项目:react-native-amap    文件:AMapViewManager.java   
@ReactProp(name = "region")
public void setRegion(MapView mapView, @Nullable ReadableMap region) {
    if (region == null) return;
    AMap map = mapView.getMap();
    Double lat = region.getDouble("latitude");
    Double lng = region.getDouble("longitude");
    Double lngDelta = region.getDouble("longitudeDelta");
    Double latDelta = region.getDouble("latitudeDelta");
    LatLngBounds bounds = new LatLngBounds(
        new LatLng(lat - latDelta / 2, lng - lngDelta / 2), // southwest
        new LatLng(lat + latDelta / 2, lng + lngDelta / 2)  // northeast
    );
    if (mapView.getHeight() <= 0 || mapView.getWidth() <= 0) {
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(lat, lng), 10));
        boundsToMove = bounds;
    } else {
        map.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 0));
    }
}
项目:BaiduMapKit    文件:BaiduMapViewManager.java   
/**
 * 显示地理标记
 *
 * @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);
        }
    }
}
项目:react-native-maps    文件:PPTGoogleMapManager.java   
/**
 * 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);
    }
}
项目:react-native-maps    文件:PPTGoogleMapManager.java   
/**
 * 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);
}
项目:react-native-maps    文件:PPTGoogleMapManager.java   
/**
 * 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);
}
项目:react-native-maps    文件:PPTGoogleMapManager.java   
/**
 * 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);
}
项目:react-native-maps    文件:PPTGoogleMapManager.java   
/**
 * 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);
}
项目:react-native-maps    文件:PPTGoogleMapManager.java   
/**
 * 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);
}
项目:react-native-maps    文件:PPTGoogleMapManager.java   
/**
 * 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);
}
项目:react-native-maps    文件:PPTGoogleMapManager.java   
/**
 * 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);
}
项目:react-native-maps    文件:PPTGoogleMapManager.java   
/**
 * 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);
}
项目:react-native-camera-master    文件:CameraViewManager.java   
@ReactProp(name = "torchMode")
public void toggleTorch(CameraView view, @Nullable Boolean flagValue) {
    if (flagValue) {
        view.setFlash(true);
    } else {
        view.setFlash(false);
    }
}
项目:react-native-spinner-android    文件:SpinnerManager.java   
@ReactProp(name = "values")
public void setValues(Spinner view, ReadableArray values) {
    view.setValues(values);
}
项目:react-native-spinner-android    文件:SpinnerManager.java   
@ReactProp(name = "selected")
public void setSelected(Spinner view, int selected) {
    view.setSelected(selected);
}
项目:react-native-camera-android    文件:RNCameraViewManager.java   
@ReactProp(name = "viewFinderDisplay")
public void setViewFinderDisplay(RNCameraView view, @Nullable Boolean viewFinderDisplay) {
    if(viewFinderDisplay !=  null) {
        view.setViewFinderDisplay(viewFinderDisplay);
    }
}
项目:react-native-camera-android    文件:RNCameraViewManager.java   
@ReactProp(name = "viewFinderBackgroundColor")
public void setViewFinderBackgroundColor(RNCameraView view, @Nullable String viewFinderBackgroundColor) {
    if (viewFinderBackgroundColor != null) {
        view.setMaskColor(viewFinderBackgroundColor);
    }
}
项目:react-native-camera-android    文件:RNCameraViewManager.java   
@ReactProp(name = "viewFinderBorderColor")
public void setViewFinderBorderColor(RNCameraView view, @Nullable String viewFinderBorderColor) {
    if (viewFinderBorderColor != null) {
        view.setBorderColor(viewFinderBorderColor);
    }
}
项目:react-native-camera-android    文件:RNCameraViewManager.java   
@ReactProp(name = "viewFinderBorderWidth")
public void setViewFinderBorderWidth(RNCameraView view, @Nullable Integer viewFinderBorderWidth) {
    if (viewFinderBorderWidth != null) {
        view.setBorderStrokeWidth(viewFinderBorderWidth);
    }
}
项目:react-native-camera-android    文件:RNCameraViewManager.java   
@ReactProp(name = "viewFinderBorderLength")
public void setViewFinderBorderLength(RNCameraView view, @Nullable Integer viewFinderBorderLength) {
    if (viewFinderBorderLength != null) {
        view.setBorderLineLength(viewFinderBorderLength);
    }
}
项目:react-native-camera-android    文件:RNCameraViewManager.java   
@ReactProp(name = "viewFinderDrawLaser")
public void setViewFinderDrawLaser(RNCameraView view, @Nullable Boolean viewFinderDrawLaser) {
    if (viewFinderDrawLaser != null) {
        view.setDrawLaser(viewFinderDrawLaser);
    }
}
项目:react-native-camera-android    文件:RNCameraViewManager.java   
@ReactProp(name = "viewFinderLaserColor")
public void setViewFinderLaserColor(RNCameraView view, @Nullable String viewFinderLaserColor) {
    if (viewFinderLaserColor != null) {
        view.setLaserColor(viewFinderLaserColor);
    }
}
项目:react-native-camera-android    文件:RNCameraViewManager.java   
@ReactProp(name = "type")
public void setCameraType(RNCameraView view, @Nullable String cameraType) {
    if (cameraType != null) {
        view.setCameraType(cameraType);
    }
}
项目:react-native-camera-android    文件:RNCameraViewManager.java   
@ReactProp(name = "torchMode")
public void setTorchMode(RNCameraView view, @Nullable String torchMode) {
    if (torchMode != null) {
        view.setTorchMode(torchMode);
    }
}
项目:react-native-camera-android    文件:RNCameraViewManager.java   
@ReactProp(name = "autoFocus")
public void setAutoFocus(RNCameraView view, @Nullable Boolean autoFocus) {
    if (autoFocus != null) {
        view.setAutoFocus(autoFocus);
    }
}
项目:react-native-amap    文件:AMapViewManager.java   
@ReactProp(name = "mapType")
public void setMapType(MapView mapView, @Nullable String mapType) {
    int typeId = MAP_TYPES.get(mapType);
    mapView.getMap().setMapType(typeId);
}
项目:react-native-camera-master    文件:CameraViewManager.java   
@ReactProp(name = "startCapture")
public void startCapture(CameraView view, @Nullable String flagValue) {
    if (flagValue.equals("true")) {
        view.takePicture();
    }
}
项目:react-native-android-admob    文件:ReactAdMobManager.java   
@ReactProp(name = "src")
public void setSrc(AdView view, String src) {
    //Log.d("ReactAdMobManager", "inside set src");
}
项目:react-native-android-blurryoverlay    文件:BlurryOverlayManager.java   
@ReactProp(name = "radius", defaultInt = 0)
public void setRadius(BlurryOverlayView view, int radius) {
    view.setRadiusAndUpdate(radius);
}
项目:react-native-android-blurryoverlay    文件:BlurryOverlayManager.java   
@ReactProp(name = "sampling", defaultInt = 0)
public void setSampling(BlurryOverlayView view, int sampling) {
    view.setSamplingAndUpdate(sampling);
}
项目:react-native-android-blurryoverlay    文件:BlurryOverlayManager.java   
@ReactProp(name = "color")
public void setColor(BlurryOverlayView view, String color) {
    view.setColorAndUpdate(color);
}
项目:react-native-android-iconify    文件:ReactIconTextViewManager.java   
@ReactProp(name = ViewProps.FONT_SIZE, defaultInt = 0)
public void setTextSize(IconTextView view, Integer size) {
    Log.i("IconTextView", "setTextSize: "+ size + " | " + ViewProps.FONT_SIZE);
    view.setTextSize(size);
}
项目:react-native-android-iconify    文件:ReactIconTextViewManager.java   
@ReactProp(name = PROP_ICON)
public void setText(IconTextView view, @Nullable String text) {
    Log.i("IconTextView", "setText: "+ text);
    view.setText(text);
}
项目:react-native-android-iconify    文件:ReactIconTextViewManager.java   
@ReactProp(name = PROP_COLOR, customType = "Color")
public void setTextColor(IconTextView view, @Nullable Integer color) {
    Log.i("IconTextView", "setTextColor: " + color );
    view.setTextColor(color);
}
项目:react-native-maps    文件:PPTGoogleMapManager.java   
/**
 * 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.
}
项目:BaiduMapKit    文件:BaiduMapViewManager.java   
/**
 * 地图模式
 *
 * @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);
}
项目:BaiduMapKit    文件:BaiduMapViewManager.java   
/**
 * 实时交通图
 *
 * @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);
}
项目:BaiduMapKit    文件:BaiduMapViewManager.java   
/**
 * 实时道路热力图
 *
 * @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);
}