Commit Graph

23 Commits

Author SHA1 Message Date
Nick Lockwood c5b990f65f Added lightweight generic annotations
Summary: public

Added lightweight genarics annotations to make the code more readable and help the compiler catch bugs.

Fixed some type bugs and improved bridge validation in a few places.

Reviewed By: javache

Differential Revision: D2600189

fb-gh-sync-id: f81e22f2cdc107bf8d0b15deec6d5b83aacc5b56
2015-11-03 14:49:30 -08:00
Milen Dzhumerov 77272d5a91 Hit testing now treats views with 0.0 opacity as interactable
Reviewed By: nicklockwood

Differential Revision: D2574937

fb-gh-sync-id: 63629cd61cbd7cab93346b4dd91a32703d4f56e0
2015-10-30 04:14:25 -07:00
Chace Liang f5b2659f35 unbreak madman save button
Reviewed By: fkgozali

Differential Revision: D2594398

fb-gh-sync-id: ad8f47c0c259e3aec4e9c99f10d06173fcd4f8b4
2015-10-29 10:57:50 -07:00
Jay Garcia ca7a8b271a hit test detection -- adding clipsToBounds testing
Summary: This addresses #3577 and #3533. It adds the ability to test for subview.clipsToBounds.
Closes https://github.com/facebook/react-native/pull/3750

Reviewed By: svcscm

Differential Revision: D2592878

Pulled By: nicklockwood

fb-gh-sync-id: a87842b87dc0b455120e6007059b5d9a51a53ea2
2015-10-28 16:23:39 -07:00
Nick Lockwood 848839858b Added mechanism for directly mapping JS event handlers to blocks
Summary:
Currently, the system for mapping JS event handlers to blocks is quite clean on the JS side, but is clunky on the native side. The event property is passed as a boolean, which can then be checked by the native side, and if true, the native side is supposed to send an event via the event dispatcher.

This diff adds the facility to declare the property as a block instead. This means that the event side can simply call the block, and it will automatically send the event. Because the blocks for bubbling and direct events are named differently, we can also use this to generate the event registration data and get rid of the arrays of event names.

The name of the event is inferred from the property name, which means that the property for an event called "load" must be called `onLoad` or the mapping won't work. This can be optionally remapped to a different property name on the view itself if necessary, e.g.

  RCT_REMAP_VIEW_PROPERTY(onLoad, loadEventBlock, RCTDirectEventBlock)

If you don't want to use this mechanism then for now it is still possible to declare the property as a BOOL instead and use the old mechanism (this approach is now deprecated however, and may eventually be removed altogether).
2015-09-02 06:11:24 -08:00
Nick Lockwood 88e0bbc469 Ran Convert > To Modern Objective C Syntax 2015-08-25 01:08:49 -08:00
Nick Lockwood 1fb26d4319 Cleanup 2015-07-31 11:33:22 -08:00
Alex Akers f2b3057a7c Fix border width precedence issue 2015-07-30 06:18:17 -08:00
Nick Lockwood 0c61b49f0a Improved RCTCache performance + fixed border color crash
Summary:
RCTCache had really bad insertion performance when the cache was full due to having to LRU-sort the entries. This was making color
animations very slow.

I've fixed this in two ways:

1) by removing the sort and doing a linear search to remove old entries, which changes insertion perf to O(n) in the worst case instead of O(n log n) or even (n2).

2) by reducing the size of the color cache to 128 from 1024, which should be fine for normal use, without penalising animation performance.

Separately, border colors were not being retained, which caused crashes when the color cache was cleared. I've fixed that by retaining the border colors inside RCTView.
2015-07-14 04:56:25 -08:00
Nick Lockwood 1e66e5f53d Fixed border bug on events dashboard 2015-06-23 07:54:12 -08:00
Alex Akers 3ce8b1a1c8 [React Native] Implement -(recursiveD|d)escription for RCT(Shadow)View 2015-06-15 12:08:45 -08:00
Nick Lockwood 650fc9de4c Increased warning levels to -Wall -Wextra, and fixed Xcode 7 beta issues
Summary:
@public

I've increased the warning levels in the OSS frameworks, which caught a bunch of minor issues. I also fixed some new errors in Xcode 7 relating to designated initializers and TLS security.

Test Plan:
* Test the sample apps and make sure they still work.
* Run tests.
2015-06-15 07:52:50 -08:00
John Harper dc6fd82231 [react-native] -mountOrUnmountSubview: should handle zero-sized clip-rects correctly 2015-06-02 01:48:21 -08:00
Nick Lockwood ff49d86aed Implemented fast path for same borders/radii 2015-05-28 09:16:44 -08:00
Nick Lockwood acc42e193d Big reduction in blending 2015-05-27 16:10:54 -08:00
Alex Akers 81401064e5 [React Native] Fix view clipping when border radius is set 2015-05-26 02:17:07 -08:00
Nick Lockwood 0d227c0eb2 Eliminated redundant border drawing 2015-05-20 12:19:24 -08:00
Georgiy Kassabli d211359aeb Added ability to set custom accessibility tap handler to React Native 2015-05-20 08:32:15 -08:00
Alex Akers a4f92ba3db [React Native] Add magic tap accessibility gesture 2015-05-19 06:28:01 -08:00
Alex Akers 86709c15cb [React Native] Support variable corner radii on RCTView 2015-05-13 13:24:37 -07:00
Alex Akers 826b56a41b [React Native] Update RCTView border implementation 2015-04-27 04:10:43 -08:00
Boopathi Rajaa 087c609121 Fix hitTest for auto
Summary:
- Returns matching subview hitTest or super hitTest if no match found. Should fix #99 .

Closes https://github.com/facebook/react-native/pull/501
Github Author: Boopathi Rajaa <me@boopathi.in>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-02 09:30:29 -08:00
Tadeu Zagallo 20291a02df [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00