mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-09 09:12:06 +08:00
Release React Native for Android
This is an early release and there are several things that are known not to work if you're porting your iOS app to Android. See the Known Issues guide on the website. We will work with the community to reach platform parity with iOS.
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* 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.uimanager;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
/**
|
||||
* Class providing children management API for view managers of classes extending ViewGroup.
|
||||
*/
|
||||
public abstract class ViewGroupManager <T extends ViewGroup>
|
||||
extends ViewManager<T, ReactShadowNode> {
|
||||
|
||||
@Override
|
||||
public ReactShadowNode createCSSNodeInstance() {
|
||||
return new ReactShadowNode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateView(T root, CatalystStylesDiffMap props) {
|
||||
BaseViewPropertyApplicator.applyCommonViewProperties(root, props);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateExtraData(T root, Object extraData) {
|
||||
}
|
||||
|
||||
public void addView(T parent, View child, int index) {
|
||||
parent.addView(child, index);
|
||||
}
|
||||
|
||||
public int getChildCount(T parent) {
|
||||
return parent.getChildCount();
|
||||
}
|
||||
|
||||
public View getChildAt(T parent, int index) {
|
||||
return parent.getChildAt(index);
|
||||
}
|
||||
|
||||
public void removeView(T parent, View child) {
|
||||
parent.removeView(child);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether this View type needs to handle laying out its own children instead of
|
||||
* deferring to the standard css-layout algorithm.
|
||||
* Returns true for the layout to *not* be automatically invoked. Instead onLayout will be
|
||||
* invoked as normal and it is the View instance's responsibility to properly call layout on its
|
||||
* children.
|
||||
* Returns false for the default behavior of automatically laying out children without going
|
||||
* through the ViewGroup's onLayout method. In that case, onLayout for this View type must *not*
|
||||
* call layout on its children.
|
||||
*/
|
||||
public boolean needsCustomLayoutForChildren() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user