1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-12 22:57:38 +02:00

Android: Fixes #2694: Remove gap on top of window when there is a notch

This commit is contained in:
Laurent Cozic
2020-03-09 23:44:38 +00:00
parent 84c3ef144d
commit b367955e56
2 changed files with 9 additions and 19 deletions

View File

@ -1,12 +1,18 @@
const React = require('react');
import { View, Platform, SafeAreaView, StyleSheet, StatusBar } from 'react-native';
import DeviceInfo from 'react-native-device-info';
import { View, Platform, SafeAreaView, StyleSheet /* , StatusBar */ } from 'react-native';
// import DeviceInfo from 'react-native-device-info';
// Untested! This should check if the device has a notch and, if it does, apply
// an extra padding on top of the screen.
const styles = StyleSheet.create({
AndroidSafeArea: {
paddingTop: Platform.OS === 'android' && DeviceInfo.hasNotch() ? StatusBar.currentHeight : 0,
// Disabled for now because it seems that even when there's a notch the system status bar
// covers it, and thus we should add our own gap.
// Can only test on emulator though
// Fixes: https://github.com/laurent22/joplin/issues/2694
// paddingTop: Platform.OS === 'android' && DeviceInfo.hasNotch() ? StatusBar.currentHeight : 0,
paddingTop: 0,
},
});