Summary:
Potential Fix to #19793
modified the code and tried to recreate the bug and was unable to. The red screen never popped up and nothing else seemed to be affected in a negative way.
[ANDROID] [BUGFIX] [FrameBasedAnimationDriver.java] - Safely unwrapping ReadableMap by defaulting to 0 if key not present.
Pull Request resolved: https://github.com/facebook/react-native/pull/19808
Differential Revision: D8960388
Pulled By: hramos
fbshipit-source-id: 400cc0467e041dfcf2d6b1ec0b61d716c2de159f
Summary:
This PR will bump NDK_TOOLCHAIN_VERSION to 4.9 or use GCC 4.9 to build C++ code. Once merged, we can bump folly to a newer version, which requires GCC 4.9.
Pull Request resolved: https://github.com/facebook/react-native/pull/19945
Reviewed By: fkgozali
Differential Revision: D8943282
Pulled By: hramos
fbshipit-source-id: d239ca67a08788b12e115a9d78443b13a10403f6
Summary:
Set clipChildren to false by default in ReactRootView.java so that Overflow: visible/hidden will work for the root view.
Moved sDefaultOverflowHidden from ReactViewGroup.java to ViewProps.java so that it can be used in both ReactViewGroup.java and ReactRootView.java.
Reviewed By: mdvacca
Differential Revision: D8727140
fbshipit-source-id: b593bed63e479cdbd22e4a025b936e6aeb28fc8c
Summary: Fix ReactHorizontalScrollView so that its children won't overflow. (Task: https://our.intern.facebook.com/intern/tasks/?t=31128239)
Reviewed By: achen1
Differential Revision: D8923947
fbshipit-source-id: 56c36b25c29a87a306d92544273603d0d086edc0
Summary:
Problem: The first ReactTextInputShadowNode layout calculation didn't consider the placeholder. When the layout with placeholder was actually being measured, its height was constraint by the previously calculated height, causing long placeholder content to be clipped.
Fix: Access the placeholder property in ReactTextInputShadowNode, set the dummyEditText's hint with placeholder before ReactTextInputShadowNode's first measurement.
Reviewed By: mdvacca
Differential Revision: D8903108
fbshipit-source-id: 8f3e518d0395ac875807f9ea989a0b5bbe4b2a26
Summary: Fix the calculation of offsetX in onLayout (ReactHorizontalScrollContainerView.java) that re-positions the updated layout. A private instance variable (oldWidth) is added in order to track the width difference between consecutive updates. (Issue report: https://github.com/facebook/react-native/issues/19979)
Reviewed By: mdvacca
Differential Revision: D8772780
fbshipit-source-id: 969dcead550f4a3d24d06416b63d960492b7a124
Summary:
Context:
After discussing with @[1038750002:yungsters], `currentViewStates` is a very ambiguous name for a prop, especially because there are only two possible values. From a developer's perspective, it makes more sense to just call them `accessibilityStates` because the main use for them is to add states to Talkback and Voiceover.
Defense for changing name in Android: The actual implementation of what we're changing under the hood in Native Code is abstracted away from developers using React Native, so as long as behavior is as they would expect, it makes more sense to change the name into a clear one regardless of how it is implemented.
Changes:
changed the Prop name from `currentViewStates` to `accessibilityStates` in the BaseViewManager file where the view property is being exposed.
Reviewed By: PeteTheHeat
Differential Revision: D8896389
fbshipit-source-id: 35dcd9239fae016b790e528947994681684bd654
Summary:
Currently, `AccessibilityInfo.setAccessibilityFocus` is only available on iOS. The same behaviour can be achieved on Android by dispatching the proper accessibility event. I implemented the same function for Android, to make life slightly more convenient for the developer.
Today, developers must write something like this:
```
if (Platform.OS === 'ios') {
AccessibilityInfo.setAccessibilityFocus(reactTag)
} else {
UIManager.sendAccessibilityEvent(reactTag, 8)
}
```
With this change, the following is enough for both Android and iOS:
```
AccessibilityInfo.setAccessibilityFocus(reactTag)
```
Pull Request resolved: https://github.com/facebook/react-native/pull/20229
Differential Revision: D8874107
Pulled By: mdvacca
fbshipit-source-id: a6ffd7bb89ce56d6d65b06419633a71dcf3d0733
Summary: Trying to see what it takes to get server snapshot tests working on android. This will be landed after fixing few things.
Reviewed By: achen1
Differential Revision: D8237948
fbshipit-source-id: 926555ba752171dac4e5814f5c8e5c2c173a82c7
Summary:
Added native android support for the prop accessibilityStates.
If 'selected' is passed in, it calls view.setSelected(true)
If 'disabled' is passed in, it calls view.setEnabled(false)
If both are passed in, both are set on the view.
Reviewed By: blavalla
Differential Revision: D8838407
fbshipit-source-id: a942dabcdc5d9e35f0316465e97317739a8b4b25
Summary: This diff initializes Fabric C++ UIManager code from java, it also registers android RootViews inside C++.
Reviewed By: shergin
Differential Revision: D8794819
fbshipit-source-id: b4d1d0958a3f8e01d4a51be957d9a2e2f442489e
Summary: This diff creates the C++ base classes for Fabric and it integrates them into the starting process of Fabric inside Catalyst App
Reviewed By: shergin
Differential Revision: D8786185
fbshipit-source-id: d04208f0781387424fc0ddf7a6e5d46a6bd61f66
Summary:
The keep-alive-duration for the connection pool for mOnChangePollingClient
is a number in milliseconds, but was mistakenly given in minutes. This mistake
was introduced in 6bbaff2944.
I discovered this by chance while lurking around in the codebase.
Pull Request resolved: https://github.com/facebook/react-native/pull/19817
Differential Revision: D8873138
Pulled By: hramos
fbshipit-source-id: c81c1952721449442f18a0c2373f8b2780403749
Summary:
Because we're now separating accessibilityTraits into accessibilityRole and accessibilityState, we're going to only allow one role to be set, and allow on preset combinations of roles that make sense.
This adds android functionality for an added role that is image button.
Reviewed By: blavalla
Differential Revision: D8846987
fbshipit-source-id: 9fe36828f63b05bd2c9cf9680204b1995d678342
Summary:
Added the android functionality for those three roles: search, adjustable, and link.
Until React Native internal framework ports internationalization and localization of strings, I'll handle localization by allowing an extra prop to be passed in that can override talkback's description in another language if needed.
Reviewed By: blavalla
Differential Revision: D8807692
fbshipit-source-id: b51877d187cb6cb663d65d6b4d072e6dc52a2d03
Summary:
Cleanup clang compiler warnings.
The last version delete some variables that still used in code.
Fix the problem and try to launch again.
Reviewed By: hershi
Differential Revision: D8704442
fbshipit-source-id: 8bd37fc9f2b27104fe15c4c8b8323e2bfd8c1060
Summary: Removed Accessibility Trait TabBar for iOS compatibility Issues, since tabbar is only available on iOS 10+
Reviewed By: PeteTheHeat
Differential Revision: D8822469
fbshipit-source-id: 34bf00eb930f631a5a4effa0a4159da07c1573f6
Summary:
Brings back the fix for `overflow: hidden` on Android by implementing a workaround for a bug with `ReactNativeART`.
The ReactNativeART bug is that changes in the canvas due to a resize of the `Surface` are not properly reflected on Android. I have verified that the correct props are being computed and passed to the shadow nodes and that the `ARTSurfaceView`'s canvas is indeed updated. But for some reason, the paint is not updated.
This workaround is to simply unmount and remount `Surface` on Android. It sucks and we should eventually fix it.
Reviewed By: achen1
Differential Revision: D8818010
fbshipit-source-id: 71d1927580b6bde7263fd241797d4655140b5f34
Summary:
Replaces two nested if-blocks with guards. This is intended to help with restructuring this function in follow-ups.
@public
Reviewed By: priteshrnandgaonkar
Differential Revision: D8785659
fbshipit-source-id: 7b9d63e9814b83b999397c016ad67ad348bb0f72
Summary:
Added a new property to View for Accessibility called `accessibilityRole`. This property merges functionality of existing properties: `accessibilityTraits` (iOS) and `accessibilityComponentType` (android).
Currently, nine values are supported with equivalent behavior as `accessibilityTraits` (iOS) when `accessibilityRole` is set on iOS Voiceover and Android TalkBack
```
| 'none'
| 'button'
| 'link'
| 'search'
| 'image'
| 'keyboardkey'
| 'text'
| 'adjustable'
| 'tabbar'
```
They currently support similar behavior on talkback on Android and voice over on iOS
Does not break functionality of existing properties, but have not tested for behavior of setting both this one and the old one.
* iOS - I added a property accessibilityRoles, and basically remapped it to the same thing as accessibilityTraits. I also added in enum mappings for keyboardkey and tabbar.
* Android - Also added a property accessibilityRoles, from the Android side. For the underlying native functionality, I built a helper class that is based off of AccessibilityRolesUtil.java from the accessibility team. Biggest changes made are that I defined my own enums if needed, and also set some properties to match the functionality of iOS Accessibility Traits. I also handled the logic for switch/case statements of setting roles for the android side on this file. Also, I currently haven't localized strings for setRoleDescription, but plan to.
* Javascript - I added a view property accessibilityRoles in ViewPropTypes.
Reviewed By: blavalla
Differential Revision: D8756225
fbshipit-source-id: e03eec40cce86042551764f433e1defe7ee41b35
Summary: Image source null which is in RC D8628053 has a bug which has a fix but didn't make to RC. Reverting so it can be cleaned up before going in RC.
Reviewed By: achen1
Differential Revision: D8751687
fbshipit-source-id: e08b23a031455be23047880871813bdc840542dd
Summary: This makes it possible to specify an optional Request.Builder when calling `downloadBundleFromURL` (the old method still works as usual).
Reviewed By: davidaurelio
Differential Revision: D8691303
fbshipit-source-id: 2fb2aecd3506355c6b3a72457a7bb9acfd03b18d
Summary:
It looks like for some reason when ReactViewGroup uses setClipChildren(false), the ReactNativeARTSurface no longer redraws when its width is expanded.
Disable this new overflow behavior until the underlying issue is fixed.
Reviewed By: achen1
Differential Revision: D8739003
fbshipit-source-id: ffae0e3eb0cd8ce385eae33a87b5ba0325cae3c4
Summary:
Adds a kill switch that reverts the default behavior of `overflow` to be hidden again. The intent of this kill switch is to give applications more time to migrate if necessary (e.g. if they are depending on third party packages with native components that are not compatible with `overflow` being visible by default).
To use the flag, simply set:
import com.facebook.react.views.view.ReactViewGroup;
// Somewhere in the initialization of your application.
ReactViewGroup.sDefaultOverflowHidden = true;
Reviewed By: achen1
Differential Revision: D8718963
fbshipit-source-id: 0eb9aee45dfe04e9ae34d86e3bedcd30a185ef82
Summary:
Fixes `ReactScrollView` so that it respects the drawing rect (i.e. the bounding box of the element).
In JavaScript, this is the backing view for `ScrollView` (vertical) on Android.
Reviewed By: fadinghorse
Differential Revision: D8710256
fbshipit-source-id: f3bd96e39b8569cfcb21e486944b70fdb57c12b6
Summary:
Removes the concept of instance handle. Instead we pass the event target
to createNode and don't pass it to subsequent clones.
The life time of the event target is managed by native (the event emitter).
It has to be released manually.
Reviewed By: shergin
Differential Revision: D8688330
fbshipit-source-id: e11b61f147ea9ca4dfb453fe07063ed06f24b7ac
Summary:
Adds support for the `overflow` style property on React Native for Android.
This is the second attempt to do this. See 6110a4cc75 (D8666509) for the first attempt.
Similar to the first attempt, this sets `setClipChildren(false)` by default on all `ViewGroup` instances. However, this differs in how it implements `overflow: hidden`. Instead of conditionally setting `setClipChildren`, this manually clips children to the `ViewGroup`'s bounds (which was incidentally what we were doing for background + border radius already).
Reviewed By: achen1
Differential Revision: D8690805
fbshipit-source-id: 58757825cd9d138c18c8758918d85b4ca1915f87
Summary:
Tidies up the hardcoded strings for referencing the `overflow` style values.
Also, the `OVERFLOW` case in the optimized view flattening code path is unnecessary because `OVERFLOW` is already in the `LAYOUT_ONLY_PROPS` set.
Reviewed By: achen1
Differential Revision: D8690804
fbshipit-source-id: 3befbe93ed761e57e45f9b50e59bffc8a29a407f
Summary:
Reverts D8666509. Unfortunately, I misunderstood `setClipChildren` on Android.
When set on a `ViewGroup`, `setClipChildren` configures whether its //children// — not itself — are clipped to their bounds. This is unlike `overflow` (as it behaves on iOS) which configures whether the view itself is clipped to its bounds.
But they are definitely related. In theory, I think we could implement `overflow` using `setClipChildren` by:
- Setting `setClipChildren(false)` by default. (This part, I got right.)
- When `overflow` is set to `hidden` on a `View`, we create an extra `ViewGroup` (child) within the normal `ViewGroup` (parent). Then, we can set `setClipChildren(true)` on the parent `ViewGroup` which will cause the child `ViewGroup` to be clipped to its bounds.
However, I think the tricky thing will be to create the child `ViewGroup` without incurring unintentional side effects.
I need to decide whether or not this is worth trying. The alternative is to add a new `clipChildren` boolean prop that is Android-only, but I really hate further bifurcating the platform. But for now, I am reverting my mistake.
Reviewed By: achen1
Differential Revision: D8690551
fbshipit-source-id: 1ba3bbcc5458ffbd5c475430ea0382b3fd0916b2
Summary:
This diff refactors the cloning mechanism for YogaNode used from Fabric UI renderer and RN iOS graphs.
Previously, we were cleaning the owner of the child's cloned node inside the C++ implementation of YogaNode. This was a mistake because this modified the last commited YogaTree, causing side effect in RN iOS graphs.
Reviewed By: shergin
Differential Revision: D8672627
fbshipit-source-id: c9902d00690e0361fd58aed84b506c42258bd995
Summary:
This PR sets gradle targetSdkVersion to 26, which will satisfy new requirements from Play Store. Also removed redundant config from manifest files.
Closes https://github.com/facebook/react-native/pull/19944
Differential Revision: D8679682
Pulled By: hramos
fbshipit-source-id: 5c900d47be1d8b81ce340e38a05d9b309da143c3
Summary:
Adds support for the `overflow` style property on React Native for Android.
This switches overflowing views to be visible by default with the ability to override this at the container level using `overflow: 'hidden'`. This is the same behavior as React Native on iOS.
One major caveat to this solution is that it uses `setClipChildren` which does not extend the hit target to the overflow draw regions. While this is a pitfall, the current state of React Native on Android where `overflow` is hidden by default (which is the opposite of iOS) is also a huge pitfall. But I think this moves us in the right direction because where you *don't* need the touch behavior, you are now able to leverage overflow draws.
Reviewed By: himabindugadupudi
Differential Revision: D8666509
fbshipit-source-id: 5e98e658e16188414016260224caa696b4fbd390
Summary:
This reverts 5898817fc "Implement letterSpacing on Android >= 5.0".
Testing shows that that commit is the cause of #19126, where in a
controlled TextInput after some text is first added, then deleted,
further interaction with the TextInput becomes extremely slow.
Fixes#19126.
Tried the repro case from #19126 without this change, then with it.
The issue reproduces, then doesn't.
Closes https://github.com/facebook/react-native/pull/19645
Differential Revision: D8675230
Pulled By: hramos
fbshipit-source-id: e2c2d352ee781898721b2dff4738572d1a6b7471
Summary:
@public
Apps may need to listen for custom commands via the packager connection. This allows registering such listeners.
Reviewed By: raluca-elena
Differential Revision: D8654477
fbshipit-source-id: 5f17298a88fec31b8939236fef48ee46c0ba2ee8
Summary:
bump glog to 0.3.5.
Version 0.3.4 added support for libc++ or clang. Starting with revision 11, Android NDK recommends and defaults to clang, so it'll add support for it.
notable changes in 0.3.4 and 0.3.5:
* add libc++ support
* reduce dynamic allocation from 3 to 1 per log message
* style fix for C++11
* Add CMake support
Closes https://github.com/facebook/react-native/pull/19890
Differential Revision: D8662179
Pulled By: hramos
fbshipit-source-id: ae2554d36e5b922e8649fc2ac7afc273a34cc127
Summary:
bump double conversion to 1.1.6.
Version 1.1.2 added ARM 64 support, so it's a step to add support for 64bit in RN.
Closes https://github.com/facebook/react-native/pull/19885
Differential Revision: D8662108
Pulled By: hramos
fbshipit-source-id: 446d83eab4df90efed9c08eac912e7f857b7f253