From b367955e566f10ab6c29c63419845520de022084 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Mon, 9 Mar 2020 23:44:38 +0000 Subject: [PATCH] Android: Fixes #2694: Remove gap on top of window when there is a notch --- ReactNativeClient/lib/components/SafeAreaView.js | 12 +++++++++--- package-lock.json | 16 ---------------- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/ReactNativeClient/lib/components/SafeAreaView.js b/ReactNativeClient/lib/components/SafeAreaView.js index eb4ccff436..883e49ef5e 100644 --- a/ReactNativeClient/lib/components/SafeAreaView.js +++ b/ReactNativeClient/lib/components/SafeAreaView.js @@ -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, }, }); diff --git a/package-lock.json b/package-lock.json index cbe9d17e54..3f519948f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -59,16 +59,6 @@ "any-observable": "^0.3.0" } }, - "@types/draft-js": { - "version": "0.10.38", - "resolved": "https://registry.npmjs.org/@types/draft-js/-/draft-js-0.10.38.tgz", - "integrity": "sha512-iDg8fJATjGVfQVv/dysAMMcPwORyJix2AyAm8OdwseteYh1jV+Xwlz+1HddoCWxQWqzWf/MDkNQH5sLYG47e0w==", - "dev": true, - "requires": { - "@types/react": "*", - "immutable": "~3.7.4" - } - }, "@types/eslint-visitor-keys": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", @@ -3302,12 +3292,6 @@ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, - "immutable": { - "version": "3.7.6", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-3.7.6.tgz", - "integrity": "sha1-E7TTyxK++hVIKib+Gy665kAHHks=", - "dev": true - }, "import-fresh": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz",