2

I am using this library for sliding up panel. I'm trying to use it with the bottom navigation view, for my music streaming app. I am trying to do something like soundcloud app. But I'm unable to achieve this and it shows like this I have two player views, one is mini player and another is the big player. My miniplayer of the slidingup panel goes below of the bottom navigation view. I want it stay on top of the bottom navigation view. When I click on the miniplayer, slide up panel expands, mini player is gone the big player is visible and the bottom navigation is also gone. Sorry for my bad english. Heres my code:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".activity.MainActivity">


    <com.example.user.musicstreamingapp.CustomView.SlidingUpPanel.SlidingUpPanelLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:animateLayoutChanges="true"
        app:umanoPanelHeight="90dp"
        app:umanoShadowHeight="4dp"
        android:id="@+id/sliding_panel_layout"
        android:gravity="bottom"

        >
        <android.support.v4.view.ViewPager
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@+id/view_pager"
            android:visibility="visible"

            />
     <RelativeLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent">


         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:background="@color/bg"
             android:orientation="vertical"
             android:visibility="gone"
             android:id="@+id/music_player"
             >

             <android.support.v7.widget.CardView
                 android:id="@+id/mini_player"
                 android:layout_width="match_parent"
                 android:layout_height="80dp"
                 android:layout_alignParentBottom="true"
                 android:layout_marginLeft="8dp"
                 android:layout_marginRight="8dp"
                 android:visibility="visible"
                 app:cardBackgroundColor="@color/colorBlue"
                 app:cardUseCompatPadding="true">

                 <RelativeLayout
                     android:layout_width="match_parent"
                     android:layout_height="match_parent">

                     <com.example.user.musicstreamingapp.CustomView.CircularMusicProgressBar
                         android:id="@+id/music_round_progress"
                         android:layout_width="40dp"
                         android:layout_height="40dp"
                         android:layout_centerVertical="true"
                         android:layout_marginLeft="16dp"
                         android:src="@drawable/drake"
                         app:centercircle_diammterer="1"
                         app:draw_anticlockwise="false"
                         app:enable_touch="false"
                         app:progress_color="#FAC100"
                         app:progress_startAngle="40" />

                     <TextView
                         android:id="@+id/remain_time"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_marginLeft="12dp"
                         android:layout_marginTop="8dp"
                         android:layout_toRightOf="@id/music_round_progress"
                         android:text="1:22"
                         android:textColor="@color/wh"
                         android:textSize="12sp" />

                     <TextView
                         android:id="@+id/song_name_mini"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_centerVertical="true"
                         android:layout_marginLeft="12dp"
                         android:layout_toRightOf="@id/music_round_progress"
                         android:text="In My Feelings"
                         android:textColor="@color/wh"
                         android:textSize="16sp" />

                     <TextView
                         android:id="@+id/artist_name_mini"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_below="@+id/song_name_mini"
                         android:layout_marginLeft="12dp"
                         android:layout_toRightOf="@id/music_round_progress"
                         android:text="Drake"
                         android:textColor="#FAC100"
                         android:textSize="12sp" />

                     <ImageView
                         android:id="@+id/play_btn_mini"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_alignParentRight="true"
                         android:layout_centerVertical="true"
                         android:layout_marginRight="12dp"
                         android:src="@drawable/ic_play" />
                 </RelativeLayout>
             </android.support.v7.widget.CardView>

             <RelativeLayout
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:id="@+id/big_player"
                 >

                 <android.support.v7.widget.Toolbar
                     android:id="@+id/toolbar_top"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:background="@color/bg"
                     android:minHeight="?attr/actionBarSize"
                     app:theme="@style/CustomActionBar">

                     <RelativeLayout
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content">

                         <ImageView
                             android:id="@+id/arrow_down"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_alignParentLeft="true"
                             android:src="@drawable/ic_arrow_down" />

                         <TextView
                             android:id="@+id/toolbar_title"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_centerHorizontal="true"
                             android:layout_gravity="center"
                             android:fontFamily="sans-serif-medium"
                             android:text="@string/now_playing"
                             android:textColor="@color/grey"
                             android:textSize="18sp" />

                         <ImageView
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_alignParentRight="true"
                             android:layout_centerVertical="true"
                             android:paddingRight="8dp"
                             android:src="@drawable/ic_more" />
                     </RelativeLayout>


                 </android.support.v7.widget.Toolbar>

                 <RelativeLayout
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:layout_below="@id/toolbar_top"
                     android:layout_marginTop="12dp">

                     <com.example.user.musicstreamingapp.library.src.main.java.com.yarolegovich.discretescrollview.DiscreteScrollView
                         android:id="@+id/songs_thumb_rv"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         android:layout_centerHorizontal="true"

                         />

                     <RelativeLayout
                         android:id="@+id/middle_view"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         android:layout_below="@id/songs_thumb_rv"
                         android:layout_marginTop="20dp"
                         android:paddingLeft="16dp"
                         android:paddingRight="16dp">

                         <TextView
                             android:id="@+id/song_name"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"

                             android:layout_centerHorizontal="true"
                             android:text="Get Away"
                             android:textColor="@color/headerTextColor"
                             android:textSize="18sp" />

                         <TextView
                             android:id="@+id/artist_name"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_below="@id/song_name"
                             android:layout_centerHorizontal="true"
                             android:text="Drake"
                             android:textColor="@color/colorBlue"
                             android:textSize="12sp" />

                         <ImageView
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_alignParentLeft="true"
                             android:layout_centerVertical="true"
                             android:src="@drawable/ic_favorite_border"

                             />

                         <ImageView
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_alignParentRight="true"
                             android:layout_centerVertical="true"
                             android:src="@drawable/ic_download_border" />
                     </RelativeLayout>

                     <RelativeLayout
                         android:id="@+id/duration_view"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         android:layout_below="@id/middle_view"
                         android:layout_marginLeft="16dp"
                         android:layout_marginRight="16dp"
                         android:layout_marginTop="12dp">

                         <TextView
                             android:id="@+id/current_time"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_alignParentLeft="true"
                             android:text="2.44"
                             android:textColor="@color/grey"
                             android:textSize="12sp" />

                         <SeekBar
                             android:id="@+id/seek_bar_music"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
                             android:layout_toLeftOf="@id/total_time"
                             android:layout_toRightOf="@id/current_time" />

                         <TextView
                             android:id="@+id/total_time"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_alignParentRight="true"
                             android:text="5.33" />
                     </RelativeLayout>

                     <RelativeLayout
                         android:id="@+id/player_view"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         android:layout_below="@id/duration_view"
                         android:padding="30dp">

                         <ImageView
                             android:id="@+id/shuffle_btn"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_centerVertical="true"
                             android:src="@drawable/ic_shuffle" />

                         <ImageView
                             android:id="@+id/prev_btn"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_centerVertical="true"
                             android:layout_marginLeft="25dp"
                             android:layout_toRightOf="@id/shuffle_btn"
                             android:src="@drawable/ic_prev" />

                         <ImageView
                             android:id="@+id/play_btn_main"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_centerHorizontal="true"
                             android:src="@drawable/ic_play_new" />

                         <ImageView
                             android:id="@+id/next_btn"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_centerVertical="true"
                             android:layout_marginLeft="25dp"
                             android:layout_toLeftOf="@id/repeat_btn"
                             android:layout_toRightOf="@id/play_btn_main"
                             android:src="@drawable/ic_next" />

                         <ImageView
                             android:id="@+id/repeat_btn"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_alignParentRight="true"
                             android:layout_centerVertical="true"
                             android:src="@drawable/ic_repeat_all" />

                     </RelativeLayout>

                     <ImageView
                         android:id="@+id/video_available"
                         android:layout_width="wrap_content"

                         android:layout_height="wrap_content"
                         android:layout_below="@id/player_view"
                         android:layout_centerHorizontal="true"
                         android:src="@drawable/video_not_available" />

                     <LinearLayout
                         android:id="@+id/player_footer_menu"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         android:layout_alignParentBottom="true"
                         android:orientation="horizontal"
                         android:paddingBottom="16dp"

                         >

                         <ImageView
                             android:id="@+id/settings_music"
                             android:layout_width="0dp"
                             android:layout_height="wrap_content"
                             android:layout_weight=".5"
                             android:src="@drawable/ic_settings" />

                         <ImageView
                             android:id="@+id/music_equalizer"
                             android:layout_width="0dp"
                             android:layout_height="wrap_content"
                             android:layout_weight="1"
                             android:src="@drawable/ic_equalizer" />

                         <ImageView
                             android:id="@+id/music_cast"
                             android:layout_width="0dp"
                             android:layout_height="wrap_content"
                             android:layout_weight="1"
                             android:src="@drawable/ic_cast" />

                         <ImageView
                             android:id="@+id/music_add_playlist"
                             android:layout_width="0dp"
                             android:layout_height="wrap_content"
                             android:layout_weight="1"
                             android:src="@drawable/ic_library_add" />

                         <ImageView
                             android:id="@+id/music_queue"
                             android:layout_width="0dp"
                             android:layout_height="wrap_content"
                             android:layout_weight=".5"
                             android:src="@drawable/ic_queue_music" />
                     </LinearLayout>

                 </RelativeLayout>

             </RelativeLayout>
         </LinearLayout>
     </RelativeLayout>
    </com.example.user.musicstreamingapp.CustomView.SlidingUpPanel.SlidingUpPanelLayout>

    <android.support.design.widget.BottomNavigationView
        android:layout_width="match_parent"
        android:layout_height="58dp"
        android:layout_gravity="bottom"
        android:id="@+id/bottom_nav_menu"

        android:background="@android:color/white"
        android:layout_alignParentBottom="true"
        app:itemBackground="@color/wh"
        app:itemIconTint="@color/tab_foreground"
        app:itemTextColor="@color/tab_foreground"
        app:menu="@menu/bottom_nav_menu"/>



</RelativeLayout>`
Community
  • 1
  • 1
  • You can give margin to your mini player same as the bottom navigation height. And as far as the bottom navigation disappearing thing is concerned, when you slide up the panel, does it open a new activity? – Ayush Khare Oct 24 '18 at 07:25
  • No, it's on the same activity. Ok, I'll give margins to the mini player. – Md. Inan Mahmud Oct 24 '18 at 07:57
  • How did you handled the hide and show animation of your bottom navigation bar smoothly when some one is dragging the panel ? Did you face jerks ? How did you handle that? – Rajesh Koshti Jul 01 '23 at 13:40

0 Answers0