Parth Kathiriya
Parth Kathiriya

Reputation: 137

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.

enter image description here

Upvotes: 0

Views: 5760

Answers (3)

Vivek Mishra
Vivek Mishra

Reputation: 5705

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>

Upvotes: 0

Vipul Asri
Vipul Asri

Reputation: 9213

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 Sliding Up Panel

Upvotes: 3

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.

Upvotes: 0

Related Questions