New now playing screen. Work in progress!

This commit is contained in:
Karim Abou Zeid 2015-11-22 21:07:49 +01:00
commit 1cde43af07
27 changed files with 889 additions and 571 deletions

View file

@ -4,7 +4,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.kabouzeid.gramophone.views.SquareIfPlaceImageView
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="@dimen/header_image_height"

View file

@ -3,7 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.kabouzeid.gramophone.views.SquareIfPlaceImageView
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="@dimen/header_image_height"

View file

@ -2,142 +2,121 @@
<LinearLayout
android:id="@+id/player_footer_frame"
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">
<LinearLayout
android:id="@+id/player_footer"
<RelativeLayout
android:background="#5a000000"
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">
android:layout_height="@dimen/progress_container_height">
<TextView
android:id="@+id/player_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
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:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textColor="?android:textColorSecondary"
android:textSize="12sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<TextView
android:id="@+id/player_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
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.Caption" />
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textColor="?android:textColorSecondary"
android:textSize="12sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
</LinearLayout>
<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" />
<FrameLayout
</RelativeLayout>
<RelativeLayout
android:id="@+id/player_media_controller_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="@dimen/media_controller_container_height"
tools:ignore="ContentDescription,UnusedAttribute">
<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_fab"
android:layout_toStartOf="@+id/player_play_pause_fab"
android:background="?round_selector"
android:padding="22dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_skip_previous_white_36dp" />
<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" />
<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_fab"
android:layout_toRightOf="@+id/player_play_pause_fab"
android:background="?round_selector"
android:padding="22dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_skip_next_white_36dp" />
<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_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:padding="22dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_repeat_white_36dp" />
<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/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="-8dp"
android:layout_marginStart="-8dp"
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>
<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:padding="22dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_shuffle_white_36dp" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/player_play_pause_fab"
style="@style/PlayPauseFab"
android:layout_gravity="center" />
android:layout_centerInParent="true" />
</FrameLayout>
</RelativeLayout>
</LinearLayout>

View file

@ -5,36 +5,43 @@
android:clickable="true"
android:focusable="false">
<fragment
android:id="@+id/player_album_cover_fragment"
class="com.kabouzeid.gramophone.ui.fragments.PlayerAlbumCoverFragment"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/playback_controls_fragment"
tools:layout="@layout/fragment_player_album_cover" />
android:orientation="vertical">
<fragment
android:layout_alignParentBottom="true"
android:id="@+id/playback_controls_fragment"
class="com.kabouzeid.gramophone.ui.fragments.PlaybackControlsFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout="@layout/fragment_playback_controls" />
<fragment
android:id="@+id/player_album_cover_fragment"
class="com.kabouzeid.gramophone.ui.fragments.PlayerAlbumCoverFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
tools:layout="@layout/fragment_player_album_cover" />
<fragment
android:id="@+id/playback_controls_fragment"
class="com.kabouzeid.gramophone.ui.fragments.PlaybackControlsFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/player_album_cover_fragment"
tools:layout="@layout/fragment_playback_controls" />
<fragment
android:id="@+id/playing_info_fragment"
class="com.kabouzeid.gramophone.ui.fragments.PlayingInfoFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/playback_controls_fragment"
tools:layout="@layout/fragment_playing_info" />
</RelativeLayout>
<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:layout_marginTop="@dimen/status_bar_padding"
android:background="@android:color/transparent"
tools:ignore="UnusedAttribute" />

View file

@ -8,13 +8,11 @@
android:layout_above="@id/player_footer_frame"
android:background="@android:color/black">
<com.kabouzeid.gramophone.views.SquareIfPlaceImageView
<com.kabouzeid.gramophone.views.WidthFitSquareImageView
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

View file

@ -0,0 +1,37 @@
<FrameLayout
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:id="@+id/player_footer"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:layout_marginBottom="-18dp"
app:cardUseCompatPadding="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="?cardBackgroundColor"
app:cardElevation="@dimen/card_elevation">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/item_list" />
<include layout="@layout/item_list" />
<include layout="@layout/item_list" />
<include layout="@layout/item_list" />
<include layout="@layout/item_list" />
</LinearLayout>
</android.support.v7.widget.CardView>
</FrameLayout>

View file

@ -1,23 +1,24 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.percent.PercentFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="@dimen/navigation_drawer_header_height"
android:layout_height="wrap_content"
android:clickable="true"
android:foreground="?rect_selector">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_widthPercent="100%"
app:layout_aspectRatio="178%"
android:scaleType="centerCrop"
android:src="@drawable/default_album_art"
android:transitionName="@string/transition_album_art"
tools:ignore="UnusedAttribute" />
tools:ignore="ContentDescription,UnusedAttribute" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="56dp"
android:layout_gravity="bottom"
android:background="@drawable/shadow_up" />
@ -55,4 +56,4 @@
</LinearLayout>
</FrameLayout>
</android.support.percent.PercentFrameLayout>