{"id":21220591,"url":"https://github.com/txca/spannablex","last_synced_at":"2025-10-16T11:21:17.582Z","repository":{"id":39642153,"uuid":"476245550","full_name":"TxcA/SpannableX","owner":"TxcA","description":"🎊 Android Spannable 扩展，简单易用，支持Kotlin\\Java。详细使用文档👇","archived":false,"fork":false,"pushed_at":"2022-06-07T07:46:11.000Z","size":2875,"stargazers_count":109,"open_issues_count":4,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-10T18:02:58.696Z","etag":null,"topics":["android","java","kotlin","span","spannable"],"latest_commit_sha":null,"homepage":"https://txca.github.io/SpannableX/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TxcA.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}},"created_at":"2022-03-31T09:52:50.000Z","updated_at":"2025-06-17T03:06:21.000Z","dependencies_parsed_at":"2022-07-29T02:19:10.173Z","dependency_job_id":null,"html_url":"https://github.com/TxcA/SpannableX","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/TxcA/SpannableX","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TxcA%2FSpannableX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TxcA%2FSpannableX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TxcA%2FSpannableX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TxcA%2FSpannableX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TxcA","download_url":"https://codeload.github.com/TxcA/SpannableX/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TxcA%2FSpannableX/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279183140,"owners_count":26121336,"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","status":"online","status_checked_at":"2025-10-16T02:00:06.019Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","java","kotlin","span","spannable"],"created_at":"2024-11-20T22:13:16.047Z","updated_at":"2025-10-16T11:21:17.562Z","avatar_url":"https://github.com/TxcA.png","language":"Kotlin","readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"./docs/res/logo.png\" width=\"25%\"/\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cb\u003e简单易用的Spannable扩展\u003c/b\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/TxcA/SpannableX/actions\"\u003e\u003cimg src=\"https://github.com/TxcA/SpannableX/workflows/CI/badge.svg?branch=master\u0026event=push\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://search.maven.org/artifact/com.itxca.spannablex/spannablex\"\u003e\u003cimg src=\"https://img.shields.io/maven-central/v/com.itxca.spannablex/spannablex\"/\u003e\u003c/a\u003e\n\u003cimg src=\"https://img.shields.io/badge/language-Kotlin-blue.svg\"/\u003e\n\u003cimg src=\"https://img.shields.io/badge/license-Apache2.0-blue.svg\"/\u003e\n\u003c/p\u003e\n\n\n|                Code Sample                |              Kotlin               | Java                            |\n| :---------------------------------------: | :-------------------------------: | ------------------------------- |\n| ![Gif 1.43MB](./docs/res/sample_code.gif) | ![](./docs/res/sample_kotlin.jpg) | ![](./docs/res/sample_java.jpg) |\n\n✨ 本框架基于 ***[@liangjingkanji/spannable](https://github.com/liangjingkanji/spannable)*** 驱动，此外 **新增以下特性** : \n\n- **封装常用Span**\n\n  [🛠 查看常用Spans文档](https://txca.github.io/SpannableX/spans/)\n\n- **Kotlin DSL**\n\n  ``` kotlin\n  TextView.text = spannable {\n                    \"this is real text.\".text()\n                    \"spannable\".span {\n                        color(Color.BLUE)\n                        style(Typeface.BOLD)\n                    }\n                  }\n  ```\n\n- **Kotlin|Java 链式**\n\n  ``` java\n  TextView.setText(Span.create()\n                    .text(\"this is real text.\")\n                    .text(\"spannable\").color(Color.BLUE).style(Typeface.BOLD)\n                    .spannable());\n  ```\n\n- **更方便的替换规则**\n\n  支持String、正则、[ReplaceRule](https://txca.github.io/SpannableX/replace/#replacerule) 及相应的Array|List 替换规则\n\n***更多详情参考:***\n\n**[ ⭐ 使用文档 ](https://txca.github.io/SpannableX/)**  **[ ⚙ API文档 ](https://txca.github.io/SpannableX/api/)**  **[ 🔨 更新日志](https://txca.github.io/SpannableX/change/)**\n\n---\n\n### 使用\n\n框架存储在`mavenCentral`，大部分情况不需要手动配置，添加远程仓库根据创建项目的 Android Studio 版本有所不同。\n\n``` groovy\n// 项目根目录build.gradle\nallprojects {\n    repositories {\n        mavenCentral()\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\n``` groovy\n// 项目根目录settings.gradle\ndependencyResolutionManagement {\n    repositories {\n        mavenCentral()\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\n然后在 module 的 build.gradle 添加依赖框架\n\n``` groovy\ndependencies {\n    // https://github.com/TxcA/SpannableX\n    implementation 'com.itxca.spannablex:spannablex:1.0.4'\n\n    // 若需使用glide()方法加载网络图片或Gif, 需同时引入Glide\n    implementation 'com.github.bumptech.glide:glide:4.13.1'\n}\n```\n\n### 鸣谢\n\n[@liangjingkanji/spannable](https://github.com/liangjingkanji/spannable)\n\n### License\n\n```\nApache-2.0 Copyright 2022 TxcA\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftxca%2Fspannablex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftxca%2Fspannablex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftxca%2Fspannablex/lists"}