diff --git a/package.json b/package.json index a7d80e7..5e8abdc 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,6 @@ "react-native-background-timer": "^2.4.1", "react-native-crypto": "^2.2.0", "react-native-exception-handler": "^2.10.10", - "react-native-extra-dimensions-android": "^1.2.5", "react-native-fs": "^2.19.0", "react-native-navigation": "^7.26.0", "react-native-pager-view": "^5.4.15", diff --git a/src/utils/hooks/useKeyboard.js b/src/utils/hooks/useKeyboard.js index 8e6a009..14b04b2 100644 --- a/src/utils/hooks/useKeyboard.js +++ b/src/utils/hooks/useKeyboard.js @@ -6,11 +6,11 @@ export default () => { const [keyboardHeight, setKeyboardHeight] = useState(0) const handleKeyboardDidShow = e => { - const isShow = e.endCoordinates.height > 115 - setShown(isShow) - setKeyboardHeight(isShow ? e.endCoordinates.height : 0) - // setShown(true) - // setKeyboardHeight(e.endCoordinates.height) + // const isShow = e.endCoordinates.height > 115 + // setShown(isShow) + // setKeyboardHeight(isShow ? e.endCoordinates.height : 0) + setShown(true) + setKeyboardHeight(e.endCoordinates.height) } const handleKeyboardDidHide = () => { diff --git a/src/utils/tools.js b/src/utils/tools.js index a4fa374..1566ce1 100644 --- a/src/utils/tools.js +++ b/src/utils/tools.js @@ -1,5 +1,5 @@ import { Platform, NativeModules, ToastAndroid, BackHandler, Linking, Dimensions, Alert } from 'react-native' -import ExtraDimensions from 'react-native-extra-dimensions-android' +// import ExtraDimensions from 'react-native-extra-dimensions-android' import Clipboard from '@react-native-clipboard/clipboard' import { getData, setData, getAllKeys, removeData, removeDataMultiple, setDataMultiple, getDataMultiple } from '@/plugins/storage' import { storageDataPrefix } from '@/config' @@ -37,23 +37,24 @@ const handleSaveListScrollPosition = throttle(data => { // fix https://github.com/facebook/react-native/issues/4934 export const getWindowSise = windowDimensions => { if (!windowDimensions) windowDimensions = Dimensions.get('window') - if (Platform.OS === 'ios') return windowDimensions - const windowSize = { - width: ExtraDimensions.getRealWindowWidth(), - height: ExtraDimensions.getRealWindowHeight(), - } - if ( - (windowDimensions.height > windowDimensions.width && windowSize.height < windowSize.width) || - (windowDimensions.width > windowDimensions.height && windowSize.width < windowSize.height) - ) { - windowSize.height = windowSize.width - } - windowSize.width = windowDimensions.width + // if (Platform.OS === 'ios') return windowDimensions + return windowDimensions + // const windowSize = { + // width: ExtraDimensions.getRealWindowWidth(), + // height: ExtraDimensions.getRealWindowHeight(), + // } + // if ( + // (windowDimensions.height > windowDimensions.width && windowSize.height < windowSize.width) || + // (windowDimensions.width > windowDimensions.height && windowSize.width < windowSize.height) + // ) { + // windowSize.height = windowSize.width + // } + // windowSize.width = windowDimensions.width - if (ExtraDimensions.isSoftMenuBarEnabled()) { - windowSize.height -= ExtraDimensions.getSoftMenuBarHeight() - } - return windowSize + // if (ExtraDimensions.isSoftMenuBarEnabled()) { + // windowSize.height -= ExtraDimensions.getSoftMenuBarHeight() + // } + // return windowSize } diff --git a/yarn.lock b/yarn.lock index d2a3a38..e8534bf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5977,11 +5977,6 @@ react-native-exception-handler@^2.10.10: resolved "https://registry.yarnpkg.com/react-native-exception-handler/-/react-native-exception-handler-2.10.10.tgz#b6bfe2b7e6ea4a4deb1f518f48ce2ee1d4843497" integrity sha512-otAXGoZDl1689OoUJWN/rXxVbdoZ3xcmyF1uq/CsizdLwwyZqVGd6d+p/vbYvnF996FfEyAEBnHrdFxulTn51w== -react-native-extra-dimensions-android@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/react-native-extra-dimensions-android/-/react-native-extra-dimensions-android-1.2.5.tgz#8ade91029aaac7519bf305116d39019e618a60f0" - integrity sha512-eorFo9X1vEqAWUkgcZ300yKBG1wtgNeE7tdWAH2CE+P50FGTniJg5Sr6l1iPWG8ZskQOuF+KeiSTFlDa4vLfMw== - react-native-fs@^2.19.0: version "2.19.0" resolved "https://registry.yarnpkg.com/react-native-fs/-/react-native-fs-2.19.0.tgz#5747eb52a5a3d2b31c8fb76f5f8044d0a855122c"