diff options
| author | anderklander <anderklander@gmail.com> | 2018-04-06 11:31:59 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2018-04-16 12:01:12 +0200 |
| commit | f400e025eedc9323fe8c14f8c813c45bdaedc85b (patch) | |
| tree | 12ba29b38d5e7de759bccdcf78983bc40ea052f4 /app/components/TransitionContainer.js | |
| parent | 959f1d1b0d1c47e8016188ac071d99a3ffb03824 (diff) | |
| download | mullvadvpn-f400e025eedc9323fe8c14f8c813c45bdaedc85b.tar.xz mullvadvpn-f400e025eedc9323fe8c14f8c813c45bdaedc85b.zip | |
Modification of TransistionContainer for android compatibility
Diffstat (limited to 'app/components/TransitionContainer.js')
| -rw-r--r-- | app/components/TransitionContainer.js | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/app/components/TransitionContainer.js b/app/components/TransitionContainer.js index 4dfeb99c70..a1609890d8 100644 --- a/app/components/TransitionContainer.js +++ b/app/components/TransitionContainer.js @@ -2,6 +2,7 @@ import * as React from 'react'; import { Styles, Component, Animated, View, Types, UserInterface } from 'reactxp'; import type { TransitionGroupProps } from '../transitions'; +import getStyles from './TransitionContainerStyles' type TransitionContainerProps = { children: React.Node, @@ -25,20 +26,6 @@ export default class TransitionContainer extends Component<TransitionContainerPr this.state = { dimensions, - animationStyles: { - style: Styles.createAnimatedViewStyle({ - position: 'absolute', - width: dimensions.width, - height: dimensions.height, - }), - allowPointerEvents: Styles.createAnimatedViewStyle({ - pointerEvents: 'auto', - }) - }, - transitionContainerStyle: Styles.createViewStyle({ - width: dimensions.width, - height: dimensions.height, - }) }; } @@ -63,7 +50,7 @@ export default class TransitionContainer extends Component<TransitionContainerPr onFinishedAnimation() { this.setState({ - childrenAnimation: null,//this.state.animationStyles.allowPointerEvents, + childrenAnimation: getStyles().allowPointerEventsStyle, previousChildren: null }); } @@ -182,14 +169,14 @@ export default class TransitionContainer extends Component<TransitionContainerPr const { children } = this.props; const { previousChildren, childrenAnimation, previousChildrenAnimation } = this.state; return ( - <View style={ this.state.transitionContainerStyle }> + <View style={ getStyles().transitionContainerStyle }> { previousChildren && (<Animated.View key={ previousChildren && previousChildren.key } - style={[this.state.animationStyles.style, previousChildrenAnimation]}> + style={[getStyles().animationDefaultStyle, previousChildrenAnimation]}> { previousChildren } </Animated.View>) } - <Animated.View key={ children.key } style={[this.state.animationStyles.style, childrenAnimation]}> + <Animated.View key={ children.key } style={[getStyles().animationDefaultStyle, childrenAnimation]}> { children } </Animated.View> |
