Skip to content
LyricView is a powerful and flexible custom view to display lyrics within music player under Android
Branch: master
Clone or download
Latest commit f3dda2c Jun 13, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
app Initial commit Dec 26, 2016
gradle/wrapper Initial commit Dec 26, 2016
lyricview reset mCurrentLyricFilePath when lyric file is null or not exist Jun 13, 2017
sample modify Dec 26, 2016
screenshot modify Dec 26, 2016
.gitignore Initial commit Dec 26, 2016 update readme Jun 13, 2017
build.gradle Initial commit Dec 26, 2016
gradlew Initial commit Dec 26, 2016
gradlew.bat Initial commit Dec 26, 2016
settings.gradle Initial commit Dec 26, 2016


LyricView is a powerful and flexible custom view to display lyrics within music player under Android


LyricViewDemo.apk YouTube


Gradle dependency

step 1 Add the JitPack repository to your build file
allprojects {
	repositories {
		maven { url '' }

step 2 Add the dependency
dependencies {
        compile 'com.github.zhengken:LyricViewDemo:v1.2'

XML code

//step 1
        android:layout_height="match_parent" />

Java code

//step 2
LyricView mLyricView = (LyricView)findViewById(;

//step 3

//step 4, update LyricView every interval

//step 5, implement the interface when user drag lyrics and click the play icon
mLyricView.setOnPlayerClickListener(new LyricView.OnPlayerClickListener() {
        public void onPlayerClicked(long progress, String content) {

XML attributes

Attributes Format Default Description
fadeInFadeOut boolean false Enable lyrics fadeInFadeOut or not
hint string No Lyrics Display when not exist lyric file
hintColor color #FFFFFF The color of hint text
textSize dimension 16sp The text size of lyrics
textColor color #8D8D8D The color of lyrics
highlightColor color #FFFFFF The color of current lyric that playing
textAlign enum CENTER The alignment of lyrics
maxLength dimension 300dp Line feed when lyric'width beyond maxLength
lineSpace dimension 25dp Line space

Java API

Methods Description
setOnPlayerClickListener(OnPlayerClickListener listener) Callback when click the play icon
setAlignment(@Alignment int alignment) Set the alignment of the lyrics
setCurrentTimeMillis(long current) Scroll lyrics to the specify TimeMillis
setLyricFile(File file) Set the lyric file, and auto set the charset by juniversalchardet-1.0.3
setLyricFile(File file, String charset) Set the lyric file with the specified charset
setTypeface(Typeface typeface) Set the typeface of lyrics
reset() Reset the LyricView




Copyright 2016 zhengken

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.
You can’t perform that action at this time.