GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - bifan-wei/LrcView: 歌词控件、歌词播放、歌词显示。漂亮好用的android歌词控件,仿网易云音乐自动滑动切换,手势切换歌词时显示时间与歌词时间线

BranchesTags
Open more actions menu

Latest commit

 

History

23 Commits
23 Commits

Folders and files

NameName
Last commit message
Last commit date
LrcView
LrcView
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
lrcView.gif
lrcView.gif
 
 
lrcviewPic.png
lrcviewPic.png
 
 

Repository files navigation

LrcView



这是使用非常简单而且效果还不错的Android歌词控件,只需要传递歌词文件,即可实现类似网易云音乐的歌词效果,拓展性强,可以根据需求自定义显示设置。

支持效果有:

1.柔和的滑动到指定时间歌词。
2.手势拖动歌词控件,释放手势跳转歌词。
3.提供自定义歌词大小字体颜色等,方便自定义界面。
4.对于超长歌词换行显示。
5.支持滑动条颜色大小以及是否显示等设置
6.可以添加自定义解析器满足特定需求



imag

imag



使用方法:

依赖

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}



dependencies {
	        compile 'com.github.bifan-wei:LrcView:V1.3'
	}

代码使用

xml:

 <com.hw.lrcviewlib.LrcView
  android:id="@+id/au_lrcView"
  android:layout_width="match_parent"
  android:layout_height="match_parent" />


设置数据:

 
        List<LrcRow> lrcRows = new LrcDataBuilder().BuiltFromAssets(this, "test2.lrc");
         //ro  List<LrcRow> lrcRows = new LrcDataBuilder().Build(file);
        //mLrcView.setTextSizeAutomaticMode(true);//是否自动适配文字大小
	
        //init the lrcView
        mLrcView.getLrcSetting()
                .setTimeTextSize(40)//时间字体大小
                .setSelectLineColor(Color.parseColor("#ffffff"))//选中线颜色
                .setSelectLineTextSize(25)//选中线大小
                .setHeightRowColor(Color.parseColor("#aaffffff"))//高亮字体颜色
                .setNormalRowTextSize(DisPlayUtil.sp2px(this, 17))//正常行字体大小
                .setHeightLightRowTextSize(DisPlayUtil.sp2px(this, 17))//高亮行字体大小
                .setTrySelectRowTextSize(DisPlayUtil.sp2px(this, 17))//尝试选中行字体大小
                .setTimeTextColor(Color.parseColor("#ffffff"))//时间字体颜色
                .setTrySelectRowColor(Color.parseColor("#55ffffff"));//尝试选中字体颜色
		
        mLrcView.commitLrcSettings();
        mLrcView.setLrcData(lrcRows);


歌词拖动监听:

        mLrcView.setLrcViewSeekListener(new ILrcViewSeekListener() {
            @Override
            public void onSeek(LrcRow currentLrcRow, long CurrentSelectedRowTime) {
                //在这里执行播放器控制器控制播放器跳转到指定时间
                mController.seekTo((int) CurrentSelectedRowTime);
            }
        });


歌词跳柔和滑动转到指定时间:

//播放器播放时,时间更新后调用这个时歌词数据更新到当前对应的歌词,播放器一般时间更新以秒为频率更新
mLrcView.smoothScrollToTime(time)//传递的数据是播放器的时间格式转化为long数据

About

歌词控件、歌词播放、歌词显示。漂亮好用的android歌词控件,仿网易云音乐自动滑动切换,手势切换歌词时显示时间与歌词时间线

Resources

Readme
Activity

Stars

130 stars

Watchers

4 watching

Forks

29 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.