Java 类com.facebook.react.modules.core.DefaultHardwareBackBtnHandler 实例源码

项目:react-native-android-fragment    文件:ReactFragment.java   
@Override
public void onResume() {
    super.onResume();
    if (getReactNativeHost().hasInstance()) {
        getReactNativeHost().getReactInstanceManager().onHostResume(getActivity(), (DefaultHardwareBackBtnHandler) getActivity());
    }
}
项目:RNLearn_Project1    文件:ReactInstanceManager.java   
/**
 * Use this method when the activity resumes to enable invoking the back button directly from JS.
 *
 * This method retains an instance to provided mDefaultBackButtonImpl. Thus it's important to pass
 * from the activity instance that owns this particular instance of {@link
 * ReactInstanceManager}, so that once this instance receive {@link #onHostDestroy} event it
 * will clear the reference to that defaultBackButtonImpl.
 *
 * @param defaultBackButtonImpl a {@link DefaultHardwareBackBtnHandler} from an Activity that owns
 * this instance of {@link ReactInstanceManager}.
 */
public void onHostResume(Activity activity, DefaultHardwareBackBtnHandler defaultBackButtonImpl) {
  UiThreadUtil.assertOnUiThread();

  mDefaultBackButtonImpl = defaultBackButtonImpl;
  if (mUseDeveloperSupport) {
    mDevSupportManager.setDevSupportEnabled(true);
  }

  mCurrentActivity = activity;
  moveToResumedLifecycleState(false);
}
项目:RNLearn_Project1    文件:ReactActivityDelegate.java   
protected void onResume() {
  if (getReactNativeHost().hasInstance()) {
    getReactNativeHost().getReactInstanceManager().onHostResume(
      getPlainActivity(),
      (DefaultHardwareBackBtnHandler) getPlainActivity());
  }

  if (mPermissionsCallback != null) {
    mPermissionsCallback.invoke();
    mPermissionsCallback = null;
  }
}
项目:RNLearn_Project1    文件:CoreModulesPackage.java   
CoreModulesPackage(
  ReactInstanceManager reactInstanceManager,
  DefaultHardwareBackBtnHandler hardwareBackBtnHandler,
  UIImplementationProvider uiImplementationProvider,
  boolean lazyViewManagersEnabled) {
  mReactInstanceManager = reactInstanceManager;
  mHardwareBackBtnHandler = hardwareBackBtnHandler;
  mUIImplementationProvider = uiImplementationProvider;
  mLazyViewManagersEnabled = lazyViewManagersEnabled;
}
项目:RNLearn_Project1    文件:ReactInstanceManager.java   
/**
 * Use this method when the activity resumes to enable invoking the back button directly from JS.
 *
 * This method retains an instance to provided mDefaultBackButtonImpl. Thus it's important to pass
 * from the activity instance that owns this particular instance of {@link
 * ReactInstanceManager}, so that once this instance receive {@link #onHostDestroy} event it
 * will clear the reference to that defaultBackButtonImpl.
 *
 * @param defaultBackButtonImpl a {@link DefaultHardwareBackBtnHandler} from an Activity that owns
 * this instance of {@link ReactInstanceManager}.
 */
