当前位置: 首页>>代码示例>>Java>>正文


Java ThemedReactContext类代码示例

本文整理汇总了Java中com.facebook.react.uimanager.ThemedReactContext的典型用法代码示例。如果您正苦于以下问题:Java ThemedReactContext类的具体用法?Java ThemedReactContext怎么用?Java ThemedReactContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ThemedReactContext类属于com.facebook.react.uimanager包,在下文中一共展示了ThemedReactContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createViewInstance

import com.facebook.react.uimanager.ThemedReactContext; //导入依赖的package包/类
@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;
}
 
开发者ID:2534290808,项目名称:react-native-android-piliplayer,代码行数:18,代码来源:PLVideoTextureViewManager.java

示例2: createViewInstance

import com.facebook.react.uimanager.ThemedReactContext; //导入依赖的package包/类
@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;
}
 
开发者ID:pili-engineering,项目名称:pili-react-native,代码行数:18,代码来源:PiliPlayerViewManager.java

示例3: createViewInstance

import com.facebook.react.uimanager.ThemedReactContext; //导入依赖的package包/类
@Override
protected MaterialCalendarView createViewInstance(ThemedReactContext reactContext) {
    MaterialCalendarView materialCalendarView = new MaterialCalendarView(reactContext);
    materialCalendarView.setSelectedDate(new Date());
    onReceiveNativeEvent(reactContext, materialCalendarView);
    return materialCalendarView;
}
 
开发者ID:williamcabrera4,项目名称:react-native-android-material-calendar-view,代码行数:8,代码来源:MaterialCalendarViewManager.java

示例4: addEventEmitters

import com.facebook.react.uimanager.ThemedReactContext; //导入依赖的package包/类
@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;
        }
      });
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:26,代码来源:ReactToolbarManager.java

示例5: createViewInstance

import com.facebook.react.uimanager.ThemedReactContext; //导入依赖的package包/类
@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;
}
 
开发者ID:timomeh,项目名称:react-native-android-bottom-navigation,代码行数:22,代码来源:RNBottomNavigationManager.java

示例6: addEventEmitters

import com.facebook.react.uimanager.ThemedReactContext; //导入依赖的package包/类
@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()));
                }

            });
}
 
开发者ID:React-Native-Library,项目名称:react-native-pull-up-down-refresh,代码行数:21,代码来源:RCTSwipeRefreshLayoutManager.java

示例7: setThemedContext

import com.facebook.react.uimanager.ThemedReactContext; //导入依赖的package包/类
@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);
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:20,代码来源:RCTTextInput.java

示例8: setThemedContext

import com.facebook.react.uimanager.ThemedReactContext; //导入依赖的package包/类
@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);
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:20,代码来源:ReactTextInputShadowNode.java

示例9: createViewInstance

import com.facebook.react.uimanager.ThemedReactContext; //导入依赖的package包/类
@Override
public WebRTCView createViewInstance(ThemedReactContext context) {
  mContext = context;
  WebRTCView view = new WebRTCView(context);
  // view.setPreserveEGLContextOnPause(true);
  // view.setKeepScreenOn(true);
  return view;
}
 
开发者ID:angellsl10,项目名称:react-native-webrtc,代码行数:9,代码来源:RTCVideoViewManager.java

示例10: createViewInstance

import com.facebook.react.uimanager.ThemedReactContext; //导入依赖的package包/类
@Override
public TweetView createViewInstance(ThemedReactContext context) {
  ImageLoaderFix.apply(context);
  TweetView tweetView = createTweetView(context);
  tweetView.addSizeChangeListener(this);

  return tweetView;
}
 
开发者ID:netceteragroup,项目名称:react-native-twitterkit,代码行数:9,代码来源:ReactTweetViewManager.java

示例11: createViewInstance

import com.facebook.react.uimanager.ThemedReactContext; //导入依赖的package包/类
@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;
}
 
开发者ID:cesardeazevedo,项目名称:react-native-collapsing-toolbar,代码行数:12,代码来源:CollapsingParallaxManager.java

示例12: addEventEmitters

import com.facebook.react.uimanager.ThemedReactContext; //导入依赖的package包/类
@Override
protected void addEventEmitters(ThemedReactContext reactContext, ReactDrawerLayout view) {
  view.setDrawerListener(
      new DrawerEventEmitter(
          view,
          reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher()));
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:8,代码来源:ReactDrawerLayoutManager.java

示例13: createViewInstance

import com.facebook.react.uimanager.ThemedReactContext; //导入依赖的package包/类
@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;
}
 
开发者ID:An-uking,项目名称:react-native-pili-player,代码行数:29,代码来源:PiliLiveViewManager.java

示例14: createViewInstance

import com.facebook.react.uimanager.ThemedReactContext; //导入依赖的package包/类
@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;
}
 
开发者ID:An-uking,项目名称:react-native-pili-player,代码行数:31,代码来源:PiliPlayerViewManager.java

示例15: setup

import com.facebook.react.uimanager.ThemedReactContext; //导入依赖的package包/类
@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();
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:9,代码来源:ReactSliderPropertyTest.java


注:本文中的com.facebook.react.uimanager.ThemedReactContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。