mirror of
https://github.com/status-im/react-native-webview.git
synced 2026-08-31 19:51:10 +00:00
feat(android): Add androidLayerType as prop (#1588)
* Add androidLayerType as a prop * Deprecate "androidHardwareAccelerationDisabled" prop * Update reference Co-authored-by: Olivia Caraiman <olcaraim@microsoft.com>
This commit is contained in:
co-authored by
Olivia Caraiman
parent
2a95296ddd
commit
9ffca8f9db
@@ -299,6 +299,21 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
|
||||
}
|
||||
}
|
||||
|
||||
@ReactProp(name = "androidLayerType")
|
||||
public void setLayerType(WebView view, String layerTypeString) {
|
||||
int layerType = View.LAYER_TYPE_NONE;
|
||||
switch (layerTypeString) {
|
||||
case "hardware":
|
||||
layerType = View.LAYER_TYPE_HARDWARE;
|
||||
break;
|
||||
case "software":
|
||||
layerType = View.LAYER_TYPE_SOFTWARE;
|
||||
break;
|
||||
}
|
||||
view.setLayerType(layerType, null);
|
||||
}
|
||||
|
||||
|
||||
@ReactProp(name = "overScrollMode")
|
||||
public void setOverScrollMode(WebView view, String overScrollModeString) {
|
||||
Integer overScrollMode;
|
||||
|
||||
Reference in New Issue
Block a user