/** * Creates a view and installs event emitters on it. */ public final T createView( ThemedReactContext reactContext, JSResponderHandler jsResponderHandler) { T view = createViewInstance(reactContext); addEventEmitters(reactContext, view); if (view instanceof ReactInterceptingViewGroup) { ((ReactInterceptingViewGroup) view).setOnInterceptTouchEventListener(jsResponderHandler); } return view; }
@Test public void testOpacity() { View view = mManager.createView(mThemedContext, new JSResponderHandler()); mManager.updateProperties(view, buildStyles()); assertThat(view.getAlpha()).isEqualTo(1.0f); mManager.updateProperties(view, buildStyles("opacity", 0.31)); assertThat(view.getAlpha()).isEqualTo(0.31f, offset(1e-5f)); mManager.updateProperties(view, buildStyles("opacity", null)); assertThat(view.getAlpha()).isEqualTo(1.0f); }