Skip to content

Commit

Permalink
Fix Javadocs broken by google-java-format
Browse files Browse the repository at this point in the history
Summary: After we ran google-java-format D16071725, some Javadocs which weren't properly written broke. This includes putting unordered and ordered lists not using <ul> and <ol>, putting code blocks and pseudo-graphics not using <pre>. I ran through all the changed classes and tried to fix the broken Javadocs.

Reviewed By: cpojer

Differential Revision: D16090087

fbshipit-source-id: f31971cbc0e367a04814ff90bbfb2192751d5e16
  • Loading branch information
makovkastar authored and facebook-github-bot committed Jul 2, 2019
1 parent 6c0f73b commit cd05a85
Show file tree
Hide file tree
Showing 22 changed files with 271 additions and 112 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@
* <p>Keep in mind that all JS remote method calls and script load calls are asynchronous and you
* should not expect them to return results immediately.
*
* <p>In order to write catalyst integration: 1) Make {@link ReactIntegrationTestCase} a base class
* of your test case 2) Use {@link ReactTestHelper#catalystInstanceBuilder()} instead of {@link
* com.facebook.react.bridge.CatalystInstanceImpl.Builder} to build catalyst instance for testing
* purposes
* <p>In order to write catalyst integration:
*
* <ol>
* <li>Make {@link ReactIntegrationTestCase} a base class of your test case
* <li>Use {@link ReactTestHelper#catalystInstanceBuilder()} instead of {@link
* com.facebook.react.bridge.CatalystInstanceImpl.Builder} to build catalyst instance for
* testing purposes
* </ol>
*/
public abstract class ReactIntegrationTestCase extends AndroidTestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,22 @@
* UIManagerModule#measureLayoutRelativeToParent}. Tests measurement for views in the following
* hierarchy:
*
* <p>+---------------------------------------------+ | A | | | | +-----------+ +---------+ | | | B
* | | D | | | | +---+ | | | | | | | C | | | | | | | | | | +---------+ | | | +---+ | | |
* +-----------+ | | | | | | | +---------------------------------------------+
* <pre>
* +---------------------------------------------+
* | A |
* | |
* | +-----------+ +---------+ |
* | | B | | D | |
* | | +---+ | | | |
* | | | C | | | | |
* | | | | | +---------+ |
* | | +---+ | |
* | +-----------+ |
* | |
* | |
* | |
* +---------------------------------------------+
* </pre>
*
* <p>View locations and dimensions: A - (0,0) to (500, 500) (500x500) B - (50,80) to (250, 380)
* (200x300) C - (150,150) to (200, 300) (50x150) D - (400,100) to (450, 300) (50x200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,13 @@ public void run() {
* This method "replay" multi-touch gesture recorded with modified TouchesHelper class that
* generated this piece of code (see https://phabricator.fb.com/P19756940). This is not intended
* to be copied/reused and once we need to have more multitouch gestures in instrumentation tests
* we should either: - implement nice generator similar to {@link SingleTouchGestureGenerator} -
* implement gesture recorded that will record touch data using arbitrary format and then read
* this recorded touch sequence during tests instead of generating code like this
* we should either:
*
* <ul>
* <li>implement nice generator similar to {@link SingleTouchGestureGenerator}
* <li>implement gesture recorded that will record touch data using arbitrary format and then
* read this recorded touch sequence during tests instead of generating code like this
* </ul>
*/
private void generateRecordedPinchTouchEvents() {
// START OF GENERATED CODE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,27 @@ protected ReactInstanceSpecForTest createReactInstanceSpecForTest() {
}

/**
* In this test view are layout in a following way: +-----------------------------+ | | |
* +---------------------+ | | | inner1 | | | +---------------------+ | |
* +-------------------------+ | | | outer (clip=true) | | | | +---------------------+ | | | | |
* inner2 | | | | | +---------------------+ | | | | | | | +-------------------------+ | |
* +---------------------+ | | | inner3 | | | +---------------------+ | | |
* In this test view are layout in a following way:
*
* <pre>
* +-----------------------------+
* | |
* | +---------------------+ |
* | | inner1 | |
* | +---------------------+ |
* | +-------------------------+ |
* | | outer (clip=true) | |
* | | +---------------------+ | |
* | | | inner2 | | |
* | | +---------------------+ | |
* | | | |
* | +-------------------------+ |
* | +---------------------+ |
* | | inner3 | |
* | +---------------------+ |
* | |
* +-----------------------------+
* </pre>
*
* <p>We expect only outer and inner2 to be attached
*/
Expand All @@ -69,11 +84,29 @@ public void XtestOneLevelClippingInView() throws Throwable {
}

/**
* In this test view are layout in a following way: +-----------------------------+ | outer
* (clip=true) | | | | | | | | +-----------------------------+ | | complexInner (clip=true) | | |
* +----------+ | +---------+ | | | | inner1 | | | inner2 | | | | | | | | | | | | +----------+ |
* +---------+ | +--------------+--------------+ | | +----------+ +---------+ | | | inner3 | |
* inner4 | | | | | | | | | +----------+ +---------+ | | | +-----------------------------+
* In this test view are layout in a following way:
*
* <pre>
* In this test view are layout in a following way:
* +-----------------------------+
* | outer (clip=true) |
* | |
* | |
* | |
* | +-----------------------------+
* | | complexInner (clip=true) |
* | | +----------+ | +---------+ |
* | | | inner1 | | | inner2 | |
* | | | | | | | |
* | | +----------+ | +---------+ |
* +--------------+--------------+ |
* | +----------+ +---------+ |
* | | inner3 | | inner4 | |
* | | | | | |
* | +----------+ +---------+ |
* | |
* +-----------------------------+
* </pre>
*
* <p>We expect outer, complexInner & inner1 to be attached
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,31 @@
* This test is to verify that touch events bubbles up to the right handler. We emulate couple of
* different gestures on top of the application reflecting following layout:
*
* <p>+---------------------------------------------------------------------------------------+ | |
* | +----------------------------------------------------------------------------------+ | | |
* +-------------+ +----------------+ | | | | | +---+ | | | | | | | | | A | | | | | | | | | +---+ |
* | C | | | | | | {B} | | | | | | | | | {D} | | | | | | +-------------+ +----------------+ | | | |
* | | | | | | |
* +----------------------------------------------------------------------------------+ | | |
* +----------------------------------------------------------------------------------+ | | | | | |
* | | | | | | | | | {E} | | | | | | | | | | |
* +----------------------------------------------------------------------------------+ |
* <pre>
* +---------------------------------------------------------------------------------------+
* | |
* | +----------------------------------------------------------------------------------+ |
* | | +-------------+ +----------------+ | |
* | | | +---+ | | | | |
* | | | | A | | | | | |
* | | | +---+ | | C | | |
* | | | {B} | | | | |
* | | | | {D} | | | |
* | | +-------------+ +----------------+ | |
* | | | |
* | | | |
* | +----------------------------------------------------------------------------------+ |
* |
* | +----------------------------------------------------------------------------------+ |
* | | | |
* | | | |
* | | | |
* | | {E} | |
* | | | |
* | | | |
* | +----------------------------------------------------------------------------------+ |
* +---------------------------------------------------------------------------------------+
* </pre>
*
* <p>Then in each test case we either tap the center of a particular view (from A to E) or we start
* a gesture in one view and end it with another. View with names in brackets (e.g. {D}) have touch
Expand Down
17 changes: 11 additions & 6 deletions ReactAndroid/src/main/java/com/facebook/react/ReactPackage.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,17 @@

/**
* Main interface for providing additional capabilities to the catalyst framework by couple of
* different means: 1) Registering new native modules 2) Registering new JS modules that may be
* accessed from native modules or from other parts of the native code (requiring JS modules from
* the package doesn't mean it will automatically be included as a part of the JS bundle, so there
* should be a corresponding piece of code on JS side that will require implementation of that JS
* module so that it gets bundled) 3) Registering custom native views (view managers) and custom
* event types 4) Registering natively packaged assets/resources (e.g. images) exposed to JS
* different means:
*
* <ol>
* <li>Registering new native modules
* <li>Registering new JS modules that may be accessed from native modules or from other parts of
* the native code (requiring JS modules from the package doesn't mean it will automatically
* be included as a part of the JS bundle, so there should be a corresponding piece of code on
* JS side that will require implementation of that JS module so that it gets bundled)
* <li>Registering custom native views (view managers) and custom event types
* <li>Registering natively packaged assets/resources (e.g. images) exposed to JS
* </ol>
*
* <p>TODO(6788500, 6788507): Implement support for adding custom views, events and resources
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,19 @@
* operations (such as interpolation, addition, etc) and connection are used to describe how change
* of the value in one node can affect other nodes.
*
* <p>Few examples of the nodes that can be created on the JS side: - Animated.Value is a simplest
* type of node with a numeric value which can be driven by an animation engine (spring, decay, etc)
* or by calling setValue on it directly from JS - Animated.add is a type of node that may have two
* or more input nodes. It outputs the sum of all the input node values - interpolate - is actually
* a method you can call on any node and it creates a new node that takes the parent node as an
* input and outputs its interpolated value (e.g. if you have value that can animate from 0 to 1 you
* can create interpolated node and set output range to be 0 to 100 and when the input node changes
* the output of interpolated node will multiply the values by 100)
* <p>Few examples of the nodes that can be created on the JS side:
*
* <ul>
* <li>Animated.Value is a simplest type of node with a numeric value which can be driven by an
* animation engine (spring, decay, etc) or by calling setValue on it directly from JS
* <li>Animated.add is a type of node that may have two or more input nodes. It outputs the sum of
* all the input node values
* <li>interpolate - is actually a method you can call on any node and it creates a new node that
* takes the parent node as an input and outputs its interpolated value (e.g. if you have
* value that can animate from 0 to 1 you can create interpolated node and set output range to
* be 0 to 100 and when the input node changes the output of interpolated node will multiply
* the values by 100)
* </ul>
*
* <p>You can mix and chain nodes however you like and this way create nodes graph with connections
* between them.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,16 @@
* occurs.
*
* <p>Native methods can be exposed to JS with {@link ReactMethod} annotation. Those methods may
* only use limited number of types for their arguments: 1/ primitives (boolean, int, float, double
* 2/ {@link String} mapped from JS string 3/ {@link ReadableArray} mapped from JS Array 4/ {@link
* ReadableMap} mapped from JS Object 5/ {@link Callback} mapped from js function and can be used
* only as a last parameter or in the case when it express success & error callback pair as two last
* arguments respectively.
* only use limited number of types for their arguments:
*
* <ol>
* <li>primitives (boolean, int, float, double
* <li>{@link String} mapped from JS string
* <li>{@link ReadableArray} mapped from JS Array
* <li>{@link ReadableMap} mapped from JS Object
* <li>{@link Callback} mapped from js function and can be used only as a last parameter or in the
* case when it express success & error callback pair as two last arguments respectively.
* </ol>
*
* <p>All methods exposed as native to JS with {@link ReactMethod} annotation must return {@code
* void}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@
* app outside of this catalyst instance still in a good state to allow reloading and restarting
* this catalyst instance?
*
* <p>Examples where this class is appropriate to throw: - JS tries to update a view with a tag that
* hasn't been created yet - JS tries to show a static image that isn't in resources - JS tries to
* use an unsupported view class
* <p>Examples where this class is appropriate to throw:
*
* <ul>
* <li>JS tries to update a view with a tag that hasn't been created yet
* <li>JS tries to show a static image that isn't in resources
* <li>JS tries to use an unsupported view class
* </ul>
*
* <p>Examples where this class **isn't** appropriate to throw: - Failed to write to localStorage
* because disk is full - Assertions about internal state (e.g. that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@
* <p>When multiple activities share a react instance, only the most recent one's lifecycle events
* get forwarded to listeners. Consider the following scenarios:
*
* <p>1. Navigating from Activity A to B will trigger two events: A#onHostPause and B#onHostResume.
* Any subsequent lifecycle events coming from Activity A, such as onHostDestroy, will be ignored.
* 2. Navigating back from Activity B to Activity A will trigger the same events: B#onHostPause and
* A#onHostResume. Any subsequent events coming from Activity B, such as onHostDestroy, are ignored.
* 3. Navigating back from Activity A to a non-React Activity or to the home screen will trigger two
* events: onHostPause and onHostDestroy. 4. Navigating from Activity A to a non-React Activity B
* will trigger one event: onHostPause. Later, if Activity A is destroyed (e.g. because of resource
* contention), onHostDestroy is triggered.
* <ol>
* <li>Navigating from Activity A to B will trigger two events: A#onHostPause and B#onHostResume.
* Any subsequent lifecycle events coming from Activity A, such as onHostDestroy, will be
* ignored.
* <li>Navigating back from Activity B to Activity A will trigger the same events: B#onHostPause
* and A#onHostResume. Any subsequent events coming from Activity B, such as onHostDestroy,
* are ignored.
* <li>Navigating back from Activity A to a non-React Activity or to the home screen will trigger
* two events: onHostPause and onHostDestroy.
* <li>Navigating from Activity A to a non-React Activity B will trigger one event: onHostPause.
* Later, if Activity A is destroyed (e.g. because of resource contention), onHostDestroy is
* triggered.
* </ol>
*/
public interface LifecycleEventListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@
*
* <p>One can use 'debug_http_host' shared preferences key to provide a host name for the debug
* server. If the setting is empty we support and detect two basic configuration that works well for
* android emulators connection to debug server running on emulator's host: - Android stock emulator
* with standard non-configurable local loopback alias: 10.0.2.2, - Genymotion emulator with default
* settings: 10.0.3.2
* android emulators connection to debug server running on emulator's host:
*
* <ul>
* <li>Android stock emulator with standard non-configurable local loopback alias: 10.0.2.2
* <li>Genymotion emulator with default settings: 10.0.3.2
* </ul>
*/
public class DevServerHelper {
public static final String RELOAD_APP_EXTRA_JS_PROXY = "jsproxy";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,15 @@ public synchronized void onViewHierarchyUpdateFinished() {
* <p>There are two 'success' cases that will cause {@link #getDidJSHitFrameAndCleanup} to return
* true for a given frame:
*
* <p>1) UIManagerModule finished dispatching a batched UI update on the UI thread during the
* frame. This means that during the next hierarchy traversal, new UI will be drawn if needed
* (good). 2) The bridge ended the frame idle (meaning there were no JS nor native module calls
* still in flight) AND there was no UiManagerModule update enqueued that didn't also finish. NB:
* if there was one enqueued that actually finished, we'd have case 1), so effectively we just
* look for whether one was enqueued.
* <ol>
* <li>UIManagerModule finished dispatching a batched UI update on the UI thread during the
* frame. This means that during the next hierarchy traversal, new UI will be drawn if
* needed (good).
* <li>The bridge ended the frame idle (meaning there were no JS nor native module calls still
* in flight) AND there was no UiManagerModule update enqueued that didn't also finish. NB:
* if there was one enqueued that actually finished, we'd have case 1), so effectively we
* just look for whether one was enqueued.
* </ol>
*
* <p>NB: This call can only be called once for a given frame time range because it cleans up
* events it recorded for that frame.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ public static I18nUtil getInstance() {
}

/**
* Check if the device is currently running on an RTL locale. This only happens when the app: - is
* forcing RTL layout, regardless of the active language (for development purpose) - allows RTL
* layout when using RTL locale
* Check if the device is currently running on an RTL locale. This only happens when the app:
*
* <ul>
* <li>is forcing RTL layout, regardless of the active language (for development purpose)
* <li>allows RTL layout when using RTL locale
* </ul>
*/
public boolean isRTL(Context context) {
if (isRTLForced(context)) {
Expand Down
Loading

0 comments on commit cd05a85

Please sign in to comment.