public void onHostResume(Activity activity, DefaultHardwareBackBtnHandler defaultBackButtonImpl) {
  UiThreadUtil.assertOnUiThread();

  mDefaultBackButtonImpl = defaultBackButtonImpl;
  if (mUseDeveloperSupport) {
    mDevSupportManager.setDevSupportEnabled(true);
  }

  mCurrentActivity = activity;
  moveToResumedLifecycleState(false);
}
项目:RNLearn_Project1    文件:ReactActivityDelegate.java   
protected void onResume() {
  if (getReactNativeHost().hasInstance()) {
    getReactNativeHost().getReactInstanceManager().onHostResume(
      getPlainActivity(),
      (DefaultHardwareBackBtnHandler) getPlainActivity());
  }

  if (mPermissionsCallback != null) {
    mPermissionsCallback.invoke();
    mPermissionsCallback = null;
  }
}
项目:RNLearn_Project1    文件:CoreModulesPackage.java   
CoreModulesPackage(
  ReactInstanceManager reactInstanceManager,
  DefaultHardwareBackBtnHandler hardwareBackBtnHandler,
  UIImplementationProvider uiImplementationProvider,
  boolean lazyViewManagersEnabled) {
  mReactInstanceManager = reactInstanceManager;
  mHardwareBackBtnHandler = hardwareBackBtnHandler;
  mUIImplementationProvider = uiImplementationProvider;
  mLazyViewManagersEnabled = lazyViewManagersEnabled;
}
项目:ReactNativeSignatureExample    文件:ReactInstanceManagerImpl.java   
/**
 * Use this method when the activity resumes to enable invoking the back button directly from JS.
 *
 * This method retains an instance to provided mDefaultBackButtonImpl. Thus it's
 * important to pass from the activity instance that owns this particular instance of {@link
 * ReactInstanceManagerImpl}, so that once this instance receive {@link #onHostDestroy} event it will
 * clear the reference to that defaultBackButtonImpl.
 *
 * @param defaultBackButtonImpl a {@link DefaultHardwareBackBtnHandler} from an Activity that owns
 * this instance of {@link ReactInstanceManagerImpl}.
 */
@Override
public void onHostResume(Activity activity, DefaultHardwareBackBtnHandler defaultBackButtonImpl) {
  UiThreadUtil.assertOnUiThread();


  mDefaultBackButtonImpl = defaultBackButtonImpl;
  if (mUseDeveloperSupport) {
    mDevSupportManager.setDevSupportEnabled(true);
  }

  mCurrentActivity = activity;
  moveToResumedLifecycleState(false);
}
项目:ReactNativeSignatureExample    文件:CoreModulesPackage.java   
CoreModulesPackage(
    ReactInstanceManager reactInstanceManager,
    DefaultHardwareBackBtnHandler hardwareBackBtnHandler,
    UIImplementationProvider uiImplementationProvider) {
  mReactInstanceManager = reactInstanceManager;
  mHardwareBackBtnHandler = hardwareBackBtnHandler;
  mUIImplementationProvider = uiImplementationProvider;
}
项目:react-native-ibeacon-android    文件:ReactInstanceManagerImpl.java   
/**
 * Use this method when the activity resumes to enable invoking the back button directly from JS.
 *
 * This method retains an instance to provided mDefaultBackButtonImpl. Thus it's
 * important to pass from the activity instance that owns this particular instance of {@link
 * ReactInstanceManagerImpl}, so that once this instance receive {@link #onHostDestroy} event it will
 * clear the reference to that defaultBackButtonImpl.
 *
 * @param defaultBackButtonImpl a {@link DefaultHardwareBackBtnHandler} from an Activity that owns
 * this instance of {@link ReactInstanceManagerImpl}.
 */
