hariroshan / elm-native / Native.Frame

Frame handles all the navigations between pages, tracks history and so on.

Represents the logical View unit that is responsible for navigation within an application. Nested frames are supported, enabling hierarchical navigation scenarios.

Types


type alias Model page =
{ current : page
, history : List page
, encodedNavigationOptions : Json.Encode.Value
, popStack : Basics.Bool 
}

Model that holds the frame related data responsible for page rendering and clearing


type TransitionCurve
    = Ease
    | EaseIn
    | EaseInOut
    | EaseOut
    | Linear
    | Spring
    | CubicBezier (( Basics.Float, Basics.Float )) (( Basics.Float, Basics.Float ))

Animation for transition animation


type TransitionName
    = IosOnlyCurlUp
    | IosOnlyCurlDown
    | AndroidOnlyExplode
    | Fade
    | FlipRight
    | FlipLeft
    | SlideRight
    | SlideLeft
    | SlideTop
    | SlideBottom

Transistion animations supported by frame while navigating to/back page

Functions

defaultNavigationOptions : NavigationOptions

Default navigation options

goBack : Model page -> Model page

Allows frame to go back to previous page

goTo : page -> Maybe NavigationOptions -> Model page -> Model page

Allows frame to move to next page

handleBack : Basics.Bool -> Model page -> Model page

Used to sync pages and history when nativescript navigates to different page.

init : page -> Model page

init function to initalize frame model

mapCurrentPage : (page -> page) -> Model page -> Model page

Map function for mapping current page

view : List (Html.Attribute msg) -> (page -> Html msg) -> Model page -> Html msg

Renders the page on to mobile screen

Setter

setAnimated : b -> { a | animated : Maybe b } -> { a | animated : Maybe b }

Setters for animated

setBackstackVisible : b -> { a | backstackVisible : Maybe b } -> { a | backstackVisible : Maybe b }

Setters for backstackVisible

setClearHistory : b -> { a | clearHistory : Maybe b } -> { a | clearHistory : Maybe b }

Setters for clearHistory

setTransition : b -> { a | transition : Maybe b } -> { a | transition : Maybe b }

Setters for transition

setTransitionAndroid : b -> { a | transitionAndroid : Maybe b } -> { a | transitionAndroid : Maybe b }

Setters for transitionAndroid

setTransitioniOS : b -> { a | transitioniOS : Maybe b } -> { a | transitioniOS : Maybe b }

Setters for transitioniOS