Added a new now playing screen.

This commit is contained in:
Karim Abou Zeid 2016-04-09 19:03:43 +02:00
commit e4848e1dab
21 changed files with 1171 additions and 37 deletions

View file

@ -4,5 +4,6 @@
<gradient
android:angle="90"
android:endColor="#34000000"
android:centerColor="#11000000"
android:startColor="#00000000" />
</shape>

View file

@ -4,5 +4,6 @@
<gradient
android:angle="90"
android:endColor="#88000000"
android:centerColor="#30000000"
android:startColor="#00000000" />
</shape>

View file

@ -4,5 +4,6 @@
<gradient
android:angle="270"
android:endColor="#34000000"
android:centerColor="#11000000"
android:startColor="#00000000" />
</shape>

View file

@ -4,5 +4,6 @@
<gradient
android:angle="270"
android:endColor="#88000000"
android:centerColor="#30000000"
android:startColor="#00000000" />
</shape>

View file

@ -65,7 +65,7 @@
<fragment
android:id="@+id/playback_controls_fragment"
class="com.kabouzeid.gramophone.ui.fragments.player.PlaybackControlsFragment"
class="com.kabouzeid.gramophone.ui.fragments.player.card.CardPlayerPlaybackControlsFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

View file

@ -55,7 +55,7 @@
</LinearLayout>
<include layout="@layout/shadow_statusbar_actionbar" />
<include layout="@layout/shadow_statusbar_toolbar" />
<LinearLayout
android:layout_width="match_parent"

View file

@ -54,7 +54,7 @@
</LinearLayout>
<include layout="@layout/shadow_statusbar_actionbar" />
<include layout="@layout/shadow_statusbar_toolbar" />
<LinearLayout
android:layout_width="match_parent"

View file

@ -51,14 +51,14 @@
<fragment
android:id="@+id/playback_controls_fragment"
class="com.kabouzeid.gramophone.ui.fragments.player.PlaybackControlsFragment"
class="com.kabouzeid.gramophone.ui.fragments.player.card.CardPlayerPlaybackControlsFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/album_cover_container" />
</RelativeLayout>
<include layout="@layout/shadow_statusbar_actionbar" />
<include layout="@layout/shadow_statusbar_toolbar" />
<android.support.v7.widget.Toolbar
android:id="@+id/player_toolbar"

View file

@ -53,7 +53,7 @@
<RelativeLayout
android:id="@+id/player_media_controller_container"
android:layout_width="match_parent"
android:layout_height="@dimen/media_controller_container_height"
android:layout_height="@dimen/fab_media_controller_container_height"
tools:ignore="ContentDescription,UnusedAttribute">
<ImageButton

View file

@ -0,0 +1,122 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<View
android:id="@+id/player_status_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/status_bar_padding" />
<com.sothree.slidinguppanel.SlidingUpPanelLayout android:id="@+id/player_sliding_layout"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="false"
android:focusable="true"
android:gravity="bottom"
sothree:umanoPanelHeight="0dp"
sothree:umanoScrollableView="@+id/player_recycler_view"
sothree:umanoShadowHeight="0dp">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/player_content"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.kabouzeid.gramophone.views.WidthFitSquareLayout
android:id="@+id/album_cover_container"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<fragment
android:id="@+id/player_album_cover_fragment"
class="com.kabouzeid.gramophone.ui.fragments.player.PlayerAlbumCoverFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.kabouzeid.gramophone.views.WidthFitSquareLayout>
</FrameLayout>
<include layout="@layout/shadow_toolbar" />
<android.support.v7.widget.Toolbar
android:id="@+id/player_toolbar"
style="@style/Toolbar"
android:background="@android:color/transparent" />
</FrameLayout>
<LinearLayout
android:id="@+id/player_panel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<fragment
android:id="@+id/playback_controls_fragment"
class="com.kabouzeid.gramophone.ui.fragments.player.flat.FlatPlayerPlaybackControlsFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!--This is necessary for the drag sorting to work at the top-->
<View
android:id="@+id/draggable_area"
android:layout_width="72dp"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/player_panel_content"
android:layout_alignTop="@+id/player_panel_content"
android:layout_marginTop="128dp" />
<LinearLayout
android:id="@+id/player_panel_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="4dp"
android:layout_marginBottom="4dp"
android:background="@drawable/shadow_down" />
<include
android:id="@+id/current_song"
layout="@layout/item_list" />
<TextView
android:id="@+id/player_queue_sub_header"
android:layout_width="match_parent"
android:layout_height="48dp"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:text="@string/up_next"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
android:textColor="?android:textColorSecondary" />
<android.support.v7.widget.RecyclerView
android:id="@+id/player_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:requiresFadingEdge="vertical" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
</LinearLayout>

