Android mp3音乐播放器实例-----概述

在这里首先说明,此实例是我从csdn下载的一个例子研究解析并且重写的。

第一 我们先概述的描述的说明下,我们这个MP3播放器的具体表现形式,实现方法等。

我们实现的播放器是用tab页形式体现的,分别是具体的音乐列表tab,艺术家tab,专辑信息tab,最近播放信息tab,还有一个具体的播放的tab界面。

 

如图所示 这是当前显示的四个主tab页面,还有一个具体的音乐播放界面:

 

如上图所示。

这是四个界面的具体显示情况。

此外 一下将贴出对应的每个界面的layout.xml文件

 

主布局文件

main.xml

 

<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical"
        android:padding="5dp" >

        <!-- 注意:这里的id是@android下的id 不是@+id ,并且id必须为这个默认的id-->

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >
        </TabWidget>
        <!-- 注意:这里的id是@android下的id 不是@+id ,并且id必须为这个默认的id-->

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:padding="5dp" >
        </FrameLayout>
    </LinearLayout>

</TabHost>

 

歌曲列表布局

listmusic.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/listbg"
    android:orientation="vertical" >

    <ListView
        android:id="@+id/listAllMusic"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

</LinearLayout>

 

艺术家列表布局

artist.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/listbg1"
    android:orientation="vertical" >

    <ListView
        android:id="@+id/artistListView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </ListView>

</LinearLayout>

 

专辑信息布局

albums.xml

<?xml version="1.0" encoding="utf-8"?

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值