{"id":21410203,"url":"https://github.com/moriafly/lyricviewx","last_synced_at":"2026-02-25T05:10:46.202Z","repository":{"id":40244700,"uuid":"333298423","full_name":"Moriafly/LyricViewX","owner":"Moriafly","description":"LyricViewX is a beautiful Lyrics View for Android.","archived":false,"fork":false,"pushed_at":"2023-05-06T07:23:00.000Z","size":336,"stargazers_count":94,"open_issues_count":9,"forks_count":16,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-14T03:01:20.732Z","etag":null,"topics":["android","kotlin","lyrics","view"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Moriafly.png","metadata":{"files":{"readme":"README-zh-CN.md","changelog":"CHANGELOG.md","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":"2021-01-27T04:02:54.000Z","updated_at":"2025-07-13T20:27:10.000Z","dependencies_parsed_at":"2024-11-22T21:32:12.696Z","dependency_job_id":null,"html_url":"https://github.com/Moriafly/LyricViewX","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/Moriafly/LyricViewX","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moriafly%2FLyricViewX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moriafly%2FLyricViewX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moriafly%2FLyricViewX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moriafly%2FLyricViewX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Moriafly","download_url":"https://codeload.github.com/Moriafly/LyricViewX/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moriafly%2FLyricViewX/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29811531,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T03:30:18.102Z","status":"ssl_error","status_checked_at":"2026-02-25T03:30:17.799Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","kotlin","lyrics","view"],"created_at":"2024-11-22T17:38:25.542Z","updated_at":"2026-02-25T05:10:46.187Z","avatar_url":"https://github.com/Moriafly.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LyricViewX\n\n[![](https://www.jitpack.io/v/Moriafly/LyricViewX.svg)](https://www.jitpack.io/#Moriafly/LyricViewX)\n\nLyricViewX 是一个美观的安卓歌词控件。\n\n基于 [LrcView](https://github.com/zion223/NeteaseCloudMusic-MVVM/blob/master/lib_common_ui/src/main/java/com/netease/lib_common_ui/lrc/LrcView.java) 设计。\n\n## 比较与 LrcView\n\n- 100% Kotlin 代码\n- 交互优化，移除过时方法\n- 提供 JitPack 库方便使用\n- 提供新功能\n\n## 如何使用\n\n### 步骤 1. 将 JitPack 存储库添加到构建文件中\n\n将它添加到 build.gradle(root) 中:\n```\nallprojects {\n    repositories {\n        ...\n        maven { url 'https://www.jitpack.io' }\n    }\n}\n```\n### 步骤 2. 添加依赖关系\n```\ndependencies {\n    implementation 'com.github.Moriafly:LyricViewX:#Tag' // $Tag 改成最新版本\n}\n```\n\n## 布局\n```xml\n\u003ccom.dirror.lyricviewx.LyricViewX\n    android:id=\"@+id/lyricViewX\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    app:lrcPadding=\"16dp\"\u003e\n\u003c/com.dirror.lyricviewx.LyricViewX\u003e\n```\n\n## Activity\n```kt\n    binding.lyricViewX.loadLyric()\n```\n\n### 方法\n```kotlin\n/**\n * 设置非当前行歌词字体颜色 [normalColor]\n */\nfun setNormalColor(normalColor: Int)\n\n/**\n * 普通歌词文本字体大小 [size]，单位 px\n */\nfun setNormalTextSize(size: Float)\n\n/**\n * 当前歌词文本字体大小\n */\nfun setCurrentTextSize(size: Float)\n\n/**\n * 设置当前行歌词的字体颜色\n */\nfun setCurrentColor(currentColor: Int)\n\n/**\n * 设置拖动歌词时选中歌词的字体颜色\n */\nfun setTimelineTextColor(timelineTextColor: Int)\n\n/**\n * 设置拖动歌词时时间线的颜色\n */\nfun setTimelineColor(timelineColor: Int)\n\n/**\n * 设置拖动歌词时右侧时间字体颜色\n */\nfun setTimeTextColor(timeTextColor: Int)\n\n/**\n * 设置歌词为空时屏幕中央显示的文字 [label]，如“暂无歌词”\n */\nfun setLabel(label: String)\n\n/**\n * 加载歌词文件\n * 两种语言的歌词时间戳需要一致\n * @param mainLyricFile 第一种语言歌词文件\n * @param secondLyricFile 可选，第二种语言歌词文件\n */\nfun loadLyric(mainLyricFile: File, secondLyricFile: File? = null)\n\n/**\n * 加载歌词文本\n * 两种语言的歌词时间戳需要一致\n * @param mainLyricText 第一种语言歌词文本\n * @param secondLyricText 可选，第二种语言歌词文本\n */\nfun loadLyric(mainLyricText: String?, secondLyricText: String? = null)\n\n/**\n * 加载在线歌词\n * @param lyricUrl  歌词文件的网络地址\n * @param charset 编码格式\n */\nfun loadLyricByUrl(lyricUrl: String, charset: String? = \"utf-8\")\n\n/**\n * 刷新歌词\n * @param time 当前播放时间\n */\nfun updateTime(time: Long)\n\n/**\n * 设置歌词是否允许拖动\n * @param draggable 是否允许拖动\n * @param onPlayClickListener 设置歌词拖动后播放按钮点击监听器，如果允许拖动，则不能为 null\n */\nfun setDraggable(draggable: Boolean, onPlayClickListener: OnPlayClickListener?)\n\n/**\n * 设置单击\n */\nfun setOnSingerClickListener(onSingerClickListener: OnSingleClickListener?)\n\n/**\n * @新增加\n * 获取当前歌词每句实体，可用于歌词分享\n * @return LyricEntry 集合\n */\nfun getLyricEntryList(): List\u003cLyricEntry\u003e\n\n\n/**\n * 播放按钮被点击，应该跳转到指定播放位置\n * @return 是否成功消费该事件，如果成功消费，则会更新UI\n */\nfun onPlayClick(time: Long): Boolean\n\n/**\n * 单击事件\n */\nfun onClick()\n\n```\n\n## License\n\n    LyricViewX  Copyright (C) 2021  Moriafly\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoriafly%2Flyricviewx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoriafly%2Flyricviewx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoriafly%2Flyricviewx/lists"}