mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
e758435167
Summary: Instead of using measure specs to set certain yoga properties on the root node (like max width, auto width, specific width), use yoga's calculateLayout(width, height) instead. The measure specs will be stored in the shadow node. This allows us to remove duplicated code that processes the measure specs and allows us to remove other logic like the enableLayoutCalculation() method. This diff also removes MeasureSpecProvider. MeasureSpecProvider was originally introduced to pass previously measured view measure specs to the initial creation of the root shadow node, but it turns out that this is unnecessary. We can update the root layout specs from the root view instead. Reviewed By: mdvacca Differential Revision: D9729744 fbshipit-source-id: 79b0b27ca879758f5dc3fc7cc8a0d38856a6cc79
56 lines
1.9 KiB
Java
56 lines
1.9 KiB
Java
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
package com.facebook.react.bridge;
|
|
|
|
import android.view.View;
|
|
import javax.annotation.Nullable;
|
|
|
|
public interface UIManager extends JSIModule, PerformanceCounter {
|
|
|
|
/**
|
|
* Registers a new root view.
|
|
*/
|
|
<T extends View> int addRootView(final T rootView, WritableMap initialProps, @Nullable String initialUITemplate);
|
|
|
|
/**
|
|
* Unregisters a new root view.
|
|
*/
|
|
void removeRootView(int reactRootTag);
|
|
|
|
/**
|
|
* Updates the layout specs of the RootShadowNode based on the Measure specs received by
|
|
* parameters.
|
|
*/
|
|
void updateRootLayoutSpecs(int rootTag, int widthMeasureSpec, int heightMeasureSpec);
|
|
|
|
/**
|
|
* Dispatches the commandId received by parameter to the view associated with the reactTag.
|
|
* The command will be processed in the UIThread.
|
|
*
|
|
* @param reactTag {@link int} that identifies the view that will receive this command
|
|
* @param commandId {@link int} command id
|
|
* @param commandArgs {@link ReadableArray} parameters associated with the command
|
|
*/
|
|
void dispatchCommand(int reactTag, int commandId, @Nullable ReadableArray commandArgs);
|
|
|
|
void setJSResponder(int reactTag, boolean blockNativeResponder);
|
|
|
|
void clearJSResponder();
|
|
|
|
/**
|
|
* Used by native animated module to bypass the process of updating the values through the shadow
|
|
* view hierarchy. This method will directly update native views, which means that updates for
|
|
* layout-related propertied won't be handled properly.
|
|
* Make sure you know what you're doing before calling this method :)
|
|
*
|
|
* @param tag {@link int} that identifies the view that will be updated
|
|
* @param props {@link ReadableMap} props that should be immediately updated in view
|
|
*/
|
|
void synchronouslyUpdateViewOnUIThread(int reactTag, ReadableMap props);
|
|
}
|