Android 音乐指示器
来源:互联网 发布:文本情感分析算法 编辑:程序博客网 时间:2024/06/06 00:26
当播放音频时,你可以显示这个。增加用户体验。一个比较精致的小控件.
使用如下:
- 添加在你的根build.gradle在库底:
dependencies { compile 'com.taishi-y:musicindicator:0.1.0'}
2.在使用的布局里面添加申明
xmlns:app="http://schemas.android.com/apk/res-auto"
3.xml 添加控件如下
<com.taishi.library.Indicator android:id="@+id/indicator" android:layout_width="match_parent" android:layout_height="180dp" android:layout_alignParentTop="true" android:background="#000000" app:bar_num="50" app:bar_color="#1DD069" app:step_num="70" app:duration="20000" />
支持如下的属性:
app:bar_num setBarNum(int) Number of Barsapp:bar_color setBarColor(int) Color of the buttonapp:duration setDuration(int) Duration of a bar animationapp:step_num setStepNum(int) Number of bar animation steps
举例说明
Number One Normal Music Indicator
<com.taishi.library.Indicator android:id="@+id/indicator" android:layout_width="match_parent" android:layout_height="180dp" android:layout_alignParentTop="true" android:background="#000000" app:bar_num="50" app:bar_color="#1DD069" app:step_num="70" app:duration="20000" />
Number Two像谷歌音乐这样
<RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="10dp" android:background="@drawable/circle"> <com.taishi.library.Indicator android:layout_width="50dp" android:layout_height="50dp" android:layout_margin="20dp" app:bar_num="3" app:bar_color="#fff" app:step_num="10" app:duration="3000"/> </RelativeLayout>
这个是drawable 下创建circle文件
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <solid android:color="#48b3ff"/></shape>
Over Time 这次的开源小控件就介绍到这了,我会不定期的写这样的文章.
喜欢的可以订阅我,同时也可以关注微信公众号,哪里每天都会推荐一篇开源项目Git项目地址在里欢迎订阅
阅读全文
0 0
- Android 音乐指示器
- Android指示器。
- android经典源码,仿美团外卖日历签到弹性指示器音乐播放器俄罗斯方块取色器飘落效果悬浮效果源码
- Android标题栏进度指示器
- Android 自定义指示器<NBIndicatorView>
- Android自定义页面指示器
- Android ViewPager指示器 IndicatorBar
- Android自定义ViewPager指示器
- Android ViewPager指示器 IndicatorBar
- Android-自定义ViewPager指示器
- Android万能的指示器
- Android自定义ViewPager指示器
- Android 实现Viewpager指示器
- Android换页指示器TabIndicator
- Android 页面指示器
- android 步骤指示器实现
- android ViewPager 指示器 PageIndicator
- Android TabLayout && 个性指示器
- 减少oracle sql回表次数 提高SQL查询性能
- 单例模式
- VIM 的 commentary 插件
- 南阳理工oj 题目26 孪生素数问题 素数筛选法
- 一张图轻松搞懂javascript event对象的clientX,offsetX,screenX,pageX区别
- Android 音乐指示器
- ssh整合
- MySQL冗余数据的三种方案
- 初识Spark之 Spark API
- Linux命令— tar、gzip (打包拆包、压缩解压、打包压缩、解压拆包)
- 使用 Laravel 数据填充生成 中文 测试数据
- Unity UI组件属性中的矩形变换(Rect Transform)的详解
- 在html页面中判断本地app是否安装并打开
- windows下安装memcached,报错:Failed to ignore SIGHUP RESULT too large