Commit Graph

4271 Commits

Author SHA1 Message Date
TMaszko d92284216f Fix: Preserve native animated value after animated component unmount (#28841)
Summary:
After animation has been finished using Native driver there is no final value passed from the native to JS side. This causes a bug from https://github.com/facebook/react-native/issues/28114.

This PR solves this problem in the same way as `react-native-reanimated` library. When detaching it is calling native side to get the last value from Animated node and stores it on the JS side.

Preserving animated value even if animation was using `useNativeDriver: true`
Fixes https://github.com/facebook/react-native/issues/28114

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Internal] [Fixed] - Save native Animated node value on JS side in detach phase
Pull Request resolved: https://github.com/facebook/react-native/pull/28841

Test Plan: Unit tests for added getValue method passed. Green CI

Reviewed By: mdvacca

Differential Revision: D22211499

Pulled By: JoshuaGross

fbshipit-source-id: 9a3a98a9f9a8536fe2c8764f667cdabe1f6ba82a
2020-06-29 17:09:37 -07:00
fabriziobertoglio1987 0fda91ffff Adding Hyphenation Frequency prop for Text component (#29157)
Summary:
This issue fixes https://github.com/facebook/react-native/issues/28279
android_hyphenationFrequency prop for Android Text component which sets the frequency of automatic hyphenation to use when determining word breaks.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Fixed] - Adding Hyphenation Frequency prop for Text component
Pull Request resolved: https://github.com/facebook/react-native/pull/29157