@Override
public void onHostResume(Activity activity, DefaultHardwareBackBtnHandler defaultBackButtonImpl) {
  UiThreadUtil.assertOnUiThread();


  mDefaultBackButtonImpl = defaultBackButtonImpl;
  if (mUseDeveloperSupport) {
    mDevSupportManager.setDevSupportEnabled(true);
  }

  mCurrentActivity = activity;
  moveToResumedLifecycleState(false);
}
项目:react-native-ibeacon-android    文件:CoreModulesPackage.java   
CoreModulesPackage(
    ReactInstanceManager reactInstanceManager,
    DefaultHardwareBackBtnHandler hardwareBackBtnHandler,
    UIImplementationProvider uiImplementationProvider) {
  mReactInstanceManager = reactInstanceManager;
  mHardwareBackBtnHandler = hardwareBackBtnHandler;
  mUIImplementationProvider = uiImplementationProvider;
}
项目:react-native-box-loaders    文件:ReactInstanceManagerImpl.java   
ReactInstanceManagerImpl(
    Context applicationContext,
    @Nullable Activity currentActivity,
    @Nullable DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler,
    @Nullable String jsBundleFile,
    @Nullable String jsMainModuleName,
    List<ReactPackage> packages,
    boolean useDeveloperSupport,
    @Nullable NotThreadSafeBridgeIdleDebugListener bridgeIdleDebugListener,
    LifecycleState initialLifecycleState,
    UIImplementationProvider uiImplementationProvider,
    NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler,
    @Nullable JSCConfig jscConfig) {
  initializeSoLoaderIfNecessary(applicationContext);

  // TODO(9577825): remove this
  ApplicationHolder.setApplication((Application) applicationContext.getApplicationContext());
  setDisplayMetrics(applicationContext);

  mApplicationContext = applicationContext;
  mCurrentActivity = currentActivity;
  mDefaultBackButtonImpl = defaultHardwareBackBtnHandler;
  mJSBundleFile = jsBundleFile;
  mJSMainModuleName = jsMainModuleName;
  mPackages = packages;
  mUseDeveloperSupport = useDeveloperSupport;
  mDevSupportManager = DevSupportManagerFactory.create(
      applicationContext,
      mDevInterface,
      mJSMainModuleName,
      useDeveloperSupport);
  mBridgeIdleDebugListener = bridgeIdleDebugListener;
  mLifecycleState = initialLifecycleState;
  mUIImplementationProvider = uiImplementationProvider;
  mMemoryPressureRouter = new MemoryPressureRouter(applicationContext);
  mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;
  mJSCConfig = jscConfig;
}
项目:react-native-box-loaders    文件:ReactInstanceManagerImpl.java   
/**
 * Use this method when the activity resumes to enable invoking the back button directly from JS.
 *
 * This method retains an instance to provided mDefaultBackButtonImpl. Thus it's
 * important to pass from the activity instance that owns this particular instance of {@link
 * ReactInstanceManagerImpl}, so that once this instance receive {@link #onHostDestroy} event it will
 * clear the reference to that defaultBackButtonImpl.
 *
 * @param defaultBackButtonImpl a {@link DefaultHardwareBackBtnHandler} from an Activity that owns
 * this instance of {@link ReactInstanceManagerImpl}.
 */
@Override
public void onHostResume(Activity activity, DefaultHardwareBackBtnHandler defaultBackButtonImpl) {
  UiThreadUtil.assertOnUiThread();


  mDefaultBackButtonImpl = defaultBackButtonImpl;
  if (mUseDeveloperSupport) {
    mDevSupportManager.setDevSupportEnabled(true);
  }

  mCurrentActivity = activity;
  moveToResumedLifecycleState(false);
}
项目:react-native-box-loaders    文件:CoreModulesPackage.java   
CoreModulesPackage(
    ReactInstanceManager reactInstanceManager,
    DefaultHardwareBackBtnHandler hardwareBackBtnHandler,
    UIImplementationProvider uiImplementationProvider) {
  mReactInstanceManager = reactInstanceManager;
  mHardwareBackBtnHandler = hardwareBackBtnHandler;
  mUIImplementationProvider = uiImplementationProvider;
}
项目:Ironman    文件:ReactActivityDelegate.java   
protected void onResume() {
  if (getReactNativeHost().hasInstance()) {
    getReactNativeHost().getReactInstanceManager().onHostResume(
      getPlainActivity(),
      (DefaultHardwareBackBtnHandler) getPlainActivity());
  }
}
项目:Ironman    文件:XReactInstanceManagerImpl.java   
/**
 * Use this method when the activity resumes to enable invoking the back button directly from JS.
 *
 * This method retains an instance to provided mDefaultBackButtonImpl. Thus it's important to pass
 * from the activity instance that owns this particular instance of {@link
 * XReactInstanceManagerImpl}, so that once this instance receive {@link #onHostDestroy} event it
 * will clear the reference to that defaultBackButtonImpl.
 *
 * @param defaultBackButtonImpl a {@link DefaultHardwareBackBtnHandler} from an Activity that owns
 * this instance of {@link XReactInstanceManagerImpl}.
 */
