分享一下我老师大神的人工智能教程!零基础,通俗易懂!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&