Test Plan:
More info are available in the [android docs](https://developer.android.com/reference/android/widget/TextView#setHyphenationFrequency(int)). I will add the documentation to the docs later once the pull request is taken in consideration for merging.

| **AFTER** |
|:-------------------------:|
|  <img src="https://user-images.githubusercontent.com/24992535/84919245-f8f1e300-b0c1-11ea-8a33-f30d0c9a75b7.png"  width="300" height="" />|

I remain available to do improvements. Thanks a lot. Fabrizio.

Reviewed By: TheSavior

Differential Revision: D22219548

Pulled By: JoshuaGross

fbshipit-source-id: 7e2523c25adfcd75454f60184eb73dc49891bef7
2020-06-29 16:57:12 -07:00
Joshua Gross 0b63c94648 Ship early ViewCommand dispatch everywhere
Summary:
Early ViewCommand dispatch: ship the experiment everywhere on Android.

Since ViewCommands are totally divorced from the commit cycle currently, and since they are inherently unsafe, we can create a separate queue for them
and retry them if they fail with a specific category of exceptions.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22173050

fbshipit-source-id: 494b7c6b5dfd2aec8ba77ae35d0d58d4d727b9b4
2020-06-29 15:45:11 -07:00
Joshua Gross 0a115d9c3f Ship MountItem Remove/Delete Collation
Summary:
Ship MountItem Remove/Delete Collation.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22170891

fbshipit-source-id: a9a149783bdd69df54e429da6ed9870bfb405a36
2020-06-29 15:45:11 -07:00
David Vacca 7abcaafd66 Fix crash when updating dialog props after the Activity has disappeared
Summary:
This diff avoids accessing window and activities object that has dissapear

changelog: [Android][Fix] Fix crash when updating RN dialog props after the activity disappeared

Reviewed By: JoshuaGross

Differential Revision: D22264672

fbshipit-source-id: 89c9895c8c6b6fec383a0e160847e5059616e265
2020-06-29 15:29:21 -07:00
Omer Peleg 530d11c506 Fix RN OSS build (#29221)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/29221

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D22234372

fbshipit-source-id: 9b83ec3aa57254826be44ac0f73aeb34fb859337
2020-06-25 11:09:42 -07:00
Lee Callender 0967e7b26d Move ImageEditor Android files to FB Internal.
Summary: Changelog: [Android] [Removed] - Migrated ImageEditingManager to FB internal.

Reviewed By: cpojer

Differential Revision: D22123807

fbshipit-source-id: 24c3b3554f5e6152b70750a6c8212b3d3b66678f
2020-06-22 19:20:24 -07:00
David Vacca 75e6f7961f Fix measure of ReactSlider for Android API < 21
Summary:
This diff avoids calling to the method setStateListAnimator for users running in Android API < 21 (This method did not exist in Android API < 21)

changelog: [Android][Fix] Fix crash while measuring ReactSlider in Android API < 21

Reviewed By: lunaleaps

Differential Revision: D22164574

fbshipit-source-id: 8163f99eeb78302fc75e2c4938330c699ca8d363
2020-06-22 12:42:41 -07:00
Joshua Gross e661a551cb Potential fix for, and more diagnostics for, NativeAnimatedModule crash
Summary:
Searching for details and maybe a fix for T68843308 crashing in disconnectFromView, "Attempting to disconnect view that has not been connected with the given animated node".

May be related to recent refactoring but it's not clear. Change logic slightly and add more diagnostic information.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D22153179

fbshipit-source-id: b95dbaf01ae8bca154c61442898b0f9d3aebb4de
2020-06-20 17:47:29 -07:00
Joshua Gross 9760a326c9 Fix MountingManager NPE
Summary:
Fix NullPointerException.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D22153157

fbshipit-source-id: 77be1456a2b7f6429d2dce6eac5d9d0bca362c27
2020-06-20 17:41:02 -07:00
David Vacca f8bcb1063e Cleanup updateState method on TextInputManager
Summary:
Quick refactor to cleanup the updateState method on TextInputManager

changelog:[internal]

Reviewed By: JoshuaGross

Differential Revision: D22149752

fbshipit-source-id: 0461b1769b9a7a3b25257bbf2039dc461a164c6f
2020-06-19 21:50:43 -07:00
David Vacca 85669d8c30 EZ fix typo
Summary:
Fix typo in TextInput classes

changelog:[internal]

Reviewed By: JoshuaGross

Differential Revision: D22149753

fbshipit-source-id: f5d1f5ee8bea82e049ead7ca2664e46cdcd961a0
2020-06-19 21:50:43 -07:00
David Vacca 8cbbd93c40 Refactor Text input state
Summary:
This diff refactors the theme management for text input in order to avoid extra state updates.

changelog:[Internal]

Reviewed By: JoshuaGross

Differential Revision: D22149754

fbshipit-source-id: 8a6dbe63c8d532986dbf785c7b16323e0a980669
2020-06-19 21:50:43 -07:00
Joshua Gross 304c5d54ec MountingManager debug tool: show view hierarchies before and after remove/insert operations
Summary:
This is a useful debugging tool that will not be compiled by default, and we have some protection to only compile it in Debug builds so it's less likely to accidentally slip into production.

This has been useful for debugging C++ LayoutAnimations, since Remove/Insert mutations are delayed and fiddled around with a little.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22148853

fbshipit-source-id: 05609507cdf06b73fd3edf5cf7bc95e124ff1135
2020-06-19 20:28:05 -07:00
Joshua Gross e5a4d9550e Replace direct ViewManager calls to old UIManager with Fabric/Venice-compatible calls
Summary:
Replace direct ViewManager calls to old UIManager with Fabric/Venice-compatible calls.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22111396

fbshipit-source-id: 2de9df5a4b494f82049dba62325ee3119c80d3c3
2020-06-19 11:15:57 -07:00
Joshua Gross d183fd327b Improve MountingManager diagnostics around View removal
Summary:
It is possible (most recently, if there are bugs in LayoutAnimations, but also in general) to issue a `removeViewAt` MountItem that removes the incorrect view if, for whatever reason, the View hierarchy has become "corrupt"
and Views are out of order. I added two heuristics to catch if that happens: check the tag of the View being removed if possible, and ensure that all deleted views do not have a parent. This will turn weird visual glitches into
hard crashes, which we want once the UI has become corrupt.

My only concern here is with perf; maybe we could put these behind a debug-only flag or something, but it's probably not a huge deal.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22130186

fbshipit-source-id: 0942b019c3449d68edfb9db1fe8130ea351d1d8f
2020-06-19 11:13:35 -07:00
Tim Yung 64860972be RN: Adjust Image Blur on Android
Summary:
Adjusts the behavior of `blurRadius` for `Image` on Android so that it behaves more closely to other platforms (web and iOS).

Changelog:
[Android][Changed] - Effect of `blurRadius` now more closely matches other platforms.

Reviewed By: shergin

Differential Revision: D22118680

fbshipit-source-id: c6d14aef29b4a086e43badfa78407bfa07f9fee2
2020-06-18 14:46:49 -07:00
Lulu Wu e6fc20ee68 Keyframes is not implemented in Fabric Android
Summary:
Implement Keyframes in Fabric Android

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D21952500

fbshipit-source-id: 6ba3af1afea227d58b6b12c1be629698d309a04d
2020-06-17 15:25:18 -07:00
Oleksandr Melnykov 6afc984e81 Update loading banner text and colors
Summary: This diff updates the loading banner text and color on Android to match its style on iOS.

Differential Revision: D22066823

fbshipit-source-id: 7f8d6cf1a6c4c48babe919995044978d7a81c674
2020-06-17 09:10:51 -07:00
Oleksandr Melnykov fca3a39da5 Add native module for loading split JS bundles in development
Reviewed By: mdvacca, cpojer

Differential Revision: D22001709

fbshipit-source-id: 4e378fd6ae90268e7db9092a71628205b9f7c37d
2020-06-17 09:10:51 -07:00
Joshua Gross 2e2c881147 NativeAnimatedModule should not crash if UIManager disappears
Summary:
If UIManager disappears, it's likely due to (1) teardown due to memory pressure, (2) teardown due to crash, (3) normal teardown.

In all of those cases, I would just want NativeAnimatedModule to stop executing and fail silently ASAP.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22079209

fbshipit-source-id: 21650abdfdb119a6f4abccd6962d0c09f7c7c6cd
2020-06-16 17:04:22 -07:00
Tim Yung fa0e6f8051 RN: Image Progress Event on Android
Summary:
Adds support for the `onProgress` event on `Image`, for Android.

Since Fresco does not provide a progress listener on `ControllerListener`, this uses a forwarding progress indicator `Drawable` to pass along values from `onLevelChange`.

Caveat: The ratio between `loaded` and `total` can be used, but `total` is currently always 10000. It seems that Fresco does not currently expose the content length from the network response headers.

Changelog:
[Android][Added] - Adds support for the `onProgress` event on `Image`

Reviewed By: mdvacca

Differential Revision: D22029915

fbshipit-source-id: 66174b55ed01e1a059c080e2b14415e7d268bc5c
2020-06-16 15:01:05 -07:00
Tim Yung 74ab8f6e5a RN: Consistent API for Image Events
Summary:
Changes the `onLoad` and `onError` events on `Image` to be consistent with each other and with the `ImageSource` type.

Changelog:
[Android][Breaking] - On `Image`, `onLoad` and `onError` event objects will no longer have an extra `uri` property.
[Android][Breaking] - On `Image`, `onLoad` event objects' `source.url` is now renamed to `source.uri`.
[iOS][Breaking] - On `Image`, `onLoad` event objects' `source.url` is now renamed to `source.uri`.

Reviewed By: mdvacca

Differential Revision: D22023565

fbshipit-source-id: 5ea7904c697f87e01118bdb81ed50ab0a5aecdce
2020-06-16 15:01:05 -07:00
Tim Yung 90997c26e3 RN: Cleanup ImageLoadEvent Logic (Android)
Summary:
Cleans up `ImageLoadEvent` to minimize constructor confusion and to make the dispatching logic more predictable.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D22023141

fbshipit-source-id: 17e66de867f51121a3f9a6b782dbad700a54231a
2020-06-16 15:01:05 -07:00
Joshua Gross b69041f086 Feature-flag gate stopSurface on root view unmount
Summary:
Gate stopSurface behind a feature flag.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22054480

fbshipit-source-id: 3ea48ab46aeb3532fc7a3dd83659d7c32891ec06
2020-06-15 18:43:30 -07:00
Joshua Gross 33ed358330 Bust surfaceActiveForExecution cache after executing a batch of items
Summary:
Since we were not busting the `surfaceActiveForExecution` cache, it is very possible (likely, even!) that a surfaceId is invalidated in between UI ticks but we keep executing items for that surface at the next tick.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22055303

fbshipit-source-id: 351c13535e85b30e00684fe35fc4aa79ccb5961c
2020-06-15 18:05:19 -07:00
David Vacca 6d6268e903 Fix padding flickering visible during initial render of text input
Summary:
This diff fixes a race condition that caused a flicker during initial rendering of TextInput in Fabric

The root cause is that the TextInput's State is sometimes initialized with no information from the Theme, this causes text input to be rendered with 0 padding. Later ReactTextInput manager updates TextInput state with theme data and the TextInput is re-rendered with the correct padding information.

changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D22034849

fbshipit-source-id: a2fa91f34a8340878f2ec8d231ef6c86cee08f05
2020-06-13 22:20:04 -07:00
David Vacca 1e453860d0 Ensure that layout events contain the correct padding information
Summary:
This diff changes the order of execution for the "updatePadding" mount item
Padding mountItems must be executed before layout props are updated in the view. This is necessary to ensure that events (resulting from layout changes) are dispatched with the correct padding information.

This fixes a 'flickering' bug in Marketplace Vehicles (see test plan)

changelog:[internal]

Reviewed By: JoshuaGross, sammy-SC

Differential Revision: D22034850

fbshipit-source-id: 222fa9412dd01f65a1a034f53e1eb0e7b774ec1f
2020-06-13 22:20:04 -07:00
Joshua Gross 86c38739a7 Avoid using ViewManager childCount to detect errors, since it's not reliable
Summary:
Similar to D21756178, we cannot rely on childCount since it can return zero when there are actually valid children. This both causes more exceptions than necessary when the operation would work, and pollutes error messages since the information is not strictly reliable.

Instead, we just try to get a View and thrown an exception when it's null, or in loops, loop until we hit a null child. `getChildAt` doesn't throw exceptions, it just returns null when we're out-of-bounds.

This can impact custom ViewGroups like BottomSheets, and other ViewGroups that might do interesting/weird things with children, including ReactClippingViewManager.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22035569

fbshipit-source-id: 43e98d81178faaf720face98fc84e78743f292c3
2020-06-13 18:31:41 -07:00
Joshua Gross 40b36a040f For lifecycle correctness, call scheduleMountItems even with empty BatchMountItem
Summary:
In particular, NativeAnimatedModule relies on having some signal of when there's a commit from ReactJS. In Fabric, this is the only reliable signal. Failing to call scheduleMountItems even when there's no changes to the tree will result in certain animation operations being delayed way longer than necessary.

I pass nullptr instead of empty arrays in some cases to hopefully improve perf.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22008981

fbshipit-source-id: 6bdeb46e03b5138dbfa5b077952ec0fa3dfe1eb3
2020-06-11 20:46:49 -07:00
Joshua Gross 0d073013a5 Fix typos in Native Animated error messages
Summary:
see title

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22008982

fbshipit-source-id: 056b0d99e8e81a1b11cd054e6c813002ae0b7014
2020-06-11 20:46:49 -07:00
Joshua Gross 472cf3f4ad NativeAnimatedDriver: synchronize animation lifecycle closer to Fabric or Paper lifecycle
Summary:
Switch between "Fabric" and "Non-Fabric" modes based on which types of native Views are being attached to animations. Don't allow non-Fabric to drive Fabric animations and vice-versa.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D21985411

fbshipit-source-id: fb9bef1e38375b384430b4e0275e7b6d62eda7a4
2020-06-11 20:46:48 -07:00
David Vacca f53267f703 Migrate ReactText view to use uiManager.receiveEvent instead of ReactEventEmitter
Summary:
This diff refactors ReactTextView to use uiManager.receiveEvent instead of ReactEventEmitter. ReactEventEmitter.class should be replaced for uiManager.receiveEvent.

changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D21982548

fbshipit-source-id: 4ed5825f62c761564aa533f4e8bb1155036df7e2
2020-06-10 22:56:02 -07:00
David Vacca 95154a6b8b Migrate usages of RCTEventEmitter.class to EventDispatcher
Summary:
This diff migrates usages of RCTEventEmitter.class to EventDispatcher.dispatchEvent.

RCTEventEmitter is not compatible with Fabric, now we need to use EventDispatcher.dispatchEvent instead.

changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D21982549

fbshipit-source-id: 9ea2d9a00f063a03c2e401fc1e328ce26bcf48df
2020-06-10 22:56:02 -07:00
David Vacca a0baba654e Expose receiveEvent as a high level API on UIManager
Summary:
This diff exposes receiveEvent on the UIManager class. This is necessary to support backward compatibility between Fabric and classic RN

changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D21979687

fbshipit-source-id: 1ec75896687d55e699f79c520e21f05fac368ee6
2020-06-10 22:56:01 -07:00
Joshua Gross 02b8e67da3 BatchMountItem debug info should log SurfaceId
Summary:
See title.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D21965838

fbshipit-source-id: a3bd9d48c1fadb19a12cccaab5713cf73566bd93
2020-06-09 23:23:11 -07:00
Joshua Gross 912dac24fc Ignore PreAllocateViewMountItem if it's associated with a stopped surface
Summary:
Because of the previous diffs there's an increased chance of race conditions between JS executing and queuing up PreAllocateViewMountItems for surfaces that are stopped. Make sure those are ignored if they're queued up and a surface has been stopped.

Currently stopSurface only happens on the UI thread; PreAllocateViewMountItems can be queued from any thread, but are only executed on the UI thread. So once a batch of items starts executing, there's no race between teardown and execution: we just need to make sure we check that the surface is still running initially.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D21965839

fbshipit-source-id: 0241dc171022cc923b7e38dcd110d664096dde79
2020-06-09 23:23:11 -07:00
Joshua Gross 03174f1cad Call stopSurface when ReactRootView is unregistered
Summary:
In the past, in Fabric (Android), we never called stopSurface. Ever! This is bad for memory and can cause other issues, so... let's not do that.

Instead, when the ReactRootView is being torn down, we check the View ID to see if it's a Fabric RootView, and if it is, we call Fabric's stopSurface method.

Fabric stopSurface only has impact on (1) Fabric mount instructions being executed after that point and (2) tells JS to stop running the surface, on the JS thread, asynchronously.

Anecdotally it looks like all the MountItems involved in deleting and removing views from the hierarchy are executed before stopSurface is called.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D21965837

fbshipit-source-id: 5169c5a1e339fd9e016ae1234d8389b2bd30be70
2020-06-09 23:23:10 -07:00
Samuel Susla a5386ff4bf Delete animation driver when destructing scheduler
Summary:
Changelog: [Internal]

Clean up animationDriver_ in `Binding::uninstallFabricUIManager`.

Reviewed By: JoshuaGross

Differential Revision: D21923567

fbshipit-source-id: ecdc727ecbfd1d7052be0372b8d2a0ee7172f93f
2020-06-08 11:58:04 -07:00
Christoph Nakazawa ad879e50bc Add RCTDevSplitBundleLoader native module
Reviewed By: ejanzer

Differential Revision: D21302418

fbshipit-source-id: a868f6dad3306190c7add26e8f9a976866c16aef
2020-06-08 09:07:42 -07:00
David Vacca 32888a8b4a Disable state list animator during measurements of ReactSlider
Summary:
This diff disables the state list animator from the ReactSlider object used to measure ReactSlider.
The motivation is to fix T63030542, which it seems to be caused by the state list animator being accessed and modified from different threads

We don't have a way to reproduce, but based on my analysis this diff will fix T63030542.

I would like to land this diff and then keep tracking production data for the crash reported on T63030542

Changelog:
[Android][Fixed] Fix intermittent crash of ReactSlider on Android

Reviewed By: fkgozali

Differential Revision: D21920698

fbshipit-source-id: 54af388043d5041c4bf981c81364780d3f52d818
2020-06-07 00:43:03 -07:00
Emily Janzer 21d0eb75f9 Use RuntimeExecutor from CatalystInstance in Fabric's Binding (#28875)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/28875

Update Fabric's Android binding to use a RuntimeExecutor instead of the `jsContext`, which is actually just the runtime pointer. This diff uses the RuntimeExecutor from CatalystInstanceImpl (in the previous diff) which uses the bridge under the hood.

Changelog: [Android][Changed] Modified Fabric's public-facing API on Android

Reviewed By: mdvacca

Differential Revision: D21051975

fbshipit-source-id: 9c17ad1986f90c12af457d88a5035553e0e7ceb0
2020-06-05 19:01:58 -07:00
Joshua Gross 8b47e69477 Do not execute MountItems if their associated Surface has been stopped
Summary:
Introduce SurfaceId to the BatchMountItem. Do not execute it if the associated Surface has gone away.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D21895452

fbshipit-source-id: 5df56720ce9b4293693884ebe105bda1dc87700e
2020-06-05 17:13:35 -07:00
Joshua Gross b6fedfe179 FabricUIManager: clear out mReactContextForRootTag when stopSurface is called
Summary:
See title.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D21895453

fbshipit-source-id: c6519b39a2b300e5d83d06164a31c3b494cf411f
2020-06-05 17:13:35 -07:00
Joshua Gross d821a9f2a0 Refactor how synchronous updates are queued and executed in FabricUIManager
Summary:
As a simple refactor, I want to 1) have `synchronouslyUpdateViewOnUIThread` only catch exceptions for the specific MountItem being synchronously executed, 2) not assume that scheduleMountItem will always cause synchronous execution.