@Override
public void onHostResume(Activity activity, DefaultHardwareBackBtnHandler defaultBackButtonImpl) {
  UiThreadUtil.assertOnUiThread();

  mDefaultBackButtonImpl = defaultBackButtonImpl;
  if (mUseDeveloperSupport) {
    mDevSupportManager.setDevSupportEnabled(true);
  }

  mCurrentActivity = activity;
  moveToResumedLifecycleState(false);
}
项目:Ironman    文件:CoreModulesPackage.java   
CoreModulesPackage(
  ReactInstanceManager reactInstanceManager,
  DefaultHardwareBackBtnHandler hardwareBackBtnHandler,
  UIImplementationProvider uiImplementationProvider) {
  mReactInstanceManager = reactInstanceManager;
  mHardwareBackBtnHandler = hardwareBackBtnHandler;
  mUIImplementationProvider = uiImplementationProvider;
}
项目:RNLearn_Project1    文件:ReactInstanceManager.java   
ReactInstanceManager(
  Context applicationContext,
  @Nullable Activity currentActivity,
  @Nullable DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler,
  @Nullable JSBundleLoader bundleLoader,
  @Nullable String jsMainModuleName,
  List<ReactPackage> packages,
  boolean useDeveloperSupport,
  @Nullable NotThreadSafeBridgeIdleDebugListener bridgeIdleDebugListener,
  LifecycleState initialLifecycleState,
  UIImplementationProvider uiImplementationProvider,
  NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler,
  JSCConfig jscConfig,
  @Nullable RedBoxHandler redBoxHandler,
  boolean lazyNativeModulesEnabled,
  boolean lazyViewManagersEnabled,
  boolean useStartupThread) {

  initializeSoLoaderIfNecessary(applicationContext);

  // TODO(9577825): remove this
  ApplicationHolder.setApplication((Application) applicationContext.getApplicationContext());
  DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(applicationContext);

  mApplicationContext = applicationContext;
  mCurrentActivity = currentActivity;
  mDefaultBackButtonImpl = defaultHardwareBackBtnHandler;
  mBundleLoader = bundleLoader;
  mJSMainModuleName = jsMainModuleName;
  mPackages = packages;
  mUseDeveloperSupport = useDeveloperSupport;
  mDevSupportManager = DevSupportManagerFactory.create(
      applicationContext,
      mDevInterface,
      mJSMainModuleName,
      useDeveloperSupport,
      redBoxHandler);
  mBridgeIdleDebugListener = bridgeIdleDebugListener;
  mLifecycleState = initialLifecycleState;
  mUIImplementationProvider = uiImplementationProvider;
  mMemoryPressureRouter = new MemoryPressureRouter(applicationContext);
  mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;
  mJSCConfig = jscConfig;
  mLazyNativeModulesEnabled = lazyNativeModulesEnabled;
  mLazyViewManagersEnabled = lazyViewManagersEnabled;
  mUseStartupThread = useStartupThread;
}
项目:RNLearn_Project1    文件:ReactInstanceManagerBuilder.java   
public ReactInstanceManagerBuilder setDefaultHardwareBackBtnHandler(
  DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler) {
  mDefaultHardwareBackBtnHandler = defaultHardwareBackBtnHandler;
  return this;
}
项目:RNLearn_Project1    文件:ReactInstanceManager.java   
ReactInstanceManager(
  Context applicationContext,
  @Nullable Activity currentActivity,
  @Nullable DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler,
  @Nullable JSBundleLoader bundleLoader,
  @Nullable String jsMainModuleName,
  List<ReactPackage> packages,
  boolean useDeveloperSupport,
  @Nullable NotThreadSafeBridgeIdleDebugListener bridgeIdleDebugListener,
  LifecycleState initialLifecycleState,
  UIImplementationProvider uiImplementationProvider,
  NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler,
  JSCConfig jscConfig,
  @Nullable RedBoxHandler redBoxHandler,
  boolean lazyNativeModulesEnabled,
  boolean lazyViewManagersEnabled,
  boolean useStartupThread) {

  initializeSoLoaderIfNecessary(applicationContext);

  // TODO(9577825): remove this
  ApplicationHolder.setApplication((Application) applicationContext.getApplicationContext());
  DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(applicationContext);

  mApplicationContext = applicationContext;
  mCurrentActivity = currentActivity;
  mDefaultBackButtonImpl = defaultHardwareBackBtnHandler;
  mBundleLoader = bundleLoader;
  mJSMainModuleName = jsMainModuleName;
  mPackages = packages;
  mUseDeveloperSupport = useDeveloperSupport;
  mDevSupportManager = DevSupportManagerFactory.create(
      applicationContext,
      mDevInterface,
      mJSMainModuleName,
      useDeveloperSupport,
      redBoxHandler);
  mBridgeIdleDebugListener = bridgeIdleDebugListener;
  mLifecycleState = initialLifecycleState;
  mUIImplementationProvider = uiImplementationProvider;
  mMemoryPressureRouter = new MemoryPressureRouter(applicationContext);
  mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;
  mJSCConfig = jscConfig;
  mLazyNativeModulesEnabled = lazyNativeModulesEnabled;
  mLazyViewManagersEnabled = lazyViewManagersEnabled;
  mUseStartupThread = useStartupThread;
}
项目:RNLearn_Project1    文件:ReactInstanceManagerBuilder.java   
public ReactInstanceManagerBuilder setDefaultHardwareBackBtnHandler(
  DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler) {
  mDefaultHardwareBackBtnHandler = defaultHardwareBackBtnHandler;
  return this;
}
项目:react-native-box-loaders    文件:ReactInstanceManager.java   
public Builder setDefaultHardwareBackBtnHandler(
    DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler) {
  mDefaultHardwareBackBtnHandler = defaultHardwareBackBtnHandler;
  return this;
}
项目:Ironman    文件:ReactInstanceManager.java   
public Builder setDefaultHardwareBackBtnHandler(
    DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler) {
  mDefaultHardwareBackBtnHandler = defaultHardwareBackBtnHandler;
  return this;
}
项目:Ironman    文件:XReactInstanceManagerImpl.java   
XReactInstanceManagerImpl(
  Context applicationContext,
  @Nullable Activity currentActivity,
  @Nullable DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler,
  @Nullable JSBundleLoader bundleLoader,
  @Nullable String jsMainModuleName,
  List<ReactPackage> packages,
  boolean useDeveloperSupport,
  @Nullable NotThreadSafeBridgeIdleDebugListener bridgeIdleDebugListener,
  LifecycleState initialLifecycleState,
  UIImplementationProvider uiImplementationProvider,
  NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler,
  JSCConfig jscConfig,
  @Nullable RedBoxHandler redBoxHandler,
  boolean lazyNativeModulesEnabled,
  boolean lazyViewManagersEnabled) {

  initializeSoLoaderIfNecessary(applicationContext);

  // TODO(9577825): remove this
  ApplicationHolder.setApplication((Application) applicationContext.getApplicationContext());
  DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(applicationContext);

  mApplicationContext = applicationContext;
  mCurrentActivity = currentActivity;
  mDefaultBackButtonImpl = defaultHardwareBackBtnHandler;
  mBundleLoader = bundleLoader;
  mJSMainModuleName = jsMainModuleName;
  mPackages = packages;
  mUseDeveloperSupport = useDeveloperSupport;
  mDevSupportManager = DevSupportManagerFactory.create(
      applicationContext,
      mDevInterface,
      mJSMainModuleName,
      useDeveloperSupport,
      redBoxHandler);
  mBridgeIdleDebugListener = bridgeIdleDebugListener;
  mLifecycleState = initialLifecycleState;
  mUIImplementationProvider = uiImplementationProvider;
  mMemoryPressureRouter = new MemoryPressureRouter(applicationContext);
  mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;
  mJSCConfig = jscConfig;
  mLazyNativeModulesEnabled = lazyNativeModulesEnabled;
  mLazyViewManagersEnabled = lazyViewManagersEnabled;
}
项目:react-native-navigation    文件:NavigationReactGateway.java   
public void onResumeActivity(Activity activity, DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler) {
    getReactInstanceManager().onHostResume(activity, defaultHardwareBackBtnHandler);
    jsDevReloadHandler.onResumeActivity();
}
项目:ReactNativeSignatureExample    文件:ReactInstanceManager.java   
/**
 * Use this method when the activity resumes to enable invoking the back button directly from JS.
 *
 * This method retains an instance to provided mDefaultBackButtonImpl. Thus it's
 * important to pass from the activity instance that owns this particular instance of {@link
 * ReactInstanceManager}, so that once this instance receive {@link #onHostDestroy} event it will
 * clear the reference to that defaultBackButtonImpl.
 *
 * @param defaultBackButtonImpl a {@link DefaultHardwareBackBtnHandler} from an Activity that owns
 * this instance of {@link ReactInstanceManager}.
 */
