GithubHelp home page GithubHelp logo

jacksteven / shimo-navigation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shimohq/shimo-navigation

0.0 1.0 0.0 139 KB

石墨 react-native app 导航系统

License: MIT License

JavaScript 82.24% Python 4.11% Java 3.14% Objective-C 10.50%

shimo-navigation's Introduction

shimo-navigation

石墨文档 React Native app 导航系统


基于 react-navigation 的修改内容记录:

StackRouter:

  1. 修改了 route.key 的生成规则,由之前随机生成 uuid 改为:通过 Screen.screenKey 的静态方法生成 key ,或取 routeName 作为 key(方便 goBack 指定参数) #1
  2. 修改了调用 navigationOptions 生成函数时传入的 navigation prop 结构,同 #7
  3. 禁止了具有相同 key 的 navigate 操作 #2

StackNavigator:

  1. navigator 的 dispatch 方法里面 nav state 的设置改为同步读写 #3

Transitioner:

  1. _startTransition 在进行 reset 操作的时候禁止了不必要的动画 #4

CardStackTransitioner:

  1. _render 渲染场景的时候获取 transition blur 与 focus 的路由名,并传入 CardStack 的 transitionTargets prop 中 #5

CardStack:

  1. 只有最顶层的 navigator 才支持手势 #6
  2. 拓展了传入 screen 的 navigation prop 结构 #7
{
    ...navigation,
    position, // 转场动画的位置
    progress, // 转场动画的进度
    index, // 当前场景在navigator中的位置
    status: {
        isActive: boolean, // 是否是当前活跃的场景
        isStale: boolean, // 是否是正在退出的场景
        isResponding: boolean, // 是否处于在进行手势返回操作
        isFocusing: boolean, // 是否处于转入动画过程中
        isBlurring: boolean // 是否处于转出动画过程中
    }
}
  1. 支持在 screen navigation options 内指定当前 screen 的 mode #8
  2. 支持在 screen navigation options 内指定当前 screen 的 gesturesEnabled #9
class SomeScreen extends Component {
  static navigationOptions = {
    mode: 'card',
    gesturesEnabled: false
  };
}

ScenesReducers

  1. 修复 reset 生成的 scenes 错误 #10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.