From ed1b91383b81a8bff4a320558eb3ddb03ff1a3d8 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Tue, 13 Mar 2018 09:15:53 +0800 Subject: [PATCH 1/5] workaround android zindex issue fix android zindex issue --- src/Drawer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Drawer.js b/src/Drawer.js index 20f5e04..29d2d52 100644 --- a/src/Drawer.js +++ b/src/Drawer.js @@ -364,6 +364,7 @@ const styles = StyleSheet.create({ alignItems: 'center', // center children justifyContent: 'flex-start', // align popup at the bottom backgroundColor: 'black', + elevation: 1, // fix android dynamic zindex issue }, // Body content: { From 5e1193d6a1d008f7c02b9dccad6d0e2a3ced2b5a Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Tue, 13 Mar 2018 09:31:45 +0800 Subject: [PATCH 2/5] Fix android zindex issue Fix android zindex issue --- src/Drawer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Drawer.js b/src/Drawer.js index 29d2d52..98c1590 100644 --- a/src/Drawer.js +++ b/src/Drawer.js @@ -357,6 +357,7 @@ const styles = StyleSheet.create({ alignItems: 'center', // center children justifyContent: 'flex-end', // align popup at the bottom backgroundColor: 'transparent', // transparent background + elevation: 1, // fix android dynamic zindex issue }, // Semi-transparent background below popup backdrop: { @@ -364,7 +365,6 @@ const styles = StyleSheet.create({ alignItems: 'center', // center children justifyContent: 'flex-start', // align popup at the bottom backgroundColor: 'black', - elevation: 1, // fix android dynamic zindex issue }, // Body content: { From 13a261b3f24eaea7ebe29c35fea38c9245fe235f Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 14 Mar 2018 18:37:40 +0800 Subject: [PATCH 3/5] Bug fix for Android OS with hideable soft menu keys --- README.md | 2 ++ package.json | 5 +++-- src/Drawer.js | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 306e58c..f31b638 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,11 @@ #### Step 1 Install [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons#installation) if you do not already have it. +Install [react-native-extra-dimensions-android](https://github.com/Sunhat/react-native-extra-dimensions-android#installation) if you do not already have it. ``` npm install react-native-vector-icons --save && react-native link react-native-vector-icons +npm install react-native-extra-dimensions-android --save && react-native link react-native-extra-dimensions-android ``` #### Step 2 diff --git a/package.json b/package.json index 771d0ca..f44f4b4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-bottom-drawer", - "version": "1.0.2", + "version": "1.0.3", "main": "index.js", "scripts": { "test": "jest" @@ -21,7 +21,8 @@ "drawer" ], "peerDependencies": { - "react-native-vector-icons": "^4.0.0" + "react-native-vector-icons": "^4.0.0", + "react-native-extra-dimensions-android": "^0.21.0", }, "devDependencies": { "babel-jest": "^19.0.0", diff --git a/src/Drawer.js b/src/Drawer.js index 20f5e04..a312125 100644 --- a/src/Drawer.js +++ b/src/Drawer.js @@ -12,9 +12,11 @@ import { View } from 'react-native'; import Icon from 'react-native-vector-icons/Ionicons'; +import ExtraDimensions from 'react-native-extra-dimensions-android'; // Get screen dimensions -const { width, height } = Dimensions.get('window'); +const { width } = Dimensions.get('window'); +const height = Platform.OS === 'ios' ? Dimensions.get('screen').height : Dimensions.get('screen').height - ExtraDimensions.get('SOFT_MENU_BAR_HEIGHT'); export default class Drawer extends Component { From d5a2d4f565ed4bc842326a80d232aa98e9e1889e Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 15 Mar 2018 09:11:05 +0800 Subject: [PATCH 4/5] Fixed trailing comma in package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f44f4b4..c5e6eee 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ ], "peerDependencies": { "react-native-vector-icons": "^4.0.0", - "react-native-extra-dimensions-android": "^0.21.0", + "react-native-extra-dimensions-android": "^0.21.0" }, "devDependencies": { "babel-jest": "^19.0.0", From a334ef8417f1c643c5171e16dbe7e85a2873c3a8 Mon Sep 17 00:00:00 2001 From: fattahmuhyiddeen Date: Mon, 26 Mar 2018 15:52:25 +0800 Subject: [PATCH 5/5] Update Drawer.js --- src/Drawer.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Drawer.js b/src/Drawer.js index 7892235..73ca928 100644 --- a/src/Drawer.js +++ b/src/Drawer.js @@ -32,6 +32,7 @@ export default class Drawer extends Component { headerHeight: PropTypes.number, // Height of the visible teaser area at the bottom of the screen teaserHeight: PropTypes.number, + onClose: PropTypes.func, }; // Set default prop values @@ -40,6 +41,7 @@ export default class Drawer extends Component { header: 'Messages', headerHeight: 70, teaserHeight: 75, + onClose:()=>{} }; // Define state @@ -308,6 +310,7 @@ export default class Drawer extends Component { // Minimize window and keep a teaser at the bottom close = () => { + this.props.onClose(); this._scrollView.scrollTo({ y: 0 }); Animated.timing(this._animatedPosition, { toValue: this.config.position.start,