Files
react-native/ReactAndroid/src/main/java/com/facebook/react/flat/FlatMeasuredViewGroup.java
Seth Kirby 76c2904d31 Add support for WRAP_CONTENT to react views.
Summary: Fixes needing to specify exact height of react views in Mason.  Uses a ViewTreeObserver to delay draw until we have correct bounds.

Reviewed By: sriramramani

Differential Revision: D3527122
2016-12-19 13:40:28 -08:00

27 lines
948 B
Java

/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package com.facebook.react.flat;
import android.graphics.Rect;
/**
* Helper interface to provide measuring of FlatViewGroup when needed. We don't override onMeasure
* for FlatViewGroup, which means that draw commands don't contributed to the measured width and
* height. This allows us to expose our calculated dimensions taking into account draw commands,
* without changing the visibility of the FlatViewGroup.
*/
public interface FlatMeasuredViewGroup {
/**
* @return A rect consisting of the left, top, right, and bottommost edge among all children,
* including draw commands.
*/
Rect measureWithCommands();
}