View file

@ -0,0 +1,134 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="wrap_content"
android:orientation="vertical"
tools:background="@color/md_amber_500">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/progress_container_height"
android:background="#33000000">
<TextView
android:id="@+id/player_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="@color/ate_primary_text_dark"
android:textSize="12sp"
tools:ignore="RtlHardcoded,RtlSymmetry"
tools:text="0:00" />
<TextView
android:id="@+id/player_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="@color/ate_primary_text_dark"
android:textSize="12sp"
tools:ignore="RtlHardcoded,RtlSymmetry"
tools:text="3:14" />
<SeekBar
android:id="@+id/player_progress_slider"
style="@style/MusicProgressSlider"
android:layout_height="match_parent"
android:layout_toLeftOf="@id/player_song_total_time"
android:layout_toRightOf="@id/player_song_current_progress"
tools:ignore="RtlHardcoded,UnusedAttribute" />
</RelativeLayout>
<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">
<ImageButton
android:id="@+id/player_prev_button"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_centerVertical="true"
android:layout_marginEnd="-8dp"
android:layout_marginRight="-8dp"
android:layout_toLeftOf="@+id/player_play_pause__button"
android:layout_toStartOf="@+id/player_play_pause__button"
android:background="?attr/roundSelector"
android:padding="22dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_skip_previous_white_24dp"
tools:ignore="MissingPrefix" />
<ImageButton
android:id="@+id/player_next_button"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_centerVertical="true"
android:layout_marginLeft="-8dp"
android:layout_marginStart="-8dp"
android:layout_toEndOf="@+id/player_play_pause__button"
android:layout_toRightOf="@+id/player_play_pause__button"
android:background="?attr/roundSelector"
android:padding="22dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_skip_next_white_24dp"
tools:ignore="MissingPrefix" />
<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="16dp"
android:layout_marginStart="16dp"
android:background="?attr/roundSelector"
android:padding="22dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_repeat_white_24dp"
tools:ignore="MissingPrefix" />
<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="16dp"
android:layout_marginRight="16dp"
android:background="?attr/roundSelector"
android:padding="22dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_shuffle_white_24dp"
tools:ignore="MissingPrefix" />
<ImageButton
android:id="@+id/player_play_pause__button"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_centerInParent="true"
android:background="?attr/roundSelector"
android:padding="22dp"
android:scaleType="fitCenter"
tools:ignore="MissingPrefix"
tools:src="@drawable/ic_pause_white_24dp" />
</RelativeLayout>
</LinearLayout>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<View xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="?actionBarSize"
android:background="@drawable/shadow_down" />

View file

@ -20,7 +20,7 @@
android:background="?android:colorBackground">
<fragment android:id="@+id/player_fragment"
class="com.kabouzeid.gramophone.ui.fragments.player.PlayerFragment"
class="com.kabouzeid.gramophone.ui.fragments.player.flat.FlatPlayerFragment"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" />

View file

@ -10,7 +10,8 @@
<dimen name="header_image_height">360dp</dimen>
<dimen name="progress_container_height">20dp</dimen>
<dimen name="media_controller_container_height">120dp</dimen>
<dimen name="fab_media_controller_container_height">120dp</dimen>
<dimen name="media_controller_container_height">104dp</dimen>
<dimen name="status_bar_padding">0dp</dimen>