use of com.facebook.react.uimanager.annotations.ReactProp in project react-native-fbads by callstack.
the class BannerViewManager method setSize.
@ReactProp(name = "size")
public void setSize(BannerView view, int size) {
AdSize adSize = null;
switch(size) {
case 90:
adSize = AdSize.BANNER_HEIGHT_90;
break;
case 250:
adSize = AdSize.RECTANGLE_HEIGHT_250;
case 50:
default:
adSize = AdSize.BANNER_HEIGHT_50;
}
view.setSize(adSize);
}
use of com.facebook.react.uimanager.annotations.ReactProp in project react-native-video by react-native-community.
the class ReactExoplayerViewManager method setSrc.
@ReactProp(name = PROP_SRC)
public void setSrc(final ReactExoplayerView videoView, @Nullable ReadableMap src) {
Context context = videoView.getContext().getApplicationContext();
String uriString = src.hasKey(PROP_SRC_URI) ? src.getString(PROP_SRC_URI) : null;
String extension = src.hasKey(PROP_SRC_TYPE) ? src.getString(PROP_SRC_TYPE) : null;
if (TextUtils.isEmpty(uriString)) {
return;
}
if (startsWithValidScheme(uriString)) {
Uri srcUri = Uri.parse(uriString);
if (srcUri != null) {
videoView.setSrc(srcUri, extension);
}
} else {
int identifier = context.getResources().getIdentifier(uriString, "drawable", context.getPackageName());
if (identifier == 0) {
identifier = context.getResources().getIdentifier(uriString, "raw", context.getPackageName());
}
if (identifier > 0) {
Uri srcUri = RawResourceDataSource.buildRawResourceUri(identifier);
if (srcUri != null) {
videoView.setRawSrc(srcUri, extension);
}
}
}
}
use of com.facebook.react.uimanager.annotations.ReactProp in project gl-react-native by ProjectSeptemberInc.
the class GLCanvasManager method setPointerEvents.
@ReactProp(name = "pointerEvents")
public void setPointerEvents(GLCanvas view, @Nullable String pointerEventsStr) {
if (pointerEventsStr != null) {
PointerEvents pointerEvents = PointerEvents.valueOf(pointerEventsStr.toUpperCase(Locale.US).replace("-", "_"));
view.setPointerEvents(pointerEvents);
}
}
use of com.facebook.react.uimanager.annotations.ReactProp in project react-native-fbads by callstack.
the class NativeAdViewManager method setAdsManager.
@ReactProp(name = "adsManager")
public void setAdsManager(NativeAdView view, String adsManagerId) {
NativeAdManager adManager = mReactContext.getNativeModule(NativeAdManager.class);
NativeAdsManager adsManager = adManager.getFBAdsManager(adsManagerId);
view.setNativeAd(adsManager.nextNativeAd());
}
Aggregations