react-native-navigation的迁移库

platformSpecific.android.js 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import React, {Component} from 'react';
  2. import {AppRegistry, NativeModules} from 'react-native';
  3. import _ from 'lodash';
  4. import Navigation from './Navigation';
  5. const NativeReactModule = NativeModules.NavigationReactModule;
  6. function startApp(activityParams) {
  7. NativeReactModule.startApp(activityParams);
  8. }
  9. function push(screenParams) {
  10. NativeReactModule.push(screenParams);
  11. }
  12. function pop(screenParams) {
  13. NativeReactModule.pop(screenParams);
  14. }
  15. function popToRoot(screenParams) {
  16. NativeReactModule.popToRoot(screenParams);
  17. }
  18. function newStack(screenParams) {
  19. NativeReactModule.newStack(screenParams);
  20. }
  21. function toggleTopBarVisible(screenInstanceID, visible, animated) {
  22. NativeReactModule.setTopBarVisible(screenInstanceID, visible, animated);
  23. }
  24. function toggleBottomTabsVisible(visible, animated) {
  25. NativeReactModule.setBottomTabsVisible(visible, animated);
  26. }
  27. function setScreenTitleBarTitle(screenInstanceID, title) {
  28. NativeReactModule.setScreenTitleBarTitle(screenInstanceID, title);
  29. }
  30. function setScreenTitleBarButtons(screenInstanceID, navigatorEventID, rightButtons, leftButton) {
  31. NativeReactModule.setScreenTitleBarButtons(screenInstanceID, navigatorEventID, rightButtons, leftButton);
  32. }
  33. function showModal(screenParams) {
  34. NativeReactModule.showModal(screenParams);
  35. }
  36. function dismissTopModal() {
  37. NativeReactModule.dismissTopModal();
  38. }
  39. function dismissAllModals() {
  40. NativeReactModule.dismissAllModals();
  41. }
  42. module.exports = {
  43. startApp,
  44. push,
  45. pop,
  46. popToRoot,
  47. newStack,
  48. toggleTopBarVisible,
  49. toggleBottomTabsVisible,
  50. setScreenTitleBarTitle,
  51. setScreenTitleBarButtons,
  52. showModal,
  53. dismissTopModal,
  54. dismissAllModals
  55. };