@@ -33,7 +33,7 @@ export default class ActionButton extends Component {
3333 //////////////////////
3434
3535 getContainerStyles ( ) {
36- return [ styles . overlay , this . getOrientation ( ) , this . getOffsetXY ( ) ] ;
36+ return [ this . getOverlayStyles ( ) , this . getOrientation ( ) , this . getOffsetXY ( ) ] ;
3737 }
3838
3939 getActionButtonStyles ( ) {
@@ -56,7 +56,8 @@ export default class ActionButton extends Component {
5656 getOffsetXY ( ) {
5757 return {
5858 paddingHorizontal : this . props . offsetX - 8 ,
59- paddingBottom : this . props . offsetY
59+ paddingBottom : this . props . verticalOrientation === 'up' ? this . props . offsetY : 0 ,
60+ paddingTop : this . props . verticalOrientation === 'down' ? this . props . offsetY : 0
6061 } ;
6162 }
6263
@@ -65,22 +66,30 @@ export default class ActionButton extends Component {
6566 styles . actionsVertical ,
6667 this . getOrientation ( ) ,
6768 {
68- flexDirection : this . props . verticalOrientation === 'down' ?
69- 'column-reverse' :
70- 'column' ,
69+ flexDirection : 'column' ,
70+ justifyContent : this . props . verticalOrientation === 'up' ? 'flex-end' : 'flex-start'
7171 } ,
7272 ] ;
7373 }
7474
75+ getOverlayStyles ( ) {
76+ return [
77+ styles . overlay ,
78+ {
79+ justifyContent : this . props . verticalOrientation === 'up' ? 'flex-end' : 'flex-start'
80+ }
81+ ]
82+ }
83+
7584
7685 //////////////////////
7786 // RENDER METHODS
7887 //////////////////////
7988
8089 render ( ) {
8190 return (
82- < View pointerEvents = "box-none" style = { styles . overlay } >
83- < Animated . View pointerEvents = "none" style = { [ styles . overlay , {
91+ < View pointerEvents = "box-none" style = { this . getOverlayStyles ( ) } >
92+ < Animated . View pointerEvents = "none" style = { [ this . getOverlayStyles ( ) , {
8493 backgroundColor : this . props . bgColor ,
8594 opacity : this . anim
8695 } ] } >
@@ -207,7 +216,7 @@ export default class ActionButton extends Component {
207216 return (
208217 < TouchableOpacity
209218 activeOpacity = { 1 }
210- style = { styles . overlay }
219+ style = { this . getOverlayStyles ( ) }
211220 onPress = { this . reset . bind ( this ) }
212221 />
213222 ) ;
@@ -298,7 +307,6 @@ const styles = StyleSheet.create({
298307 right : 0 ,
299308 top : 0 ,
300309 backgroundColor : 'transparent' ,
301- justifyContent : 'flex-end' ,
302310 } ,
303311 actionBarItem : {
304312 alignItems : 'center' ,
@@ -327,6 +335,5 @@ const styles = StyleSheet.create({
327335 } ,
328336 actionsVertical : {
329337 flex : 1 ,
330- justifyContent : 'flex-end' ,
331- } ,
338+ }
332339} ) ;
0 commit comments