Skip to content

Commit 1affdb7

Browse files
authored
Merge pull request rationalappdev#1 from cyphereza/master
Bug fix for Android OS with hideable soft keys
2 parents 5e1193d + 19a720c commit 1affdb7

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
#### Step 1
1717

1818
Install [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons#installation) if you do not already have it.
19+
Install [react-native-extra-dimensions-android](https://github.com/Sunhat/react-native-extra-dimensions-android#installation) if you do not already have it.
1920

2021
```
2122
npm install react-native-vector-icons --save && react-native link react-native-vector-icons
23+
npm install react-native-extra-dimensions-android --save && react-native link react-native-extra-dimensions-android
2224
```
2325

2426
#### Step 2

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-bottom-drawer",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"main": "index.js",
55
"scripts": {
66
"test": "jest"
@@ -21,7 +21,8 @@
2121
"drawer"
2222
],
2323
"peerDependencies": {
24-
"react-native-vector-icons": "^4.0.0"
24+
"react-native-vector-icons": "^4.0.0",
25+
"react-native-extra-dimensions-android": "^0.21.0",
2526
},
2627
"devDependencies": {
2728
"babel-jest": "^19.0.0",

src/Drawer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ import {
1212
View
1313
} from 'react-native';
1414
import Icon from 'react-native-vector-icons/Ionicons';
15+
import ExtraDimensions from 'react-native-extra-dimensions-android';
1516

1617
// Get screen dimensions
17-
const { width, height } = Dimensions.get('window');
18+
const { width } = Dimensions.get('window');
19+
const height = Platform.OS === 'ios' ? Dimensions.get('screen').height : Dimensions.get('screen').height - ExtraDimensions.get('SOFT_MENU_BAR_HEIGHT');
1820

1921
export default class Drawer extends Component {
2022

0 commit comments

Comments
 (0)