|  | @@ -0,0 +1,83 @@
 | 
	
		
			
			|  | 1 | +package com.reactnativenavigation.react;
 | 
	
		
			
			|  | 2 | +
 | 
	
		
			
			|  | 3 | +import android.support.annotation.Nullable;
 | 
	
		
			
			|  | 4 | +
 | 
	
		
			
			|  | 5 | +import com.facebook.react.bridge.ReactApplicationContext;
 | 
	
		
			
			|  | 6 | +import com.facebook.react.bridge.ReadableArray;
 | 
	
		
			
			|  | 7 | +import com.facebook.react.bridge.ReadableMap;
 | 
	
		
			
			|  | 8 | +import com.facebook.react.uimanager.ThemedReactContext;
 | 
	
		
			
			|  | 9 | +import com.facebook.react.uimanager.UIImplementation;
 | 
	
		
			
			|  | 10 | +import com.facebook.react.uimanager.UIImplementationProvider;
 | 
	
		
			
			|  | 11 | +import com.facebook.react.uimanager.UIManagerModule;
 | 
	
		
			
			|  | 12 | +import com.facebook.react.uimanager.ViewManager;
 | 
	
		
			
			|  | 13 | +import com.facebook.react.uimanager.common.MeasureSpecProvider;
 | 
	
		
			
			|  | 14 | +import com.facebook.react.uimanager.common.SizeMonitoringFrameLayout;
 | 
	
		
			
			|  | 15 | +import com.facebook.react.uimanager.events.EventDispatcher;
 | 
	
		
			
			|  | 16 | +
 | 
	
		
			
			|  | 17 | +import java.util.List;
 | 
	
		
			
			|  | 18 | +
 | 
	
		
			
			|  | 19 | +@SuppressWarnings("WeakerAccess")
 | 
	
		
			
			|  | 20 | +public class SyncUiImplementation extends UIImplementation {
 | 
	
		
			
			|  | 21 | +    private static final Object lock = new Object();
 | 
	
		
			
			|  | 22 | +
 | 
	
		
			
			|  | 23 | +    public static class Provider extends UIImplementationProvider {
 | 
	
		
			
			|  | 24 | +        @Override
 | 
	
		
			
			|  | 25 | +        public UIImplementation createUIImplementation(ReactApplicationContext reactContext, List<ViewManager> viewManagerList, EventDispatcher eventDispatcher, int minTimeLeftInFrameForNonBatchedOperationMs) {
 | 
	
		
			
			|  | 26 | +            return new SyncUiImplementation(reactContext, viewManagerList, eventDispatcher, minTimeLeftInFrameForNonBatchedOperationMs);
 | 
	
		
			
			|  | 27 | +        }
 | 
	
		
			
			|  | 28 | +
 | 
	
		
			
			|  | 29 | +        @Override
 | 
	
		
			
			|  | 30 | +        public UIImplementation createUIImplementation(ReactApplicationContext reactContext, UIManagerModule.ViewManagerResolver viewManagerResolver, EventDispatcher eventDispatcher, int minTimeLeftInFrameForNonBatchedOperationMs) {
 | 
	
		
			
			|  | 31 | +            return new SyncUiImplementation(reactContext, viewManagerResolver, eventDispatcher, minTimeLeftInFrameForNonBatchedOperationMs);
 | 
	
		
			
			|  | 32 | +        }
 | 
	
		
			
			|  | 33 | +    }
 | 
	
		
			
			|  | 34 | +
 | 
	
		
			
			|  | 35 | +    public SyncUiImplementation(ReactApplicationContext reactContext, List<ViewManager> viewManagerList, EventDispatcher eventDispatcher, int minTimeLeftInFrameForNonBatchedOperationMs) {
 | 
	
		
			
			|  | 36 | +        super(reactContext, viewManagerList, eventDispatcher, minTimeLeftInFrameForNonBatchedOperationMs);
 | 
	
		
			
			|  | 37 | +    }
 | 
	
		
			
			|  | 38 | +
 | 
	
		
			
			|  | 39 | +    public SyncUiImplementation(ReactApplicationContext reactContext, UIManagerModule.ViewManagerResolver viewManagerResolver, EventDispatcher eventDispatcher, int minTimeLeftInFrameForNonBatchedOperationMs) {
 | 
	
		
			
			|  | 40 | +        super(reactContext, viewManagerResolver, eventDispatcher, minTimeLeftInFrameForNonBatchedOperationMs);
 | 
	
		
			
			|  | 41 | +    }
 | 
	
		
			
			|  | 42 | +
 | 
	
		
			
			|  | 43 | +    @Override
 | 
	
		
			
			|  | 44 | +    public void manageChildren(
 | 
	
		
			
			|  | 45 | +            int viewTag,
 | 
	
		
			
			|  | 46 | +            @Nullable ReadableArray moveFrom,
 | 
	
		
			
			|  | 47 | +            @Nullable ReadableArray moveTo,
 | 
	
		
			
			|  | 48 | +            @Nullable ReadableArray addChildTags,
 | 
	
		
			
			|  | 49 | +            @Nullable ReadableArray addAtIndices,
 | 
	
		
			
			|  | 50 | +            @Nullable ReadableArray removeFrom) {
 | 
	
		
			
			|  | 51 | +        synchronized (lock) {
 | 
	
		
			
			|  | 52 | +            super.manageChildren(viewTag, moveFrom, moveTo, addChildTags, addAtIndices, removeFrom);
 | 
	
		
			
			|  | 53 | +        }
 | 
	
		
			
			|  | 54 | +    }
 | 
	
		
			
			|  | 55 | +
 | 
	
		
			
			|  | 56 | +    @Override
 | 
	
		
			
			|  | 57 | +    public void setChildren(int viewTag, ReadableArray childrenTags) {
 | 
	
		
			
			|  | 58 | +        synchronized (lock) {
 | 
	
		
			
			|  | 59 | +            super.setChildren(viewTag, childrenTags);
 | 
	
		
			
			|  | 60 | +        }
 | 
	
		
			
			|  | 61 | +    }
 | 
	
		
			
			|  | 62 | +
 | 
	
		
			
			|  | 63 | +    @Override
 | 
	
		
			
			|  | 64 | +    public void createView(int tag, String className, int rootViewTag, ReadableMap props) {
 | 
	
		
			
			|  | 65 | +        synchronized (lock) {
 | 
	
		
			
			|  | 66 | +            super.createView(tag, className, rootViewTag, props);
 | 
	
		
			
			|  | 67 | +        }
 | 
	
		
			
			|  | 68 | +    }
 | 
	
		
			
			|  | 69 | +
 | 
	
		
			
			|  | 70 | +    @Override
 | 
	
		
			
			|  | 71 | +    public void removeRootShadowNode(int rootViewTag) {
 | 
	
		
			
			|  | 72 | +        synchronized (lock) {
 | 
	
		
			
			|  | 73 | +            super.removeRootShadowNode(rootViewTag);
 | 
	
		
			
			|  | 74 | +        }
 | 
	
		
			
			|  | 75 | +    }
 | 
	
		
			
			|  | 76 | +
 | 
	
		
			
			|  | 77 | +    @Override
 | 
	
		
			
			|  | 78 | +    public <T extends SizeMonitoringFrameLayout & MeasureSpecProvider> void registerRootView(T rootView, int tag, ThemedReactContext context) {
 | 
	
		
			
			|  | 79 | +        synchronized (lock) {
 | 
	
		
			
			|  | 80 | +            super.registerRootView(rootView, tag, context);
 | 
	
		
			
			|  | 81 | +        }
 | 
	
		
			
			|  | 82 | +    }
 | 
	
		
			
			|  | 83 | +}
 |