This repository has been archived by the owner on Feb 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vendor NavigationExperimental, update example to sdk15
fbshipit-source-id: 0eeba9e
- Loading branch information
1 parent
c65a31c
commit 6908c9e
Showing
45 changed files
with
3,071 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/navigation-experimental/NavigationAbstractPanResponder.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* @flow | ||
*/ | ||
'use strict'; | ||
|
||
const {PanResponder} = require('react-native'); | ||
|
||
const invariant = require('fbjs/lib/invariant'); | ||
|
||
import type { | ||
NavigationPanPanHandlers, | ||
} from './NavigationTypeDefinition'; | ||
|
||
const EmptyPanHandlers = { | ||
onMoveShouldSetPanResponder: null, | ||
onPanResponderGrant: null, | ||
onPanResponderMove: null, | ||
onPanResponderRelease: null, | ||
onPanResponderTerminate: null, | ||
}; | ||
|
||
/** | ||
* Abstract class that defines the common interface of PanResponder that handles | ||
* the gesture actions. | ||
*/ | ||
class NavigationAbstractPanResponder { | ||
|
||
panHandlers: NavigationPanPanHandlers; | ||
|
||
constructor() { | ||
const config = {}; | ||
Object.keys(EmptyPanHandlers).forEach(name => { | ||
const fn: any = (this: any)[name]; | ||
|
||
invariant( | ||
typeof fn === 'function', | ||
'subclass of `NavigationAbstractPanResponder` must implement method %s', | ||
name | ||
); | ||
|
||
config[name] = fn.bind(this); | ||
}, this); | ||
|
||
this.panHandlers = PanResponder.create(config).panHandlers; | ||
} | ||
} | ||
|
||
module.exports = NavigationAbstractPanResponder; |
47 changes: 47 additions & 0 deletions
47
src/navigation-experimental/NavigationAnimatedValueSubscription.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* Copyright (c) 2015, Facebook, Inc. All rights reserved. | ||
* | ||
* Facebook, Inc. ("Facebook") owns all right, title and interest, including | ||
* all intellectual property and other proprietary rights, in and to the React | ||
* Native CustomComponents software (the "Software"). Subject to your | ||
* compliance with these terms, you are hereby granted a non-exclusive, | ||
* worldwide, royalty-free copyright license to (1) use and copy the Software; | ||
* and (2) reproduce and distribute the Software as part of your own software | ||
* ("Your Software"). Facebook reserves all rights not expressly granted to | ||
* you in this license agreement. | ||
* | ||
* THE SOFTWARE AND DOCUMENTATION, IF ANY, ARE PROVIDED "AS IS" AND ANY EXPRESS | ||
* OR IMPLIED WARRANTIES (INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE) ARE DISCLAIMED. | ||
* IN NO EVENT SHALL FACEBOOK OR ITS AFFILIATES, OFFICERS, DIRECTORS OR | ||
* EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | ||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | ||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | ||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE SOFTWARE, EVEN IF | ||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* @flow | ||
*/ | ||
'use strict'; | ||
|
||
import type { | ||
NavigationAnimatedValue | ||
} from './NavigationTypeDefinition'; | ||
|
||
class NavigationAnimatedValueSubscription { | ||
_value: NavigationAnimatedValue; | ||
_token: string; | ||
|
||
constructor(value: NavigationAnimatedValue, callback: Function) { | ||
this._value = value; | ||
this._token = value.addListener(callback); | ||
} | ||
|
||
remove(): void { | ||
this._value.removeListener(this._token); | ||
} | ||
} | ||
|
||
module.exports = NavigationAnimatedValueSubscription; |
Oops, something went wrong.