Android 如何在屏幕上实现音乐播放自定义通知栏
我正在使用音乐应用程序,我想在主屏幕上显示xyz音乐正在播放的通知(弹出通知栏,如spotify) 如何在播放列表末尾显示此类弹出通知栏?当播放音乐时,当用户单击该条时,它将重定向到音乐播放屏幕 当没有音乐播放时,该条会自动隐藏,并希望在隐藏期间设置该条的动画,如何在底部的listview上显示该条 请看下面的例子 使用以下功能:Android 如何在屏幕上实现音乐播放自定义通知栏,android,android-layout,android-gui,Android,Android Layout,Android Gui,我正在使用音乐应用程序,我想在主屏幕上显示xyz音乐正在播放的通知(弹出通知栏,如spotify) 如何在播放列表末尾显示此类弹出通知栏?当播放音乐时,当用户单击该条时,它将重定向到音乐播放屏幕 当没有音乐播放时,该条会自动隐藏,并希望在隐藏期间设置该条的动画,如何在底部的listview上显示该条 请看下面的例子 使用以下功能: 使用以下功能: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout
使用以下功能:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/playlist"
android:layout_above="@+id/notification"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<RelativeLayout
android:id="@+id/notification"
android:layout_alignParentBottom="true"
android:layout_height="wrap_content"
android:layout_width="match_parent">
<ImageView
android:id="@+id/imgview_album_art"
android:src="image"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_width="48dp"
android:layout_height="48dp"/>
<LinearLayout
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/btn_play_pause"
android:layout_toRightOf="@+id/imgview_album_art">
<TextView
android:text="Paradise"
android:id="@+id/textview_song_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:text="Coldplay - Mylo Xyloto"
android:id="@+id/textview_artist_album"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<ImageButton
android:id="@+id/btn_play_pause"
android:padding="8dp"
android:background="@android:color/transparent"
android:src="@android:drawable/ic_media_pause"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>
</RelativeLayout>