admin管理员组

文章数量:1516870

源码地址:

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

使用 kotlin 代替 Java

主要功能:

1、播放、暂停音乐

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

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

先看效果图:

1、布局文件

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android=""
    xmlns:tools=""
    xmlns:app=""
    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
                android:id="@+id/programPlayDirector"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/programPlayAnchor"
                android:layout_alignLeft="@

本文标签: 实践从理念到编程