Added progress bar to the mini player.
This commit is contained in:
parent
4d84e4d600
commit
51f2a3bd3b
18 changed files with 1260 additions and 1039 deletions
293
app/src/main/res/layout/fragment_player.xml
Normal file
293
app/src/main/res/layout/fragment_player.xml
Normal file
|
|
@ -0,0 +1,293 @@
|
|||
<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:clickable="true"
|
||||
android:focusable="false">
|
||||
|
||||
<!-- BOTTOM-->
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/player_footer_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="?android:colorBackground"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/player_alternative_progress_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/progress_container_height"
|
||||
android:background="?music_controller_container_color"
|
||||
android:elevation="@dimen/toolbar_elevation"
|
||||
android:visibility="gone"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/player_alternative_song_current_progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:gravity="center_vertical|left|end"
|
||||
android:paddingLeft="8dp"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="RtlHardcoded,RtlSymmetry,SmallSp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/player_alternative_song_total_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentRight="true"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:gravity="center_vertical|right|end"
|
||||
android:paddingRight="8dp"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="RtlHardcoded,RtlSymmetry,SmallSp" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/player_alternative_progress_slider"
|
||||
style="@style/MusicProgressSlider"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_toLeftOf="@id/player_alternative_song_total_time"
|
||||
android:layout_toRightOf="@id/player_alternative_song_current_progress"
|
||||
tools:ignore="RtlHardcoded,UnusedAttribute" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/player_footer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?default_bar_color"
|
||||
android:elevation="@dimen/toolbar_elevation"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="@dimen/title_box_padding_large"
|
||||
android:paddingLeft="72dp"
|
||||
android:paddingRight="72dp"
|
||||
android:paddingTop="@dimen/title_box_padding_large"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/player_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/player_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/player_media_controller_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/media_controller_container_height"
|
||||
tools:ignore="ContentDescription,UnusedAttribute">
|
||||
|
||||
<View
|
||||
android:id="@+id/player_media_controller_container_background"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?music_controller_container_color" />
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:id="@+id/player_playback_controller_card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="16dp"
|
||||
android:visibility="gone"
|
||||
app:cardBackgroundColor="?music_controller_container_color"
|
||||
app:elevation="@dimen/card_elevation" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/player_prev_button"
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="72dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="@dimen/tmp_now_playing_skip_rewind_margin"
|
||||
android:layout_marginRight="@dimen/tmp_now_playing_skip_rewind_margin"
|
||||
android:layout_toLeftOf="@+id/dummy_fab"
|
||||
android:layout_toStartOf="@+id/dummy_fab"
|
||||
android:background="?round_selector"
|
||||
android:elevation="8dp"
|
||||
android:padding="22dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_skip_previous_white_36dp" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/player_next_button"
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="72dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="@dimen/tmp_now_playing_skip_rewind_margin"
|
||||
android:layout_marginStart="@dimen/tmp_now_playing_skip_rewind_margin"
|
||||
android:layout_toEndOf="@+id/dummy_fab"
|
||||
android:layout_toRightOf="@+id/dummy_fab"
|
||||
android:background="?round_selector"
|
||||
android:elevation="8dp"
|
||||
android:padding="22dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_skip_next_white_36dp" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/player_repeat_button"
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="72dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="24dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:background="?round_selector"
|
||||
android:elevation="8dp"
|
||||
android:padding="22dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_repeat_white_36dp" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/player_shuffle_button"
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="72dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginRight="24dp"
|
||||
android:background="?round_selector"
|
||||
android:elevation="8dp"
|
||||
android:padding="22dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_shuffle_white_36dp" />
|
||||
|
||||
<View
|
||||
android:id="@+id/dummy_fab"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:visibility="invisible" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/player_play_pause_fab"
|
||||
style="@style/PlayPauseFab"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- ALBUMART-->
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/player_album_art_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@id/player_footer_frame"
|
||||
android:background="@android:color/black">
|
||||
|
||||
<com.kabouzeid.gramophone.views.SquareIfPlaceImageView
|
||||
android:id="@+id/player_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/default_album_art"
|
||||
tools:ignore="ContentDescription,UnusedAttribute" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/player_favorite_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_favorite_red_a400_96dp"
|
||||
android:visibility="invisible"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/player_default_progress_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@drawable/shadow_up">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/player_default_song_current_progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:gravity="center_vertical|left|end"
|
||||
android:padding="16dp"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp"
|
||||
tools:ignore="RtlHardcoded,RtlSymmetry,SmallSp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/player_default_song_total_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:gravity="center_vertical|right|end"
|
||||
android:padding="16dp"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp"
|
||||
tools:ignore="RelativeOverlap,RtlHardcoded,RtlSymmetry,SmallSp" />
|
||||
|
||||
</RelativeLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<!-- PROGRESS SLIDER-->
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/player_default_progress_slider"
|
||||
style="@style/TraditionalMusicProgressSlider"
|
||||
android:layout_above="@id/player_footer_frame"
|
||||
android:elevation="2dp"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
|
||||
<!-- TOOLBAR-->
|
||||
|
||||
<include layout="@layout/shadow_statusbar_actionbar" />
|
||||
|
||||
<View
|
||||
android:id="@+id/player_status_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/status_bar_padding"
|
||||
android:background="@android:color/transparent"
|
||||
android:elevation="@dimen/toolbar_elevation"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/player_toolbar"
|
||||
style="@style/Toolbar"
|
||||
android:layout_below="@id/player_status_bar"
|
||||
android:background="#00000000"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
|
||||
</RelativeLayout>
|
||||
Loading…
Add table
Add a link
Reference in a new issue