I think this makes the logic here a little more clear and it scopes how we swallow exceptions, which could be swallowing too many errors right now actually.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D21911804

fbshipit-source-id: 1b1a465cadd60c72c69b556469276c9ee6b2dfcc
2020-06-05 17:13:34 -07:00
Samuel Susla 9ebd852334 Fix KERN_INVALID_ADDRESS in LayoutAnimation
Summary:
Changelog: [Internal]

# Problem

`MountingCoordinator` holds a pointer to instance of `MountingOverrideDelegate` which becomes invalid.

# Solution

Use `std::weak_ptr` instead of raw pointer so it is possible to tell whether the pointer is expired.

Reviewed By: JoshuaGross

Differential Revision: D21905351

fbshipit-source-id: c7bf9635742a6ec086a03ba83202e46e1f1f373f
2020-06-05 16:11:11 -07:00
Ramanpreet Nara e5bef7338f Remove TurboModule debug logs
Summary:
These logs are no longer necessary, because data indicates that the TurboModule eager init crash was fixed.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D21852743

fbshipit-source-id: ddeefd6396283ee5e15980a33fb006cb83a81532
2020-06-02 20:11:53 -07:00
Luna Wei ceb6c3de54 Fix assertions
Summary:
Changelog:
[Internal][Fixed] - Fix non-null assertions

