NOTE: Development on this project has been stopped. All effort will be put into improving the core React Native library which can be found in the repository https://github.com/ojaynico/ojaynico-kotlin-react-native
Kotlin Wrapper for Native Base
Available components: All native base components are available in this wrapper. Check them out using the URL below:
Use the cli tool below to generate a new Kotlin React Native application.
https://github.com/ojaynico/create-ojaynico-krn
Proceed to the next step after generating the project.
Run the following command in your projects root directory.
npm install native-base --save
In your react native application shared module (a kotlin gradle project), update your gradle file to include the following in the respective blocks.
repositories {
mavenCentral()
}
dependencies {
implementation("com.github.ojaynico:ojaynico-kotlin-native-base:1.0.4")
}
import ojaynico.kotlin.native.base.*
import ojaynico.kotlin.react.native.AppRegistry
import react.RBuilder
import react.RComponent
import react.RProps
import react.RState
class App : RComponent<RProps, RState>() {
override fun RBuilder.render() {
container {
header {
left {
button {
attrs.transparent = true
icon {
name = "menu"
}
}
}
body {
title("Header") {
}
}
right { }
}
content {
text("This is Content Section") {}
}
footer {
footerTab {
button {
attrs.full = true
text("Footer") {
}
}
}
}
}
}
}
fun main() {
AppRegistry.registerComponent("NativeBase") { App::class.js }
}