仿QQ音乐播放界面(已实现主要功能)

 

源码地址:https://github.com/yeaper/MusicPlayer

因项目需要,实现的功能类似QQ音乐播放界面

 

使用 kotlin 代替 Java

 

主要功能:

1、播放、暂停音乐

2、自动、手动设置进度条,并且同步播放音乐

3、开启、暂停、停止匀速旋转的动画

 

先看效果图:

     

 

1、布局文件

 

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white"
    tools:context="cc.redhome.hduin.view.discover.hduradio.programalbum.ProgramPlayActivity">
    
    <ImageView
        android:id="@+id/programPlayHeaderBg"
        android:layout_width="match_parent"
        android:layout_height="240dp"
        android:background="@drawable/hdu_radio_header_bg"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
        <TextView
            android:id="@+id/programPlayLyric"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:gravity="center_horizontal"
            android:layout_marginTop="80dp"
            android:layout_marginLeft="25dp"
            android:layout_marginRight="25dp"
            android:lineSpacingMultiplier="1.5"
            android:textColor="@color/white"
            android:textSize="17sp"/>
        <FrameLayout
            android:layout_width="140dp"
            android:layout_height="140dp"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="30dp">
            <com.pkmmte.view.CircularImageView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="center"
                android:src="@drawable/developer_fat"
                app:shadow="true"
                app:border="true"
                app:border_width="9dp"
                app:border_color="@color/record_border_bg_color" />
            <com.pkmmte.view.CircularImageView
                android:id="@+id/programPlayRecordImage"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="center"
                android:layout_margin="6dp"/>
        </FrameLayout>

        <TextView
            android:id="@+id/programPlayName"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="20dp"
            android:textColor="@color/primaryTextDark"
            android:textSize="17sp"/>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <TextView
                android:id="@+id/programPlayAnchor"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_marginTop="10dp"
                android:textColor="@color/primaryTextDark"
                android:textSize="16sp"/>
            <TextView
          
  • 0
    点赞
  • 48
    收藏
    觉得还不错? 一键收藏
  • 25
    评论
评论 25
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值