These assertions weren't asserting that these objects aren't null.

Reviewed By: mdvacca

Differential Revision: D21844260

fbshipit-source-id: 6102fb304ddb6db61411e15c32355e4c3d3effca
2020-06-02 13:43:36 -07:00
Danny Yan f29238cc0c fix using deprecated constants in Android API Level 29
Summary:
Changelog: [Internal]

# Context

FB4A recently updated from [Android API level 28 to level 29](https://fb.workplace.com/groups/782862961920333/permalink/1409529345920355/). This [deprecated](https://developer.android.com/reference/android/provider/MediaStore.Images.ImageColumns#LATITUDE) the constants `Images.Media.Latitude` and `Image.Media.Longitude`, and we started to get the exception found in the attached task.

# This diff

Similar to this [pull request](https://github.com/react-native-community/react-native-cameraroll/pull/170), it removes the usage of the deprecated latitude and longitude constants. However for our case I don't know if latitude and longitude are being used or not, so for this diff I will check on the Android API level before adding the latitude and longitude in the project list. This is a similar implementation to the [first version](https://github.com/react-native-community/react-native-cameraroll/pull/170/commits/adeeb3ee0aaeb79be3c6917f973c993ab4079868) of the above pull request where it checks the api level before extracting the location data.

Differential Revision: D21774607

fbshipit-source-id: 632ea871b530b8e157f4ca74a5bc319b2abf7ba5
2020-05-29 16:16:44 -07:00
Joshua Gross 5d39bfa501 Fix crash in NativeAnimatedModule due to inlining and race between animation/teardown
Summary:
Fix NPE crashes in NativeAnimatedModule.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D21789500

fbshipit-source-id: be099543bc0552d49463b12216be196864e23d25
2020-05-29 15:48:24 -07:00