Android音频跳动的View
来源:互联网 发布:知乎远方光电怎么样 编辑:程序博客网 时间:2024/05/18 21:43
AudioColumnView
闲来无事,看到网易云音乐还有很多播放软件播放音乐有个随音乐跳动的柱状view,就简单撸了下
效果图如下:
github地址
github:音频跳动view
使用很简单
- xml
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context="com.fengan.audiocolumnview.MainActivity"> <Button android:id="@+id/btn_start" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="开始"/> <Button android:id="@+id/btn_stop" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="结束"/> <com.fengan.audiocolumnview.AudioColumnView android:id="@+id/acv" android:layout_width="50dp" android:layout_gravity="center_horizontal" android:background="@android:color/background_dark" android:layout_height="50dp"/></LinearLayout>
- java
public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final AudioColumnView audioColumnView = (AudioColumnView) findViewById(R.id.acv); findViewById(R.id.btn_start).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (!audioColumnView.isStart()) { //开始跳动 audioColumnView.start(); } } }); findViewById(R.id.btn_stop).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (audioColumnView.isStart()) { //结束跳动 audioColumnView.stop(); } } }); }}
over 嘻嘻
阅读全文
0 0
- Android音频跳动的View
- 音频跳动的View--FrequencyView
- 群英传笔记:自定义view一个音频跳动图的绘制
- Android 自定义View 跳动的水果和文字
- Android 自定义View 跳动的水果和文字
- CSS3写跳动的音频(柱子)
- Android_自定义View之跳动的loading
- android跳动的小球动画
- Android自定义View之音频条形图
- Android自定义View之音频条形图
- Android播放音乐时跳动的屏谱demo
- 4.4.3 Android animation制作 跳动的心
- Android实现跳动的小球加载动画效果
- 跳动的菜单
- 跳动的下拉菜单
- 跳动的菜单
- 跳动的菜单
- 跳动的球
- 打印十字图
- Drawable与 Bitmap 常用方法
- 箭头函数与function的区别
- Spring MVC配置文件的三个常用配置详解(annotation-config,annotation-config,annotation-driven)
- gSOAP简单多线程服务器程序
- Android音频跳动的View
- Hibernate学习(一)
- CentOS7中firewalld的安装与使用详解
- Python的替换函数——strip(),replace()和re.sub()
- http你不得不知道的那些事(一)--同源策略(2)
- angular路由
- 关于git reset --hard这个命令的惨痛教训
- MPI,openMP与pthread的基本demo
- 获取Class对象的三种方式