Java 类com.facebook.react.uimanager.ThemedReactContext 实例源码

项目:react-native-android-piliplayer    文件:PLVideoTextureViewManager.java   
@Override
protected PLVideoTextureView createViewInstance(ThemedReactContext reactContext) {
    themedReactContext = reactContext;
    LayoutInflater inflater=LayoutInflater.from(reactContext);
    mEventEmitter=reactContext.getJSModule(RCTEventEmitter.class);
    //plVideoTextureView=(PLVideoTextureView) inflater.inflate(R.layout.video_view,null);
    plVideoTextureView=new PLVideoTextureView(reactContext);
    plVideoTextureView.setOnPreparedListener(mOnPreparedListener);
    plVideoTextureView.setOnInfoListener(mOnInfoListener);
    plVideoTextureView.setOnErrorListener(mOnErrorListener);
    plVideoTextureView.setOnVideoSizeChangedListener(mOnVideoSizeChangedListener);
    plVideoTextureView.setOnBufferingUpdateListener(mOnBufferingUpdateListener);
    plVideoTextureView.setOnCompletionListener(mOnCompletionListener);
    plVideoTextureView.setOnSeekCompleteListener(mOnSeekCompleteListener);
    reactContext.addLifecycleEventListener(this);//监听LifecycleEventListener的生命周期需要添加这句
    return plVideoTextureView;
}
项目:pili-react-native    文件:PiliPlayerViewManager.java   
@Override
protected PLVideoView createViewInstance(ThemedReactContext reactContext) {
    this.reactContext = reactContext;
    mEventEmitter = reactContext.getJSModule(RCTEventEmitter.class);
    mVideoView = new PLVideoView(reactContext);
    // Set some listeners
    mVideoView.setOnPreparedListener(mOnPreparedListener);
    mVideoView.setOnInfoListener(mOnInfoListener);
    mVideoView.setOnVideoSizeChangedListener(mOnVideoSizeChangedListener);
    mVideoView.setOnBufferingUpdateListener(mOnBufferingUpdateListener);
    mVideoView.setOnCompletionListener(mOnCompletionListener);
    mVideoView.setOnSeekCompleteListener(mOnSeekCompleteListener);
    mVideoView.setOnErrorListener(mOnErrorListener);

    reactContext.addLifecycleEventListener(this);
    return mVideoView;
}
项目:RNLearn_Project1    文件:ReactToolbarManager.java   
@Override
protected void addEventEmitters(final ThemedReactContext reactContext, final ReactToolbar view) {
  final EventDispatcher mEventDispatcher = reactContext.getNativeModule(UIManagerModule.class)
      .getEventDispatcher();
  view.setNavigationOnClickListener(
      new View.OnClickListener() {
        @Override
        public void onClick(View v) {
          mEventDispatcher.dispatchEvent(
              new ToolbarClickEvent(view.getId(), -1));
        }
      });

  view.setOnMenuItemClickListener(
      new ReactToolbar.OnMenuItemClickListener() {
        @Override
        public boolean onMenuItemClick(MenuItem menuItem) {
          mEventDispatcher.dispatchEvent(
              new ToolbarClickEvent(
                  view.getId(),
                  menuItem.getOrder()));
          return true;
        }
      });
}
项目:react-native-android-bottom-navigation    文件:RNBottomNavigationManager.java   
@Override
protected RNBottomNavigation createViewInstance(final ThemedReactContext reactContext) {
    final RNBottomNavigation bottomNavigation = new RNBottomNavigation(reactContext);

    bottomNavigation.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
        @Override
        public boolean onNavigationItemSelected(@NonNull MenuItem item) {
            WritableMap event = Arguments.createMap();
            event.putInt("selectedPosition", item.getOrder());
            reactContext.getJSModule(RCTEventEmitter.class).receiveEvent(
                    bottomNavigation.getId(),
                    "topChange",
                    event
            );

            return true;
        }
    });

    return bottomNavigation;
}
项目:react-native-pull-up-down-refresh    文件:RCTSwipeRefreshLayoutManager.java   
@Override
protected void addEventEmitters(
        final ThemedReactContext reactContext,
        final RCTSwipeRefreshLayout view) {
    view.setOnEvTouchListener(
            new RCTSwipeRefreshLayout.OnEvTouchListener() {
                @Override
                public void onSwipe(int movement) {
                    reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher()
                            .dispatchEvent(new TouchEvent(view.getId(), SystemClock.nanoTime(), movement));
                }

                @Override
                public void onSwipeRefresh() {
                    reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher()
                            .dispatchEvent(new TouchUpEvent(view.getId(), SystemClock.nanoTime()));
                }

            });
}
项目:react-native-pili-live    文件:PiliPlayerViewManager.java   
@Override
protected PLVideoView createViewInstance(ThemedReactContext reactContext) {
    this.reactContext = reactContext;
    mEventEmitter = reactContext.getJSModule(RCTEventEmitter.class);
    mVideoView = new PLVideoView(reactContext);
    // Set some listeners
    mVideoView.setOnPreparedListener(mOnPreparedListener);
    mVideoView.setOnInfoListener(mOnInfoListener);
    mVideoView.setOnVideoSizeChangedListener(mOnVideoSizeChangedListener);
    mVideoView.setOnBufferingUpdateListener(mOnBufferingUpdateListener);
    mVideoView.setOnCompletionListener(mOnCompletionListener);
    mVideoView.setOnSeekCompleteListener(mOnSeekCompleteListener);
    mVideoView.setOnErrorListener(mOnErrorListener);

    reactContext.addLifecycleEventListener(this);
    return mVideoView;
}
项目:RNLearn_Project1    文件:RCTTextInput.java   
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
@Override
public void setThemedContext(ThemedReactContext themedContext) {
  super.setThemedContext(themedContext);

  mEditText = new EditText(themedContext);
  // This is needed to fix an android bug since 4.4.3 which will throw an NPE in measure,
  // setting the layoutParams fixes it: https://code.google.com/p/android/issues/detail?id=75877
  mEditText.setLayoutParams(
      new ViewGroup.LayoutParams(
          ViewGroup.LayoutParams.WRAP_CONTENT,
          ViewGroup.LayoutParams.WRAP_CONTENT));

  setDefaultPadding(Spacing.START, mEditText.getPaddingStart());
  setDefaultPadding(Spacing.TOP, mEditText.getPaddingTop());
  setDefaultPadding(Spacing.END, mEditText.getPaddingEnd());
  setDefaultPadding(Spacing.BOTTOM, mEditText.getPaddingBottom());
  mEditText.setPadding(0, 0, 0, 0);
}
项目:RNLearn_Project1    文件:ReactTextInputShadowNode.java   
@Override
public void setThemedContext(ThemedReactContext themedContext) {
  super.setThemedContext(themedContext);

  // TODO #7120264: cache this stuff better
  mEditText = new EditText(getThemedContext());
  // This is needed to fix an android bug since 4.4.3 which will throw an NPE in measure,
  // setting the layoutParams fixes it: https://code.google.com/p/android/issues/detail?id=75877
  mEditText.setLayoutParams(
      new ViewGroup.LayoutParams(
          ViewGroup.LayoutParams.WRAP_CONTENT,
          ViewGroup.LayoutParams.WRAP_CONTENT));

  setDefaultPadding(Spacing.START, mEditText.getPaddingStart());
  setDefaultPadding(Spacing.TOP, mEditText.getPaddingTop());
  setDefaultPadding(Spacing.END, mEditText.getPaddingEnd());
  setDefaultPadding(Spacing.BOTTOM, mEditText.getPaddingBottom());
  mEditText.setPadding(0, 0, 0, 0);
}
项目:RNLearn_Project1    文件:ReactToolbarManager.java   
@Override
protected void addEventEmitters(final ThemedReactContext reactContext, final ReactToolbar view) {
  final EventDispatcher mEventDispatcher = reactContext.getNativeModule(UIManagerModule.class)
      .getEventDispatcher();
  view.setNavigationOnClickListener(
      new View.OnClickListener() {
        @Override
        public void onClick(View v) {
          mEventDispatcher.dispatchEvent(
              new ToolbarClickEvent(view.getId(), -1));
        }
      });

  view.setOnMenuItemClickListener(
      new ReactToolbar.OnMenuItemClickListener() {
        @Override
        public boolean onMenuItemClick(MenuItem menuItem) {
          mEventDispatcher.dispatchEvent(
              new ToolbarClickEvent(
                  view.getId(),
                  menuItem.getOrder()));
          return true;
        }
      });
}
项目:RNLearn_Project1    文件:RCTTextInput.java   
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
@Override
public void setThemedContext(ThemedReactContext themedContext) {
  super.setThemedContext(themedContext);

  mEditText = new EditText(themedContext);
  // This is needed to fix an android bug since 4.4.3 which will throw an NPE in measure,
  // setting the layoutParams fixes it: https://code.google.com/p/android/issues/detail?id=75877
  mEditText.setLayoutParams(
      new ViewGroup.LayoutParams(
          ViewGroup.LayoutParams.WRAP_CONTENT,
          ViewGroup.LayoutParams.WRAP_CONTENT));

  setDefaultPadding(Spacing.START, mEditText.getPaddingStart());
  setDefaultPadding(Spacing.TOP, mEditText.getPaddingTop());
  setDefaultPadding(Spacing.END, mEditText.getPaddingEnd());
  setDefaultPadding(Spacing.BOTTOM, mEditText.getPaddingBottom());
  mEditText.setPadding(0, 0, 0, 0);
}
项目:RNLearn_Project1    文件:ReactTextInputShadowNode.java   
@Override
public void setThemedContext(ThemedReactContext themedContext) {
  super.setThemedContext(themedContext);

  // TODO #7120264: cache this stuff better
  mEditText = new EditText(getThemedContext());
  // This is needed to fix an android bug since 4.4.3 which will throw an NPE in measure,
  // setting the layoutParams fixes it: https://code.google.com/p/android/issues/detail?id=75877
  mEditText.setLayoutParams(
      new ViewGroup.LayoutParams(
          ViewGroup.LayoutParams.WRAP_CONTENT,
          ViewGroup.LayoutParams.WRAP_CONTENT));

  setDefaultPadding(Spacing.START, mEditText.getPaddingStart());
  setDefaultPadding(Spacing.TOP, mEditText.getPaddingTop());
  setDefaultPadding(Spacing.END, mEditText.getPaddingEnd());
  setDefaultPadding(Spacing.BOTTOM, mEditText.getPaddingBottom());
  mEditText.setPadding(0, 0, 0, 0);
}
项目:react-native-webrtc    文件:RTCVideoViewManager.java   
@Override
public WebRTCView createViewInstance(ThemedReactContext context) {
  mContext = context;
  WebRTCView view = new WebRTCView(context);
  // view.setPreserveEGLContextOnPause(true);
  // view.setKeepScreenOn(true);
  return view;
}
项目:react-native-twitterkit    文件:ReactTweetViewManager.java   
@Override
public TweetView createViewInstance(ThemedReactContext context) {
  ImageLoaderFix.apply(context);
  TweetView tweetView = createTweetView(context);
  tweetView.addSizeChangeListener(this);

  return tweetView;
}
项目:react-native-collapsing-toolbar    文件:CollapsingParallaxManager.java   
@Override
public FrameLayout createViewInstance(ThemedReactContext context) {
    FrameLayout view = new FrameLayout(context);
    CollapsingToolbarLayout.LayoutParams params = new CollapsingToolbarLayout.LayoutParams(
        CollapsingToolbarLayout.LayoutParams.MATCH_PARENT,
        CollapsingToolbarLayout.LayoutParams.WRAP_CONTENT
    );
    params.setCollapseMode(CollapsingToolbarLayout.LayoutParams.COLLAPSE_MODE_PARALLAX);
    view.setLayoutParams(params);
    return view;
}
项目:RNLearn_Project1    文件:ReactDrawerLayoutManager.java   
@Override
protected void addEventEmitters(ThemedReactContext reactContext, ReactDrawerLayout view) {
  view.setDrawerListener(
      new DrawerEventEmitter(
          view,
          reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher()));
}
项目:react-native-pili-player    文件:PiliLiveViewManager.java   
@Override
protected PLVideoView createViewInstance(ThemedReactContext reactContext) {
    this.reactContext = reactContext;
    mEventEmitter = reactContext.getJSModule(RCTEventEmitter.class);
    mVideoView = new PLVideoView(reactContext);
    // Set some listeners
    mVideoView.setOnPreparedListener(mOnPreparedListener);
    mVideoView.setOnInfoListener(mOnInfoListener);
    mVideoView.setOnVideoSizeChangedListener(mOnVideoSizeChangedListener);
    mVideoView.setOnBufferingUpdateListener(mOnBufferingUpdateListener);
    mVideoView.setOnCompletionListener(mOnCompletionListener);
    mVideoView.setOnSeekCompleteListener(mOnSeekCompleteListener);
    mVideoView.setOnErrorListener(mOnErrorListener);

    reactContext.addLifecycleEventListener(this);
    mProgressUpdateRunnable=new Runnable() {
        @Override
        public void run() {
            if(mVideoView.isPlaying()){
                WritableMap event = Arguments.createMap();
                event.putDouble("currentTime", mVideoView.getCurrentPosition()/1000);
                mEventEmitter.receiveEvent(getTargetId(), PiliPlayerViewManager.Events.PROGRESS.toString(), event);
                mProgressUpdateHandler.postDelayed(mProgressUpdateRunnable,1000);
            }
        }
    };
    return mVideoView;
}
项目:react-native-pili-player    文件:PiliPlayerViewManager.java   
@Override
protected PLVideoView createViewInstance(ThemedReactContext reactContext) {
    this.reactContext = reactContext;
    mEventEmitter = reactContext.getJSModule(RCTEventEmitter.class);

    mVideoView = new PLVideoView(reactContext);

    // Set some listeners
    mVideoView.setOnPreparedListener(mOnPreparedListener);
    mVideoView.setOnInfoListener(mOnInfoListener);
    mVideoView.setOnVideoSizeChangedListener(mOnVideoSizeChangedListener);
    mVideoView.setOnBufferingUpdateListener(mOnBufferingUpdateListener);
    mVideoView.setOnCompletionListener(mOnCompletionListener);
    mVideoView.setOnSeekCompleteListener(mOnSeekCompleteListener);
    mVideoView.setOnErrorListener(mOnErrorListener);
    reactContext.addLifecycleEventListener(this);
    mProgressUpdateRunnable=new Runnable() {
        @Override
        public void run() {
            if(mVideoView.isPlaying()){
                WritableMap event = Arguments.createMap();
                event.putDouble("currentTime", mVideoView.getCurrentPosition()/1000);
                event.putDouble("totalTime", mVideoView.getDuration()/1000); //TODO:mBufferUpdateRunnable
                mEventEmitter.receiveEvent(getTargetId(), Events.PROGRESS.toString(), event);
                mProgressUpdateHandler.postDelayed(mProgressUpdateRunnable,1000);
            }
        }
    };
    return mVideoView;
}
项目:react-native-android-material-calendar-view    文件:MaterialCalendarViewManager.java   
@Override
protected MaterialCalendarView createViewInstance(ThemedReactContext reactContext) {
    MaterialCalendarView materialCalendarView = new MaterialCalendarView(reactContext);
    materialCalendarView.setSelectedDate(new Date());
    onReceiveNativeEvent(reactContext, materialCalendarView);
    return materialCalendarView;
}
项目:RNLearn_Project1    文件:ReactSliderPropertyTest.java   
@Before
public void setup() {
  ReactApplicationContext mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  CatalystInstance mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemedContext = new ThemedReactContext(mContext, mContext);
  mManager = new ReactSliderManager();
}
项目:WaveView-RN    文件:WaveViewManager.java   
@Override
protected WaveView createViewInstance(final ThemedReactContext reactContext) {
    mContext = reactContext;
    final WaveView waveview = new WaveView(reactContext);
    mWaveHelper = new WaveHelper(waveview);
    waveview.setWaterLevelRatio(30/100);
    waveview.setShapeType(WaveView.ShapeType.CIRCLE);
    waveview.setWaveColor(
            Color.parseColor("#28f16d7a"),
            Color.parseColor("#3cf16d7a"));
    waveview.setBorder(mBorderWidth, mBorderColor);
    mWaveHelper.start();

    return waveview;
}
项目:react-native-scandit    文件:SGScanditPicker.java   
@Override
public BarcodePicker createViewInstance(ThemedReactContext context) {
    // Store event dispatcher for emission of events
    eventDispatcher = context.getNativeModule(UIManagerModule.class).getEventDispatcher();

    nativeAppEventEmitter = context.getJSModule(RCTNativeAppEventEmitter.class);

    // BarcodePicker extends View
    picker = new BarcodePicker(context, scanSettings);

    // Tell picker to call our didScan method on scan
    picker.setOnScanListener(this);

    return picker;
}
项目:RNLearn_Project1    文件:ReactWebViewManager.java   
@Override
protected WebView createViewInstance(ThemedReactContext reactContext) {
  ReactWebView webView = new ReactWebView(reactContext);
  webView.setWebChromeClient(new WebChromeClient() {
    @Override
    public boolean onConsoleMessage(ConsoleMessage message) {
      if (ReactBuildConfig.DEBUG) {
        return super.onConsoleMessage(message);
      }
      // Ignore console logs in non debug builds.
      return true;
    }

    @Override
    public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
      callback.invoke(origin, true, false);
    }
  });
  reactContext.addLifecycleEventListener(webView);
  mWebViewConfig.configWebView(webView);
  webView.getSettings().setBuiltInZoomControls(true);
  webView.getSettings().setDisplayZoomControls(false);
  webView.getSettings().setDomStorageEnabled(true);

  // Fixes broken full-screen modals/galleries due to body height being 0.
  webView.setLayoutParams(
          new LayoutParams(LayoutParams.MATCH_PARENT,
              LayoutParams.MATCH_PARENT));

  if (ReactBuildConfig.DEBUG && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    WebView.setWebContentsDebuggingEnabled(true);
  }

  return webView;
}
项目:react-native-fast-image    文件:FastImageViewManager.java   
@Override
public void onProgress(String key, long bytesRead, long expectedLength) {
    List<ImageViewWithUrl> viewsForKey = VIEWS_FOR_URLS.get(key);
    if (viewsForKey != null) {
        for (ImageViewWithUrl view: viewsForKey) {
            WritableMap event = new WritableNativeMap();
            event.putInt("loaded", (int) bytesRead);
            event.putInt("total", (int) expectedLength);
            ThemedReactContext context = (ThemedReactContext) view.getContext();
            RCTEventEmitter eventEmitter = context.getJSModule(RCTEventEmitter.class);
            int viewId = view.getId();
            eventEmitter.receiveEvent(viewId, REACT_ON_PROGRESS_EVENT, event);
        }
    }
}
项目:RNLearn_Project1    文件:ReactImageManager.java   
@Override
public ReactImageView createViewInstance(ThemedReactContext context) {
  return new ReactImageView(
      context,
      getDraweeControllerBuilder(),
      getCallerContext());
}
项目:RNLearn_Project1    文件:FlatNativeViewHierarchyManager.java   
@Override
public void addRootView(
    int tag,
    SizeMonitoringFrameLayout view,
    ThemedReactContext themedContext) {
  FlatViewGroup root = new FlatViewGroup(themedContext);
  view.addView(root);

  // When unmounting, ReactInstanceManager.detachViewFromInstance() will check id of the
  // top-level View (SizeMonitoringFrameLayout) and pass it back to JS. We want that View's id to
  // be set, otherwise NativeViewHierarchyManager will not be able to cleanup properly.
  view.setId(tag);

  addRootViewGroup(tag, root, themedContext);
}
项目:RNLearn_Project1    文件:NativeViewWrapper.java   
@Override
public void setThemedContext(ThemedReactContext themedContext) {
  super.setThemedContext(themedContext);

  if (mReactShadowNode != null) {
    mReactShadowNode.setThemedContext(themedContext);
  }
}
项目:RNLearn_Project1    文件:ReactTextInputManager.java   
@Override
public ReactEditText createViewInstance(ThemedReactContext context) {
  ReactEditText editText = new ReactEditText(context);
  int inputType = editText.getInputType();
  editText.setInputType(inputType & (~InputType.TYPE_TEXT_FLAG_MULTI_LINE));
  editText.setReturnKeyType("done");
  editText.setTextSize(
      TypedValue.COMPLEX_UNIT_PX,
      (int) Math.ceil(PixelUtil.toPixelFromSP(ViewDefaults.FONT_SIZE_SP)));
  return editText;
}
项目:RNLearn_Project1    文件:ReactDrawerLayoutManager.java   
@Override
protected void addEventEmitters(ThemedReactContext reactContext, ReactDrawerLayout view) {
  view.setDrawerListener(
      new DrawerEventEmitter(
          view,
          reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher()));
}
项目:RNLearn_Project1    文件:SwipeRefreshLayoutManager.java   
@Override
protected void addEventEmitters(
    final ThemedReactContext reactContext,
    final ReactSwipeRefreshLayout view) {
  view.setOnRefreshListener(
      new OnRefreshListener() {
        @Override
        public void onRefresh() {
          reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher()
              .dispatchEvent(new RefreshEvent(view.getId()));
        }
      });
}
项目:RNLearn_Project1    文件:ReactPickerManager.java   
@Override
protected void addEventEmitters(
    final ThemedReactContext reactContext,
    final ReactPicker picker) {
  picker.setOnSelectListener(
          new PickerEventEmitter(
                  picker,
                  reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher()));
}
项目:RNLearn_Project1    文件:SwipeRefreshLayoutManager.java   
@Override
protected void addEventEmitters(
    final ThemedReactContext reactContext,
    final ReactSwipeRefreshLayout view) {
  view.setOnRefreshListener(
      new OnRefreshListener() {
        @Override
        public void onRefresh() {
          reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher()
              .dispatchEvent(new RefreshEvent(view.getId()));
        }
      });
}
项目:RNLearn_Project1    文件:ReactWebViewManager.java   
@Override
protected WebView createViewInstance(ThemedReactContext reactContext) {
  ReactWebView webView = new ReactWebView(reactContext);
  webView.setWebChromeClient(new WebChromeClient() {
    @Override
    public boolean onConsoleMessage(ConsoleMessage message) {
      if (ReactBuildConfig.DEBUG) {
        return super.onConsoleMessage(message);
      }
      // Ignore console logs in non debug builds.
      return true;
    }

    @Override
    public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
      callback.invoke(origin, true, false);
    }
  });
  reactContext.addLifecycleEventListener(webView);
  mWebViewConfig.configWebView(webView);
  webView.getSettings().setBuiltInZoomControls(true);
  webView.getSettings().setDisplayZoomControls(false);
  webView.getSettings().setDomStorageEnabled(true);

  // Fixes broken full-screen modals/galleries due to body height being 0.
  webView.setLayoutParams(
          new LayoutParams(LayoutParams.MATCH_PARENT,
              LayoutParams.MATCH_PARENT));

  if (ReactBuildConfig.DEBUG && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    WebView.setWebContentsDebuggingEnabled(true);
  }

  return webView;
}
项目:RNLearn_Project1    文件:ReactImageManager.java   
@Override
public ReactImageView createViewInstance(ThemedReactContext context) {
  return new ReactImageView(
      context,
      getDraweeControllerBuilder(),
      getCallerContext());
}
项目:RNLearn_Project1    文件:ReactTextInputPropertyTest.java   
@Before
public void setup() {
  mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemedContext = new ThemedReactContext(mContext, mContext);
  mManager = new ReactTextInputManager();
  DisplayMetricsHolder.setWindowDisplayMetrics(new DisplayMetrics());
}
项目:RNLearn_Project1    文件:ReactSliderPropertyTest.java   
@Before
public void setup() {
  ReactApplicationContext mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  CatalystInstance mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemedContext = new ThemedReactContext(mContext, mContext);
  mManager = new ReactSliderManager();
}
项目:RNLearn_Project1    文件:ReactImagePropertyTest.java   
@Before
public void setup() {
  mContext = new ReactApplicationContext(RuntimeEnvironment.application);
  mCatalystInstanceMock = ReactTestHelper.createMockCatalystInstance();
  mContext.initializeWithInstance(mCatalystInstanceMock);
  mThemeContext = new ThemedReactContext(mContext, mContext);
  Fresco.initialize(mContext);
  DisplayMetricsHolder.setWindowDisplayMetrics(new DisplayMetrics());
}
项目:RNLearn_Project1    文件:FlatNativeViewHierarchyManager.java   
@Override
public void addRootView(
    int tag,
    SizeMonitoringFrameLayout view,
    ThemedReactContext themedContext) {
  FlatViewGroup root = new FlatViewGroup(themedContext);
  view.addView(root);

  // When unmounting, ReactInstanceManager.detachViewFromInstance() will check id of the
  // top-level View (SizeMonitoringFrameLayout) and pass it back to JS. We want that View's id to
  // be set, otherwise NativeViewHierarchyManager will not be able to cleanup properly.
  view.setId(tag);

  addRootViewGroup(tag, root, themedContext);
}
项目:RNLearn_Project1    文件:NativeViewWrapper.java   
@Override
public void setThemedContext(ThemedReactContext themedContext) {
  super.setThemedContext(themedContext);

  if (mReactShadowNode != null) {
    mReactShadowNode.setThemedContext(themedContext);
  }
}
项目:react-native-videoplayer    文件:ReactExoplayerViewManager.java   
@Override
protected ReactExoplayerView createViewInstance(ThemedReactContext themedReactContext) {
    return new ReactExoplayerView(themedReactContext);
}
项目:RNLearn_Project1    文件:FrescoBasedReactTextInlineImageViewManager.java   
@Override
public View createViewInstance(ThemedReactContext context) {
  throw new IllegalStateException("RCTTextInlineImage doesn't map into a native view");
}