File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ const dimensionsScope = {
6
6
WINDOW : 'window' ,
7
7
SCREEN : 'screen'
8
8
}
9
- const orientations = {
9
+ export const orientations = {
10
10
PORTRAIT : 'portrait' ,
11
11
LANDSCAPE : 'landscape'
12
12
}
@@ -35,11 +35,13 @@ function setStatusBarHeight() {
35
35
export const isRTL = I18nManager . isRTL ;
36
36
37
37
const { height, width} = Dimensions . get ( dimensionsScope . WINDOW ) ;
38
+ const screenAspectRatio = screenWidth < screenHeight ? screenHeight / screenWidth : screenWidth / screenHeight ;
38
39
export let orientation = getOrientation ( height , width ) ;
39
40
export let screenWidth = width ;
40
41
export let screenHeight = height ;
41
42
export let isSmallScreen = screenWidth <= 340 ;
42
43
export let isShortScreen = screenHeight <= 600 ;
44
+ export const isTablet = Platform . isPad || ( screenAspectRatio < 1.6 && Math . max ( screenWidth , screenHeight ) >= 900 ) ;
43
45
44
46
export function getSafeAreaInsets ( ) {
45
47
return ( orientation === orientation . LANDSCAPE ) ?
You can’t perform that action at this time.
0 commit comments