Created
February 2, 2017 14:44
-
-
Save jsteiner/ae9ffbb1645d82519418116b36a41824 to your computer and use it in GitHub Desktop.
Elm Native UI wrapper example for: https://github.com/skv-headless/react-native-scrollable-tab-view
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Be sure this is set | |
"native-modules": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ScrollableTabView | |
exposing | |
( view | |
, initialPage | |
, tabBarActiveTextColor | |
, tabBarInactiveTextColor | |
, tabBarUnderlineStyle | |
, tabBarTextStyle | |
, tabBarStyle | |
) | |
import NativeUi as NativeUi exposing (Property, Node) | |
import NativeUi.Style as Style | |
import Native.ScrollableTabView | |
import Json.Encode | |
view : List (Property msg) -> List (Node msg) -> Node msg | |
view = | |
NativeUi.customNode "ScrollableTabView" Native.ScrollableTabView.view | |
initialPage : Int -> Property msg | |
initialPage = | |
NativeUi.property "initialPage" << Json.Encode.int | |
tabBarActiveTextColor : String -> Property msg | |
tabBarActiveTextColor = | |
NativeUi.property "tabBarActiveTextColor" << Json.Encode.string | |
tabBarInactiveTextColor : String -> Property msg | |
tabBarInactiveTextColor = | |
NativeUi.property "tabBarInactiveTextColor" << Json.Encode.string | |
tabBarUnderlineStyle : List Style.Style -> Property msg | |
tabBarUnderlineStyle = | |
NativeUi.property "tabBarUnderlineStyle" << Style.encode | |
tabBarTextStyle : List Style.Style -> Property msg | |
tabBarTextStyle = | |
NativeUi.property "tabBarTextStyle" << Style.encode | |
tabBarStyle : List Style.Style -> Property msg | |
tabBarStyle = | |
NativeUi.property "tabBarStyle" << Style.encode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Gists don't allow subdirectories, but this is actually Native/ScrollableTabView.js | |
const _user$project$Native_ScrollableTabView = function () { | |
var ScrollableTabView = require('react-native-scrollable-tab-view'); | |
return { | |
view: ScrollableTabView, | |
}; | |
}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@jsteiner Do you have a project you used it with? I'm probably too new to Elm to get this. Nevertheless, I got it to compile, now struggling to import and actually use it. How would you use the ScrollableTabView? I can import the module but not use it, maybe a syntax issue / not getting some basics.
Structure
error message goes:
can't find variable 'Animation'
.➡️ Gist ⬅️
--
EDIT
I have it working, now it just doesn't seem to do anything really. Doesn't display content or animate, styling..
EDIT
Lottie is now broken on React Native.