public abstract void onHostResume(
  Activity activity,
  DefaultHardwareBackBtnHandler defaultBackButtonImpl);
项目:react-native-ibeacon-android    文件:ReactInstanceManager.java   
/**
 * Use this method when the activity resumes to enable invoking the back button directly from JS.
 *
 * This method retains an instance to provided mDefaultBackButtonImpl. Thus it's
 * important to pass from the activity instance that owns this particular instance of {@link
 * ReactInstanceManager}, so that once this instance receive {@link #onHostDestroy} event it will
 * clear the reference to that defaultBackButtonImpl.
 *
 * @param defaultBackButtonImpl a {@link DefaultHardwareBackBtnHandler} from an Activity that owns
 * this instance of {@link ReactInstanceManager}.
 */
public abstract void onHostResume(
  Activity activity,
  DefaultHardwareBackBtnHandler defaultBackButtonImpl);
项目:react-native-box-loaders    文件:ReactInstanceManager.java   
/**
 * Use this method when the activity resumes to enable invoking the back button directly from JS.
 *
 * This method retains an instance to provided mDefaultBackButtonImpl. Thus it's
 * important to pass from the activity instance that owns this particular instance of {@link
 * ReactInstanceManager}, so that once this instance receive {@link #onHostDestroy} event it will
 * clear the reference to that defaultBackButtonImpl.
 *
 * @param defaultBackButtonImpl a {@link DefaultHardwareBackBtnHandler} from an Activity that owns
 * this instance of {@link ReactInstanceManager}.
 */
public abstract void onHostResume(
  Activity activity,
  DefaultHardwareBackBtnHandler defaultBackButtonImpl);
项目:Ironman    文件:ReactInstanceManager.java   
/**
 * Use this method when the activity resumes to enable invoking the back button directly from JS.
 *
 * This method retains an instance to provided mDefaultBackButtonImpl. Thus it's
 * important to pass from the activity instance that owns this particular instance of {@link
 * ReactInstanceManager}, so that once this instance receive {@link #onHostDestroy} event it will
 * clear the reference to that defaultBackButtonImpl.
 *
 * @param defaultBackButtonImpl a {@link DefaultHardwareBackBtnHandler} from an Activity that owns
 * this instance of {@link ReactInstanceManager}.
 */
public abstract void onHostResume(
  Activity activity,
  DefaultHardwareBackBtnHandler defaultBackButtonImpl);
项目:react-native-navigation    文件:ReactGateway.java   
void onResumeActivity(Activity activity, DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler);