Android应用--简 美音乐播放器获取专辑图片(自定义列表适配器)

本文介绍了在Android应用中如何为简美音乐播放器开发自定义列表适配器,以获取和显示音乐专辑图片。通过MediaUtil类处理图片,并在ListView中使用自定义的MusicListAdapter展示。文章还展示了部分关键代码,如music_list_item_layout.xml布局文件和MusicListAdapter.java。此外,提到了开发者正在进行的音乐播放器功能增强,包括歌词滚动、来电监听等。
摘要由CSDN通过智能技术生成

分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow

也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!

               

Android应用--简、美音乐播放器获取专辑图片(自定义列表适配器)


2013年7月3日简、美音乐播放器开发

第二阶段已增加功能:

1、歌词滚动显示

2、来电监听

3、音量控制

4、左右滑动切换歌词与专辑界面


今天要介绍的功能是获取音乐专辑封面并显示到界面上,小巫改变了音乐列表的布局,为了显示专辑封面。之前没有意识到SimpleAdapter已经不能满足自己的需求了,后来只能参考了别人的代码,修改了原来代码,最终实现获取专辑图片。题外话,最近都一直复习大学的考试,所以断断续续地实现功能,不过也快要学期末了,也没剩多少时间,科目考试也只剩下一科,所以接下来的一周,可能会加快开发速度。争取在小巫这个学期结束前,提供完整的应用原型。由于还不专业,肯定会有很bug存在,希望想参考本人的开发能见谅。


照惯例,我会先让朋友们先看一下效果图(现在是不是简、美很多大笑):




 







首先介绍布局吧:

列表布局有稍微的改变,也没什么好说的,看代码吧

/SimpleBeautyMusicPlayer/res/layout/music_list_item_layout.xml

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:id="@+id/RelativeLayout1"    android:layout_width="match_parent"    android:layout_height="wrap_content"    android:descendantFocusability="blocksDescendants"    android:orientation="vertical" >    <ImageView        android:id="@+id/albumImage"        android:layout_width="64.0dip"        android:layout_height="64.0dip"        android:layout_alignParentLeft="true"        android:layout_centerInParent="true"        android:src="@drawable/music" />    <TextView        android:id="@+id/music_duration"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:layout_alignParentRight="true"        android:layout_alignParentTop="true"        android:layout_marginRight="5.0dp"        android:textColor="@android:color/white"        android:text="@string/time" />    <TextView        android:id="@+id/music_title"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:layout_alignParentTop="true"        android:layout_marginLeft="5dp"        android:layout_toRightOf&
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值