MCPcopy Index your code
hub / github.com/asr-pub/LyricViewDemo

github.com/asr-pub/LyricViewDemo @v1.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.2 ↗ · + Follow
195 symbols 428 edges 23 files 29 documented · 15%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

LyricView

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

Screenshot

LyricViewDemo.apk YouTube

Usage

Gradle dependency

step 1 Add the JitPack repository to your build file
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

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

XML code

//step 1
<me.zhengken.lyricview.LyricView
        android:id="@+id/custom_lyric_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

Java code

//step 2
LyricView mLyricView = (LyricView)findViewById(R.id.custom_lyric_view);

//step 3
mLyricView.setLyricFile(lyricFile);

//step 4, update LyricView every interval
mLyricView.setCurrentTimeMillis(progress);

//step 5, implement the interface when user drag lyrics and click the play icon
mLyricView.setOnPlayerClickListener(new LyricView.OnPlayerClickListener() {
        @Override
        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
## Thanks
@码农小阿飞
## License
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

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.

Extension points exported contracts — how you extend this code

BaseView (Interface)
Created by zheng on 2016/10/2. [1 implementers]
app/src/main/java/me/zhengken/zkmusicplayer/BaseView.java
OnPlayerClickListener (Interface)
(no doc) [1 implementers]
lyricview/src/main/java/me/zhengken/lyricview/LyricView.java
BasePresenter (Interface)
Created by zheng on 2016/10/2. [1 implementers]
app/src/main/java/me/zhengken/zkmusicplayer/BasePresenter.java

Core symbols most depended-on inside this repo

getRawSize
called by 15
lyricview/src/main/java/me/zhengken/lyricview/LyricView.java
invalidateView
called by 11
lyricview/src/main/java/me/zhengken/lyricview/LyricView.java
getContext
called by 7
app/src/main/java/me/zhengken/zkmusicplayer/MyApplication.java
reset
called by 5
lyricview/src/main/java/me/zhengken/lyricview/LyricView.java
scrollable
called by 5
lyricview/src/main/java/me/zhengken/lyricview/LyricView.java
setCurrentState
called by 5
app/src/main/java/me/zhengken/zkmusicplayer/MusicPlayService.java
play
called by 5
app/src/main/java/me/zhengken/zkmusicplayer/mainactivity/MainContract.java
measureCurrentScrollY
called by 4
lyricview/src/main/java/me/zhengken/lyricview/LyricView.java

Shape

Method 166
Class 22
Interface 6
Enum 1

Languages

Java100%

Modules by API surface

lyricview/src/main/java/me/zhengken/lyricview/LyricView.java51 symbols
app/src/main/java/me/zhengken/zkmusicplayer/mainactivity/MainFragment.java24 symbols
app/src/main/java/me/zhengken/zkmusicplayer/mainactivity/MainContract.java22 symbols
app/src/main/java/me/zhengken/zkmusicplayer/musicdata/Song.java17 symbols
app/src/main/java/me/zhengken/zkmusicplayer/musicdata/PlayList.java15 symbols
app/src/main/java/me/zhengken/zkmusicplayer/MusicPlayService.java15 symbols
app/src/main/java/me/zhengken/zkmusicplayer/mainactivity/MainPresenter.java14 symbols
app/src/main/java/me/zhengken/zkmusicplayer/util/ImageUtils.java4 symbols
app/src/main/java/me/zhengken/zkmusicplayer/mainactivity/MainActivity.java4 symbols
app/src/main/java/me/zhengken/zkmusicplayer/util/ToastUtils.java3 symbols
app/src/main/java/me/zhengken/zkmusicplayer/MyApplication.java3 symbols
lyricview/src/test/java/me/zhengken/lyricview/ExampleUnitTest.java2 symbols

For agents

$ claude mcp add LyricViewDemo \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page