Apply base View properties (scale, alpha etc) to FlatShadowNode when it maps to a View

Summary: @public There are some properties that we want to handle on a View level, as opposed to a FlatShadowNode level. For example, scale or alpha, that can be done very efficiently in hardware. Once we pop FlatShadowNode to a separate View, we need to apply these properties. This is where `BaseViewManager` comes in handy.

Reviewed By: sriramramani

Differential Revision: D2694290
This commit is contained in:
Denis Koroskin
2015-12-13 18:58:25 -08:00
committed by Ahmed El-Helw
parent dad378e394
commit b8b4fb8a74
3 changed files with 21 additions and 4 deletions

View File

@@ -10,15 +10,20 @@
package com.facebook.react.flat;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.ViewManager;
import com.facebook.react.uimanager.BaseViewManager;
abstract class FlatViewManager<C extends FlatShadowNode> extends ViewManager<FlatViewGroup, C> {
abstract class FlatViewManager<C extends FlatShadowNode> extends BaseViewManager<FlatViewGroup, C> {
@Override
protected FlatViewGroup createViewInstance(ThemedReactContext reactContext) {
return new FlatViewGroup(reactContext);
}
@Override
public void setBackgroundColor(FlatViewGroup view, int backgroundColor) {
// suppress
}
@Override
public void updateExtraData(FlatViewGroup root, Object extraData) {
}