简体   繁体   中英

Android: How to create music player?

How to set every page in show bottom this type layout? One Page in to manage play and stop song.

在此处输入图片说明

You can implement the Bottom Bar in Activity and should have Fragments for other layout in your activity.

Here is the great tutorial to implement Music Player in Android from scratch : Create a Music Player on Android .

Another cool feature : Android Sliding Up Panel imitates the same feature as Google Play Music with sliding up Current Playing Music.

Android滑动面板

You can change the view by setVisibility(View.GONE/View.VISIBLE/View.INVISIBLE) along with FrameLayout. Another way, learn about the fragments. Hope you'll find this helpful.

You can do it easily like this:

    <?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">
    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="New Button"
        android:id="@+id/button"
        android:layout_alignParentBottom="true" />
    <ListView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/button">
    </ListView>
</RelativeLayout>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM