From a52c89b01d851ec72bb8eeda70d95f2bf548d120 Mon Sep 17 00:00:00 2001 From: Denis Koroskin Date: Thu, 28 Jan 2016 14:39:19 -0800 Subject: [PATCH] Extract UIImplementationProvider for Nodes into a helper class Summary: Exact same class is needed for Groups, and probably for other apps that want to work with Nodes, too, so let's extract it into a helper class to simplify coding. Reviewed By: sriramramani Differential Revision: D2873943 --- .../flat/FlatUIImplementationProvider.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 ReactAndroid/src/main/java/com/facebook/react/flat/FlatUIImplementationProvider.java diff --git a/ReactAndroid/src/main/java/com/facebook/react/flat/FlatUIImplementationProvider.java b/ReactAndroid/src/main/java/com/facebook/react/flat/FlatUIImplementationProvider.java new file mode 100644 index 000000000..e9ca47a78 --- /dev/null +++ b/ReactAndroid/src/main/java/com/facebook/react/flat/FlatUIImplementationProvider.java @@ -0,0 +1,28 @@ +/** + * 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.flat; + +import java.util.List; + +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.uimanager.UIImplementationProvider; +import com.facebook.react.uimanager.ViewManager; + +/** + * UIImplementationProvider that creates instances of {@link FlatUIImplementation}. + */ +public final class FlatUIImplementationProvider extends UIImplementationProvider { + @Override + public FlatUIImplementation createUIImplementation( + ReactApplicationContext reactContext, + List viewManagers) { + return FlatUIImplementation.createInstance(reactContext, viewManagers); + } +}