{"id":13644345,"url":"https://github.com/zzhoujay/RichText","last_synced_at":"2025-04-21T07:31:03.166Z","repository":{"id":35179387,"uuid":"39436964","full_name":"zzhoujay/RichText","owner":"zzhoujay","description":"Android平台下的富文本解析器，支持Html和Markdown","archived":false,"fork":false,"pushed_at":"2024-07-10T02:45:37.000Z","size":2485,"stargazers_count":3919,"open_issues_count":136,"forks_count":559,"subscribers_count":96,"default_branch":"master","last_synced_at":"2024-10-29T14:56:24.582Z","etag":null,"topics":["android","gif","html","html-markdown","markdown","richtext"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zzhoujay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-21T09:36:01.000Z","updated_at":"2024-10-27T16:43:32.000Z","dependencies_parsed_at":"2024-09-20T19:01:52.897Z","dependency_job_id":"b0c40cfc-d407-4742-b0fd-9d9076aa0873","html_url":"https://github.com/zzhoujay/RichText","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzhoujay%2FRichText","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzhoujay%2FRichText/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzhoujay%2FRichText/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzhoujay%2FRichText/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zzhoujay","download_url":"https://codeload.github.com/zzhoujay/RichText/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223853507,"owners_count":17214480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","gif","html","html-markdown","markdown","richtext"],"created_at":"2024-08-02T01:02:01.620Z","updated_at":"2024-11-09T16:32:20.229Z","avatar_url":"https://github.com/zzhoujay.png","language":"Java","readme":"# RichText [ ![Download](https://api.bintray.com/packages/zzhoujay/maven/richtext/images/download.svg) ](https://bintray.com/zzhoujay/maven/richtext/_latestVersion)\n\n### 注意：此项目已不再维护\n\n\u003e Android平台下的富文本解析器\n\n* 流式操作\n* 低侵入性\n* 依赖少，只依赖了`disklrucache`和`support v4`\n* 支持Html和Markdown格式文本\n* 支持图片点击和长按事件\n* 链接点击事件和长按事件\n* 支持设置加载中和加载错误时的图片\n* 支持自定义超链接的点击回调\n* 支持修正图片宽高\n* 支持GIF图片\n* 支持Base64编码、本地图片和Assets目录图片\n* 自持自定义图片加载器、图片加载器\n* 支持内存和磁盘双缓存\n* 已经加入对自定义Html解析器的支持\n\n### 效果\n\n![演示](image/image.jpg \"演示\")\n\n\n### gradle中引用的方法\n\n```\ncompile 'com.zzhoujay.richtext:richtext:latest-version'\n```\n\n### 使用新的Html解析器\n\n只需加入此依赖即可，无须其他操作，新Html解析器对原生Html解析器的功能做了补充\n```\ncompile 'com.zzhoujay:html:latest-version'\n```\n\n新Html解析器增加了对代码块的支持，代码块可以触发点击事件，通过`urlClick`设置，\n代码块回调的参数由`code://`开头\n\n使用新Html解析器遇到问题请在[https://github.com/zzhoujay/Htm](https://github.com/zzhoujay/Html)提issue\n\n### 关于issue\n\n最近一段时间会比较忙，issue不能及时处理，一般会定时抽空集中解决issue，但时间有限解决速度上不敢保证。\n\n欢迎提交pull request帮助完善这个项目\n\n### 注意\n\n在第一次调用RichText之前先调用`RichText.initCacheDir()`方法设置缓存目录\n\nImageFixCallback的回调方法不一定是在主线程回调，注意不要进行UI操作\n\n本地图片由根路径`\\`开头，Assets目录图片由`file:///android_asset/`开头\n\nGif图片播放不支持硬件加速，若要使用Gif图片请先关闭TextView的硬件加速\n```\ntextView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);\n```\n\n### 使用方式\n\n[多看wiki](https://github.com/zzhoujay/RichText/wiki)、[多看wiki](https://github.com/zzhoujay/RichText/wiki)、[多看wiki](https://github.com/zzhoujay/RichText/wiki)，重要的事情说三遍\n\n### 关于自定义的Html解析器\n\nHtml解析器子项目：[Html](https://github.com/zzhoujay/Htm)\n\n### 关于Markdown\n\nMarkdown源于子项目：[Markdown](https://github.com/zzhoujay/Markdown)\n\n若在markdown解析过程中发现什么问题可以在该项目中反馈\n\n### 关于富文本编辑器\n\n编辑器开发已暂停，[RichEditor](https://github.com/zzhoujay/RichEditor)\n\n### 具体使用请查看demo\n\n[ListView Demo](https://github.com/zzhoujay/RichText/blob/master/app/src/main/java/zhou/demo/ListViewActivity.java)、\n[RecyclerView Demo](https://github.com/zzhoujay/RichText/blob/master/app/src/main/java/zhou/demo/RecyclerViewActivity.java)、\n[Gif Demo](https://github.com/zzhoujay/RichText/blob/master/app/src/main/java/zhou/demo/GifActivity.java)\n\n\n### License\n\n```\nThe MIT License (MIT)\n\nCopyright (c) 2016 zzhoujay\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n\n_by zzhoujay_\n","funding_links":[],"categories":["TextView","Java"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzhoujay%2FRichText","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzzhoujay%2FRichText","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzhoujay%2FRichText/lists"}