Code Monkey home page Code Monkey logo

Comments (1)

khushbuvadi avatar khushbuvadi commented on June 26, 2024

try this.

main.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.sothree.slidinguppanel.SlidingUpPanelLayout
        android:id="@+id/sliding_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="bottom"
        app:umanoPanelHeight="@dimen/_43sdp">

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

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

                <LinearLayout
                    android:id="@+id/llTop"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">

                    <RelativeLayout
                        android:id="@+id/rlTop"
                        android:layout_width="match_parent"
                        android:layout_height="?android:attr/actionBarSize"
                        android:background="@android:color/transparent"
                        android:orientation="horizontal">

                        <ImageView
                            android:id="@+id/ivDrawer"
                            android:layout_width="@dimen/_25sdp"
                            android:layout_height="match_parent"
                            android:layout_centerVertical="true"
                            android:layout_marginLeft="@dimen/_10sdp"
                            android:src="@drawable/drawer_t" />

                        <TextView
                            android:id="@+id/tvHeader"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:layout_gravity="center"
                            android:fontFamily="@font/proximanovasoftbold"
                            android:gravity="center"
                            android:text="@string/app_name"
                            android:textColor="@color/black"
                            android:textSize="@dimen/_14sdp" />

                        <ImageView
                            android:id="@+id/search"
                            android:layout_width="@dimen/_25sdp"
                            android:layout_height="match_parent"
                            android:layout_alignParentRight="true"
                            android:layout_centerVertical="true"
                            android:layout_marginRight="@dimen/_10sdp"
                            android:src="@drawable/nav_search" />
                    </RelativeLayout>

                    <RelativeLayout
                        android:id="@+id/rlSearch"
                        android:layout_width="match_parent"
                        android:layout_height="?android:attr/actionBarSize"
                        android:layout_marginTop="@dimen/_2sdp"
                        android:visibility="gone">

                        <ImageView
                            android:id="@+id/ivBack"
                            android:layout_width="@dimen/_17sdp"
                            android:layout_height="match_parent"
                            android:layout_centerVertical="true"
                            android:layout_marginLeft="@dimen/_5sdp"
                            android:rotation="90"
                            android:src="@drawable/down" />

                        <EditText
                            android:id="@+id/txtSearch"
                            android:layout_width="match_parent"
                            android:layout_height="@dimen/_35sdp"
                            android:layout_centerInParent="true"
                            android:layout_gravity="center"
                            android:layout_marginLeft="@dimen/_5sdp"
                            android:layout_marginRight="@dimen/_5sdp"
                            android:layout_toLeftOf="@+id/ivCancel"
                            android:layout_toRightOf="@+id/ivBack"
                            android:background="@drawable/editext_bg"
                            android:fontFamily="@font/proximanovasoftbold"
                            android:gravity="center|left"
                            android:hint="@string/search"
                            android:paddingLeft="@dimen/_10sdp"
                            android:singleLine="true"
                            android:textColor="@color/black"
                            android:textCursorDrawable="@drawable/color_cursor"
                            android:textSize="@dimen/_14sdp" />

                        <ImageView
                            android:id="@+id/ivCancel"
                            android:layout_width="@dimen/_13sdp"
                            android:layout_height="match_parent"
                            android:layout_alignParentRight="true"
                            android:layout_centerVertical="true"
                            android:layout_marginRight="@dimen/_8sdp"
                            android:src="@drawable/cancel"
                            android:visibility="gone" />
                    </RelativeLayout>
                </LinearLayout>

                <com.google.android.material.tabs.TabLayout
                    android:id="@+id/tablayout"
                    android:layout_width="match_parent"
                    android:layout_height="58dp"
                    android:layout_below="@+id/llTop"
                    android:layout_marginLeft="5dp"
                    android:layout_marginRight="5dp"
                    android:background="@android:color/transparent"
                    app:tabBackground="@drawable/tab_selector"
                    app:tabGravity="fill"
                    app:tabIndicatorHeight="0dp"
                    app:tabMode="scrollable"
                    app:tabPaddingEnd="@dimen/_25sdp"
                    app:tabPaddingStart="@dimen/_25sdp"
                    app:tabRippleColor="@null"
                    app:tabTextAppearance="@style/TabLayoutStyle"
                    app:tabTextColor="@color/tab_color_selector" />

                <LinearLayout
                    android:id="@+id/llContent"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_below="@+id/tablayout"
                    android:orientation="vertical"
                    app:layout_behavior="@string/appbar_scrolling_view_behavior">

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

                        <androidx.viewpager2.widget.ViewPager2
                            android:id="@+id/viewpager"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent" />
                    </FrameLayout>
                </LinearLayout>
            </RelativeLayout>
        </FrameLayout>

        <include layout="@layout/sliding_window_layout" />
    </com.sothree.slidinguppanel.SlidingUpPanelLayout>

    <ListView
        android:id="@+id/left_drawer"
        android:layout_width="@dimen/_210sdp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="@drawable/main_bg"
        android:choiceMode="singleChoice"
        android:clickable="true"
        android:divider="@color/divider_color1"
        android:dividerHeight="1dp"
        android:focusable="true"
        android:paddingTop="@dimen/_15sdp" />
