Added landscape version for now playing screen

This commit is contained in:
Karim Abou Zeid 2015-12-23 22:51:28 +01:00
commit 4dc8178012
6 changed files with 400 additions and 178 deletions

View file

@ -1,130 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<com.sothree.slidinguppanel.SlidingUpPanelLayout
android:id="@+id/player_sliding_layout"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/tools"
xmlns:sothree="http://schemas.android.com/apk/res-auto"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="false"
android:focusable="true"
android:gravity="bottom"
sothree:umanoFadeColor="#00000000"
sothree:umanoOverlay="true"
sothree:umanoPanelHeight="0dp"
sothree:umanoScrollableView="@+id/player_recycler_view"
sothree:umanoShadowHeight="0dp">
android:layout_height="match_parent">
<FrameLayout
<!--The unused FrameLayout layout is necessary to prevent a crash on rotate-->
<com.sothree.slidinguppanel.SlidingUpPanelLayout android:id="@+id/player_sliding_layout"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/tools"
xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:clickable="false"
android:focusable="true"
android:gravity="bottom"
sothree:umanoFadeColor="#00000000"
sothree:umanoOverlay="true"
sothree:umanoPanelHeight="0dp"
sothree:umanoScrollableView="@+id/player_recycler_view"
sothree:umanoShadowHeight="0dp">
<View
android:id="@+id/color_background"
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/player_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.kabouzeid.gramophone.views.SquareLayout
android:id="@+id/album_cover_container"
<View
android:id="@+id/color_background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true">
<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.SquareLayout>
<fragment
android:id="@+id/playback_controls_fragment"
class="com.kabouzeid.gramophone.ui.fragments.player.PlaybackControlsFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/album_cover_container" />
</RelativeLayout>
<include layout="@layout/shadow_statusbar_actionbar" />
<android.support.v7.widget.Toolbar
android:id="@+id/player_toolbar"
style="@style/Toolbar"
android:layout_marginTop="@dimen/status_bar_padding"
android:background="@android:color/transparent" />
</FrameLayout>
<FrameLayout
android:id="@+id/player_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:id="@+id/playing_queue_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="@dimen/status_bar_padding"
app:cardBackgroundColor="?cardBackgroundColor"
app:cardElevation="@dimen/card_elevation"
app:cardUseCompatPadding="false">
android:layout_height="match_parent" />
<RelativeLayout
android:id="@+id/player_content"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:orientation="vertical">
<!--This is necessary for the drag sorting to work at the top-->
<View
android:layout_marginTop="120dp"
android:layout_alignTop="@+id/card_content"
android:layout_alignBottom="@+id/card_content"
android:id="@+id/draggable_area"
android:layout_width="72dp"
android:layout_height="wrap_content" />
<LinearLayout
android:id="@+id/card_content"
<com.kabouzeid.gramophone.views.SquareLayout
android:id="@+id/album_cover_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:layout_alignParentTop="true">
<include
android:id="@+id/current_song"
layout="@layout/item_list" />
<TextView
android:id="@+id/player_queue_subheader"
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"
<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" />
</LinearLayout>
</com.kabouzeid.gramophone.views.SquareLayout>
<fragment
android:id="@+id/playback_controls_fragment"
class="com.kabouzeid.gramophone.ui.fragments.player.PlaybackControlsFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/album_cover_container" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<include layout="@layout/shadow_statusbar_actionbar" />
</FrameLayout>
<android.support.v7.widget.Toolbar
android:id="@+id/player_toolbar"
style="@style/Toolbar"
android:layout_marginTop="@dimen/status_bar_padding"
android:background="@android:color/transparent" />
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
</FrameLayout>
<FrameLayout
android:id="@+id/player_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:id="@+id/playing_queue_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="@dimen/status_bar_padding"
app:cardBackgroundColor="?cardBackgroundColor"
app:cardElevation="@dimen/card_elevation"
app:cardUseCompatPadding="false">
<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/card_content"
android:layout_alignTop="@+id/card_content"
android:layout_marginTop="120dp" />
<LinearLayout
android:id="@+id/card_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<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" />
</LinearLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
</FrameLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
</FrameLayout>

View file

@ -1,5 +1,4 @@
<com.sothree.slidinguppanel.SlidingUpPanelLayout
android:id="@+id/sliding_layout"
<com.sothree.slidinguppanel.SlidingUpPanelLayout android:id="@+id/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"
@ -20,9 +19,9 @@
android:layout_height="match_parent"
android:background="?android:colorBackground">
<fragment
android:id="@+id/player_fragment"
<fragment android:id="@+id/player_fragment"
class="com.kabouzeid.gramophone.ui.fragments.player.PlayerFragment"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" />