react-native-navigation的迁移库

platformSpecific.android.js 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 setScreenTitleBarTitle(screenInstanceID, title) {
  25. NativeReactModule.setScreenTitleBarTitle(screenInstanceID, title);
  26. }
  27. function setScreenTitleBarButtons(screenInstanceID, navigatorEventID, rightButtons, leftButton) {
  28. NativeReactModule.setScreenTitleBarButtons(screenInstanceID, navigatorEventID, rightButtons, leftButton);
  29. }
  30. function showModal(screenParams) {
  31. NativeReactModule.showModal(screenParams);
  32. }
  33. function dismissTopModal() {
  34. NativeReactModule.dismissTopModal();
  35. }
  36. function dismissAllModals() {
  37. NativeReactModule.dismissAllModals();
  38. }
  39. module.exports = {
  40. startApp,
  41. push,
  42. pop,
  43. popToRoot,
  44. newStack,
  45. toggleTopBarVisible,
  46. setScreenTitleBarTitle,
  47. setScreenTitleBarButtons,
  48. showModal,
  49. dismissTopModal,
  50. dismissAllModals
  51. };