</androidx.drawerlayout.widget.DrawerLayout>


sliding_window_layout.xml

<LinearLayout
    android:id="@+id/image_above"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <RelativeLayout
        android:id="@+id/upperLayout"
        android:layout_width="match_parent"
        android:layout_height="?android:actionBarSize"
        android:background="@android:color/transparent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="horizontal">

                <ImageView
                    android:id="@+id/below_arrow"
                    android:layout_width="@dimen/_17sdp"
                    android:layout_height="@dimen/_20sdp"
                    android:layout_gravity="center"
                    android:layout_marginStart="@dimen/_10sdp"
                    android:src="@drawable/bottom_arrow" />

                <LinearLayout
                    android:id="@+id/text_layout"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_alignTop="@+id/manulayout"
                    android:layout_alignBottom="@+id/manulayout"
                    android:layout_centerInParent="true"
                    android:layout_toLeftOf="@+id/manulayout"
                    android:layout_toRightOf="@+id/back_layout"
                    android:layout_weight="1"
                    android:gravity="center"
                    android:orientation="vertical"
                    android:paddingLeft="10dp">

                    <com.musicplayer.song.coolmusicplayer.object.CustomTextView
                        android:id="@+id/textNowPlaying"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:ellipsize="marquee"
                        android:singleLine="true"
                        android:text="fdsfsd"
                        android:textColor="@color/black"
                        android:textSize="16dp"
                        app:fontName="Brandon_reg.otf" />

                    <com.musicplayer.song.coolmusicplayer.object.CustomTextView
                        android:id="@+id/textArtist"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:ellipsize="marquee"
                        android:gravity="start|center_horizontal"
                        android:singleLine="true"
                        android:text="fdsfsd"
                        android:textColor="@color/black"
                        android:textSize="12dp"
                        app:fontName="Brandon_light.otf" />

                    <TextView
                        android:id="@+id/tvAlbumName"
                        android:layout_width="@dimen/_200sdp"
                        android:layout_height="match_parent"
                        android:layout_gravity="center"
                        android:ellipsize="end"
                        android:fontFamily="@font/proximanovasoftbold"
                        android:gravity="center"
                        android:singleLine="true"
                        android:textColor="@color/black"
                        android:textSize="@dimen/_14sdp"
                        android:visibility="gone" />
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/manulayout"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentRight="true"
                    android:layout_centerVertical="true"
                    android:layout_gravity="center_vertical"
                    android:gravity="end|center_vertical"
                    android:orientation="horizontal">

                    <RelativeLayout
                        android:id="@+id/btn_layout"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:visibility="visible">

                        <ImageButton
                            android:id="@+id/btn_Play"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_margin="5dp"
                            android:background="@color/trans"
                            android:src="@drawable/play_white" />

                        <ImageButton
                            android:id="@+id/btn_Pause"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_margin="5dp"
                            android:background="@color/trans"
                            android:src="@drawable/pause_white"
                            android:visibility="gone" />
                    </RelativeLayout>

                    <ImageView
                        android:id="@+id/btnmenu"
                        android:layout_width="@dimen/_25sdp"
                        android:layout_height="@dimen/_15sdp"
                        android:layout_gravity="center_vertical"
                        android:layout_marginEnd="@dimen/_10sdp"
                        android:src="@drawable/menu" />
                </LinearLayout>
            </LinearLayout>
        </LinearLayout>
    </RelativeLayout>

    <LinearLayout
        android:id="@+id/centerLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/upperLayout"
        android:layout_weight="1"
        android:orientation="vertical"
        android:weightSum="2">

        <com.google.android.material.card.MaterialCardView
            android:id="@+id/cardView"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_centerHorizontal="true"
            android:layout_gravity="center"
            android:layout_marginStart="@dimen/_30sdp"
            android:layout_marginEnd="@dimen/_30sdp"
            android:layout_weight="1.3"
            android:background="@android:color/white"
            app:cardBackgroundColor="@android:color/white"
            app:cardCornerRadius="@dimen/_15sdp"
            app:cardPreventCornerOverlap="false"
            app:cardUseCompatPadding="false">

            <ImageView
                android:id="@+id/album_image"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:scaleType="centerCrop"
                android:src="@drawable/default_albumart" />

            <RelativeLayout
                android:id="@+id/llVE"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|bottom"
                android:layout_marginLeft="@dimen/_10sdp"
                android:layout_marginRight="@dimen/_10sdp"
                android:layout_marginBottom="@dimen/_10sdp"
                android:gravity="center_vertical|bottom"
                android:orientation="horizontal">

                <ImageView
                    android:id="@+id/img_equalizer"
                    android:layout_width="@dimen/_30sdp"
                    android:layout_height="@dimen/_30sdp"
                    android:layout_alignParentLeft="true"
                    android:layout_weight="1"
                    android:src="@drawable/eq" />

                <ImageView
                    android:id="@+id/img_visualizer"
                    android:layout_width="@dimen/_30sdp"
                    android:layout_height="@dimen/_30sdp"
                    android:layout_alignParentRight="true"
                    android:layout_weight="1"
                    android:src="@drawable/vs" />
            </RelativeLayout>
        </com.google.android.material.card.MaterialCardView>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="0.7"
            android:orientation="vertical">

            <TextView
                android:id="@+id/tvSongName"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/cardView"
                android:layout_gravity="center"
                android:layout_marginStart="@dimen/_30sdp"
                android:layout_marginTop="@dimen/_20sdp"
                android:layout_marginEnd="@dimen/_30sdp"
                android:layout_marginBottom="@dimen/_10sdp"
                android:ellipsize="end"
                android:fontFamily="@font/proximanovasoftbold"
                android:gravity="center"
                android:singleLine="true"
                android:textColor="@color/black"
                android:textSize="@dimen/_17sdp" />

            <TextView
                android:id="@+id/tvArtistName"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/tvSongName"
                android:layout_gravity="center"
                android:layout_marginStart="@dimen/_30sdp"
                android:layout_marginEnd="@dimen/_30sdp"
                android:layout_marginBottom="@dimen/_10sdp"
                android:ellipsize="end"
                android:fontFamily="@font/proximanovasoftregular"
                android:gravity="center"
                android:singleLine="true"
                android:textColor="@color/black"
                android:textSize="@dimen/_14sdp" />

            <SeekBar
                android:id="@+id/seekbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/tvArtistName"
                android:layout_gravity="bottom"
                android:layout_marginLeft="@dimen/_20sdp"
                android:layout_marginTop="@dimen/_10sdp"
                android:layout_marginRight="@dimen/_20sdp"
                android:layout_marginBottom="@dimen/_10sdp"
                android:background="@null"
                android:maxHeight="10dp"
                android:minHeight="10dp"
                android:paddingStart="0dp"
                android:paddingEnd="0dp"
                android:progressDrawable="@drawable/seekbarcolor"
                android:thumb="@null"
                android:thumbOffset="10dp" />
            <!--<SeekBar
                android:id="@+id/seekbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:background="@android:color/transparent"
                android:layout_below="@+id/tvArtistName"
                android:layout_marginHorizontal="@dimen/_20sdp"
                android:layout_marginVertical="@dimen/_10sdp"
                android:maxHeight="@dimen/_4sdp"
                android:progress="0"
                android:progressDrawable="@drawable/seekbar_progress"
                android:thumb="@drawable/seekbar_thumb"/>-->
            <LinearLayout
                android:id="@+id/llDur"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/seekbar"
                android:layout_gravity="bottom|center"
                android:layout_marginLeft="@dimen/_20sdp"
                android:layout_marginRight="@dimen/_20sdp"
                android:layout_marginBottom="@dimen/_10sdp"
                android:orientation="horizontal">

                <com.musicplayer.song.coolmusicplayer.object.CustomTextView
                    android:id="@+id/textBufferDuration"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="00:00"
                    android:textColor="@color/black"
                    android:textSize="@dimen/_13sdp"
                    app:fontName="Brandon_reg.otf" />

                <com.musicplayer.song.coolmusicplayer.object.CustomTextView
                    android:id="@+id/textDuration"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="right"
                    android:text="00:00"
                    android:textColor="@color/black"
                    android:textSize="@dimen/_13sdp"
                    app:fontName="Brandon_reg.otf" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/llDur"
                android:layout_gravity="center"
                android:layout_marginStart="@dimen/_30sdp"
                android:layout_marginEnd="@dimen/_30sdp"
                android:gravity="center"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/seekbar"
                    android:fontFamily="@font/proximanovasoftregular"
                    android:gravity="center|right"
                    android:text="@string/next"
                    android:textColor="@color/black"
                    android:textSize="@dimen/_13sdp" />

                <TextView
                    android:id="@+id/tvNextSongName"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/seekbar"
                    android:ellipsize="end"
                    android:fontFamily="@font/proximanovasoftbold"
                    android:gravity="center|left"
                    android:singleLine="true"
                    android:textColor="@color/black"
                    android:textSize="@dimen/_14sdp" />
            </LinearLayout>
        </LinearLayout>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/play_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="@dimen/_20sdp"
        android:gravity="bottom"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/_10sdp"
            android:orientation="horizontal">

            <ImageView
                android:id="@+id/ivShuffle"
                android:layout_width="@dimen/_15sdp"
                android:layout_height="@dimen/_15sdp"
                android:layout_gravity="center|left"
                android:layout_weight="1"
                android:src="@drawable/shuffle" />

            <ImageView
                android:id="@+id/ivPre"
                android:layout_width="@dimen/_15sdp"
                android:layout_height="@dimen/_15sdp"
                android:layout_gravity="center|left"
                android:layout_toRightOf="@+id/ivShuffle"
                android:layout_weight="1"
                android:src="@drawable/pre" />

            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:orientation="vertical">

                <LinearLayout
                    android:layout_width="@dimen/_50sdp"
                    android:layout_height="@dimen/_50sdp"
                    android:layout_gravity="center"
                    android:background="@drawable/bg_round_white"
                    android:gravity="center">

                    <ImageView
                        android:id="@+id/ivPause"
                        android:layout_width="@dimen/_25sdp"
                        android:layout_height="@dimen/_25sdp"
                        android:layout_gravity="center"
                        android:src="@drawable/pause"
                        android:tint="@color/green"
                        android:visibility="gone" />

                    <ImageView
                        android:id="@+id/ivPlay"
                        android:layout_width="@dimen/_20sdp"
                        android:layout_height="@dimen/_20sdp"
                        android:layout_gravity="center"
                        android:src="@drawable/play" />
                </LinearLayout>
            </LinearLayout>

            <ImageView
                android:id="@+id/ivNext"
                android:layout_width="@dimen/_15sdp"
                android:layout_height="@dimen/_15sdp"
                android:layout_gravity="center|right"
                android:layout_toLeftOf="@+id/ivRepeat"
                android:layout_weight="1"
                android:src="@drawable/next" />

            <ImageView
                android:id="@+id/ivRepeat"
                android:layout_width="@dimen/_15sdp"
                android:layout_height="@dimen/_15sdp"
                android:layout_alignParentRight="true"
                android:layout_gravity="center|right"
                android:layout_weight="1"
                android:src="@drawable/repeat" />
        </LinearLayout>
    </LinearLayout>
</LinearLayout>

from androidslidinguppanel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.