本文整理匯總了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;
}
示例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;
}
示例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;
}
});
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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()));
}
示例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;
}
示例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;
}
示例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();
}