Kotlin / Android wrapper for https://github.com/oneteam-dev/oneteam-rte
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
core
core_rx
gradle/wrapper
js
licenses
sample
toolbar
toolbar_rx
.babelrc
.eslintrc
.gitignore
.node-version
LICENSE
README.md
build.gradle
circle.yml
gradle.properties
gradlew
gradlew.bat
package.json
settings.gradle
webpack.config.js
yarn.lock

README.md

oneteam-rte-kt

CircleCI codecov

oneteam-rte-kt is a Kotlin / Android wrapper for oneteam-rte

How to use

There is a sample project.

Add dependencies

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}
dependencies {
    compile 'com.github.oneteam-dev.oneteam-rte-kt:core:x.y.z'

    // If you want to use default toolbar, add this line.
    compile 'com.github.oneteam-dev.oneteam-rte-kt:toolbar:x.y.z'

    // If you are using RxKotlin or RxJava, there are adapters for it.
    compile 'com.github.oneteam-dev.oneteam-rte-kt:core_rx:x.y.z'
    compile 'com.github.oneteam-dev.oneteam-rte-kt:toolbar_rx:x.y.z'
}

Include RichTextEditorView

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main"
    android:layout_width="match_parent" android:layout_height="match_parent" />
    <io.one_team.oneteam_rte_kt.toolbar.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true" />
    <io.one_team.oneteam_rte_kt.core.RichTextEditorView
        android:id="@+id/editor"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/toolbar"/>
</RelativeLayout>

Setup toolbar

if you're using default toolbar

class MainActivity {
    override fun onAttachedToWindow() {
        toolbar.editor = editor
        toolbar.addOnClickImageButtonListener {
            // Prompt which image to use and call RichtextEditorView::insertImage
        }

        toolbar.addOnClickInsertLinkButtonListener {
            // Prompt what link to use and call RichtextEditorView::insertLink
        }
    }
}

or implement toolbar by yourself

please see

Development

To change js directory, run command

brew install yarn && yarn && npm run build

And necessary assets will be generated in core/main/assets directory.

Publish

git tag x.x.x
./gradlew release

And you can see artifact in Jitpack.io