Convert View to @ReactProp.

Differential Revision: D2479795

committer: Service User <svcscm@fb.com>
This commit is contained in:
Krzysztof Magiera
2015-09-25 03:14:28 -07:00
committed by facebook-github-bot-8
parent 1ad1f45fe6
commit bf598647d2
6 changed files with 245 additions and 105 deletions
@@ -12,24 +12,21 @@ package com.facebook.react.uimanager;
import android.view.View;
/**
* A partial implementation of {@link ViewManager} that applies common properties such as background
* color, opacity and CSS layout. Implementations should make sure to call
* {@code super.updateView()} in order for these properties to be applied.
* Common base class for most of the {@link ViewManager}s. It provides support for most common
* properties through extending {@link BaseViewManager}. It also reduces boilerplate by specifying
* the type of shadow node to be {@link ReactShadowNode} and providing default, empty implementation
* for some of the methods of {@link ViewManager} interface.
*
* @param <T> the view handled by this manager
*/
public abstract class SimpleViewManager<T extends View> extends ViewManager<T, ReactShadowNode> {
public abstract class SimpleViewManager<T extends View> extends
BaseViewManager<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) {
}