OTMarkdownEditor
Android Markdown 编辑器+解析
Install / Use
/learn @xia-weiyang/OTMarkdownEditorREADME
OTMarkdownEditor
Android Markdown编辑器
For 旧时光
Screenshot
<img src="./img/Screenshot_1513688794.png" width = "200"/> <img src="./img/Screenshot_1513688800.png" width = "200"/> <img src="./img/Screenshot_1513689796.png" width = "200"/>
Setup
To use this library your minSdkVersion should be >= 19
Add it in your root build.gradle at the end of repositories
allprojects {
repositories {
...
maven { url 'https://www.jitpack.io' }
}
}
Add the dependency
dependencies {
compile 'com.github.xia-weiyang:OTMarkdownEditor:1.1.Release'
}
Usage
Markdown 解析
<com.jiushig.markdown.widget.MarkdownView
android:id="@+id/markdownView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
MarkdownView markdownView = (MarkdownView) findViewById(R.id.markdownView);
markdownView.setTextInBackground(markdownString);
链接点击
markdownView.setLinkClickListener(new MarkdownView.LinkClickListener() {
@Override
public void click(String url) {
}
});
图片点击
markdownView.setImgClickListener(new MarkdownView.ImgClickListener() {
@Override
public void click(String[] urls, int index) {
}
});
Markdown 编辑器
继承EditorActivity实现编辑器功能
public class MainActivity extends EditorActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
/**
* 点击了保存
*/
@Override
protected void clickSave(String title, String text) {
super.clickSave(title, text);
}
}
Look at the sample app or markdown for more.
Thanks
- https://github.com/vsch/flexmark-java
- https://github.com/qinci/AndroidEdit
- https://github.com/jasonm23/markdown-css-themes
License
Copyright (C) 2017 xia-weiyang
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Related Skills
node-connect
342.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
85.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
342.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
342.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
