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:
oliviacaraiman
2020-08-24 14:23:38 +02:00
committed by GitHub
co-authored by Olivia Caraiman
parent 2a95296ddd
commit 9ffca8f9db
4 changed files with 51 additions and 1 deletions
+20 -1
View File
@@ -35,6 +35,7 @@ This document lays out the current public properties and methods for the React N
- [`javaScriptEnabled`](Reference.md#javascriptenabled)
- [`javaScriptCanOpenWindowsAutomatically`](Reference.md#javascriptcanopenwindowsautomatically)
- [`androidHardwareAccelerationDisabled`](Reference.md#androidHardwareAccelerationDisabled)
- [`androidLayerType`](Reference.md#androidLayerType)
- [`mixedContentMode`](Reference.md#mixedcontentmode)
- [`thirdPartyCookiesEnabled`](Reference.md#thirdpartycookiesenabled)
- [`userAgent`](Reference.md#useragent)
@@ -781,7 +782,7 @@ A Boolean value indicating whether JavaScript can open windows without user inte
### `androidHardwareAccelerationDisabled`[⬆](#props-index)<!-- Link generated with jump2header -->
Boolean value to disable Hardware Acceleration in the `WebView`. Used on Android only as Hardware Acceleration is a feature only for Android. The default value is `false`.
**Deprecated.** Use the `androidLayerType` prop instead.
| Type | Required | Platform |
| ---- | -------- | -------- |
@@ -789,6 +790,24 @@ Boolean value to disable Hardware Acceleration in the `WebView`. Used on Android
---
### `androidLayerType`[⬆](#props-index)<!-- Link generated with jump2header -->
Specifies the layer type.
Possible values for `androidLayerType` are:
- `none` (default) - The view does not have a layer.
- `software` - The view has a software layer. A software layer is backed by a bitmap and causes the view to be rendered using Android's software rendering pipeline, even if hardware acceleration is enabled.
- `hardware` - The view has a hardware layer. A hardware layer is backed by a hardware specific texture and causes the view to be rendered using Android's hardware rendering pipeline, but only if hardware acceleration is turned on for the view hierarchy.
Avoid setting both `androidLayerType` and `androidHardwareAccelerationDisabled` props at the same time, as this may cause undefined behaviour.
| Type | Required | Platform |
| ------ | -------- | -------- |
| string | No | Android |
---
### `mixedContentMode`[⬆](#props-index)<!-- Link generated with jump2header -->
Specifies the mixed content mode. i.e WebView will allow a secure origin to load content from any other origin.