diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..15ebf4b --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +elm 0.18 diff --git a/app/DirectionPicker/View.elm b/app/DirectionPicker/View.elm index acc25e4..a599530 100644 --- a/app/DirectionPicker/View.elm +++ b/app/DirectionPicker/View.elm @@ -9,7 +9,7 @@ import App.Font as Font import Message exposing (..) import ScrollableTabView exposing (..) import Model exposing (Model) - +import Hacks.IPhoneX exposing(isIPhoneX) topMargin : Float topMargin = @@ -18,7 +18,7 @@ topMargin = 10 IOS -> - 20 + if isIPhoneX then 40 else 20 view : Model -> List (Node Msg) -> Node Msg diff --git a/app/Hacks/IPhoneX.elm b/app/Hacks/IPhoneX.elm new file mode 100644 index 0000000..932ad6c --- /dev/null +++ b/app/Hacks/IPhoneX.elm @@ -0,0 +1,22 @@ +module Hacks.IPhoneX exposing (isIPhoneX) + +import NativeApi.Dimensions exposing (window) +import NativeApi.Platform as Platform exposing (OS(..)) + +isIPhoneX : Bool +isIPhoneX = + isIOS && matchesIPhoneXDimensions + + +isIOS : Bool +isIOS = + case Platform.os of + Android -> False + IOS -> True + +matchesIPhoneXDimensions : Bool +matchesIPhoneXDimensions = + let + iPhoneXHeight = 812 + in + window.height == iPhoneXHeight || window.width == iPhoneXHeight