Add UIImplementationProvider and allow overriding it in AbstractReactActivity

Summary: public UIImplementationProvider allows plugging in an alternative UIImplementation. A follow up diff adds a toggle under FB Dev Settings and uses this class to control an implementation. This allows us experimenting with other ways of generating UI hierarchy from JavaScript components.

Reviewed By: astreet

Differential Revision: D2554774

fb-gh-sync-id: 6574a893020e3519bd2ab00b9620a6dbdfaed595
This commit is contained in:
Denis Koroskin
2015-11-29 22:24:36 -08:00
committed by facebook-github-bot-7
parent e8e7a2db57
commit 3dca8cf9fd
5 changed files with 57 additions and 16 deletions

View File

@@ -0,0 +1,24 @@
/**
* 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 java.util.List;
import com.facebook.react.bridge.ReactApplicationContext;
/**
* Provides UIImplementation to use in {@link UIManagerModule}.
*/
public class UIImplementationProvider {
public UIImplementation createUIImplementation(
ReactApplicationContext reactContext,
List<ViewManager> viewManagers) {
return new UIImplementation(reactContext, viewManagers);
}
}