Merge pull request #346 from ultrasonic/improve-player

Improve player layout
This commit is contained in:
Óscar García Amor 2020-11-05 08:34:41 +01:00 committed by GitHub
commit 7813c0373d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 171 additions and 182 deletions

View File

@ -6,7 +6,7 @@
<org.moire.ultrasonic.util.MyViewFlipper
a:id="@+id/download_playlist_flipper"
a:layout_width="fill_parent"
a:layout_width="0dp"
a:layout_height="fill_parent"
a:layout_weight="1">
@ -22,8 +22,9 @@
a:id="@+id/download_album_art_image"
a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:scaleType="centerCrop"
a:contentDescription="@string/albumArt"/>
a:alpha="0.2"
a:contentDescription="@string/albumArt"
a:scaleType="centerCrop" />
<LinearLayout
a:id="@+id/album_art_inside"
@ -32,12 +33,14 @@
a:gravity="bottom"
a:orientation="vertical" >
<include layout="@layout/player_media_info"/>
<LinearLayout
a:id="@+id/song_rating"
a:layout_width="match_parent"
a:layout_height="60dip"
a:layout_gravity="center"
a:layout_margin="40dip"
a:layout_margin="10dip"
a:orientation="horizontal">
<ImageView
@ -112,46 +115,13 @@
a:background="@color/translucent"
a:orientation="vertical"/>
<include layout="@layout/player_slider"/>
<include layout="@layout/media_buttons"/>
</LinearLayout>
</FrameLayout>
<include layout="@layout/download_playlist"/>
</org.moire.ultrasonic.util.MyViewFlipper>
<RelativeLayout
a:id="@+id/download_control_layout"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:layout_weight="1.2"
a:orientation="vertical">
<LinearLayout
a:layout_height="wrap_content"
a:layout_width="fill_parent"
a:id="@+id/buttons"
a:layout_above="@+id/slider">
<include layout="@layout/media_buttons"/>
</LinearLayout>
<LinearLayout
a:layout_height="wrap_content"
a:layout_width="fill_parent"
a:id="@+id/slider"
a:layout_above="@+id/playback_text">
<include layout="@layout/download_slider"/>
</LinearLayout>
<LinearLayout
a:layout_height="wrap_content"
a:layout_width="fill_parent"
a:layout_alignParentBottom="true"
a:id="@+id/playback_text">
<include layout="@layout/download_button_bar_flipper"/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>

View File

@ -121,10 +121,10 @@
<include layout="@layout/download_playlist" />
</org.moire.ultrasonic.util.MyViewFlipper>
<include layout="@layout/media_buttons" />
<include layout="@layout/download_slider" />
<include layout="@layout/player_media_info" />
<include layout="@layout/download_button_bar_flipper" />
<include layout="@layout/player_slider" />
<include layout="@layout/media_buttons" />
</LinearLayout>

View File

@ -1,89 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:id="@+id/download_button_bar_flipper"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:paddingBottom="8dip"
a:paddingLeft="8dip"
a:paddingRight="8dip" >
<TextView
a:id="@+id/download_song_title"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:layout_alignParentTop="true"
a:layout_centerHorizontal="true"
a:gravity="center"
a:ellipsize="end"
a:singleLine="true"
a:textAppearance="?android:attr/textAppearanceMedium"/>
<RelativeLayout
a:id="@+id/download_items"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:layout_below="@id/download_song_title" >
<TextView
a:id="@+id/download_position"
a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:layout_alignParentLeft="true"
a:layout_marginRight="6dip"
a:text="@string/util.no_time"
a:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
a:id="@+id/download_track"
a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:layout_alignParentLeft="true"
a:layout_below="@id/download_position"
a:layout_marginRight="6dip"
a:text="0 / 0"
a:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
a:id="@+id/download_duration"
a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:layout_alignParentRight="true"
a:layout_marginLeft="6dip"
a:text="@string/util.no_time"
a:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
a:id="@+id/download_total_duration"
a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:layout_alignParentRight="true"
a:layout_below="@id/download_duration"
a:layout_marginLeft="6dip"
a:text="@string/util.no_time"
a:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
a:id="@+id/download_artist"
a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:layout_centerHorizontal="true"
a:layout_toLeftOf="@+id/download_duration"
a:layout_toRightOf="@+id/download_position"
a:ellipsize="end"
a:gravity="center_horizontal"
a:singleLine="true"
a:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
a:id="@+id/download_album"
a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:layout_below="@+id/download_artist"
a:layout_centerHorizontal="true"
a:ellipsize="end"
a:singleLine="true"
a:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
</RelativeLayout>

View File

@ -1,17 +0,0 @@
<?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="wrap_content"
android:orientation="vertical" >
<SeekBar
android:id="@+id/download_progress_bar"
android:layout_width="fill_parent"
android:layout_height="48dp"
android:indeterminate="false"
android:paddingBottom="7dip"
android:paddingLeft="7dip"
android:paddingRight="7dip"
android:paddingTop="7dip" />
</LinearLayout>

View File

@ -1,81 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:orientation="horizontal"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:paddingBottom="8dip"
a:paddingTop="8dip"
a:paddingLeft="4dip"
a:paddingRight="4dip"
>
xmlns:tools="http://schemas.android.com/tools"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:orientation="horizontal"
a:layout_marginLeft="12dp"
a:layout_marginRight="12dp" >
<ImageView
a:id="@+id/download_shuffle"
a:layout_width="0dip"
a:layout_height="32dp"
a:layout_height="26dp"
a:layout_alignParentLeft="true"
a:layout_gravity="center"
a:layout_weight="1"
a:adjustViewBounds="true"
a:focusable="true"
a:paddingLeft="2dip"
a:scaleType="fitCenter"
a:src="?attr/media_shuffle" />
<org.moire.ultrasonic.view.AutoRepeatButton
a:id="@+id/download_previous"
a:layout_width="0dip"
a:layout_height="48dp"
a:scaleType="fitCenter"
a:layout_height="42dp"
a:layout_gravity="center"
a:layout_weight="1"
a:layout_weight="2"
a:adjustViewBounds="true"
a:focusable="true"
a:scaleType="fitCenter"
a:src="?attr/media_previous" />
<ImageView
a:id="@+id/download_start"
a:layout_width="48dip"
a:layout_height="96dp"
a:layout_weight="1"
a:layout_width="0dip"
a:layout_height="74dp"
a:layout_weight="2"
a:adjustViewBounds="true"
a:focusable="true"
a:scaleType="fitCenter"
a:src="?attr/media_play" />
a:src="?attr/media_play"
tools:visibility="gone" />
<ImageView
a:id="@+id/download_pause"
a:layout_width="48dip"
a:layout_height="96dp"
a:layout_weight="1"
a:layout_width="0dip"
a:layout_height="74dp"
a:layout_weight="2"
a:adjustViewBounds="true"
a:focusable="true"
a:scaleType="fitCenter"
a:src="?attr/media_pause" />
<ImageView
a:id="@+id/download_stop"
a:layout_width="48dip"
a:layout_height="96dp"
a:layout_weight="1"
a:layout_width="0dip"
a:layout_height="74dp"
a:layout_weight="2"
a:adjustViewBounds="true"
a:focusable="true"
a:scaleType="fitCenter"
a:src="?attr/media_stop" />
a:src="?attr/media_stop"
tools:visibility="gone" />
<org.moire.ultrasonic.view.AutoRepeatButton
a:id="@+id/download_next"
a:layout_width="0dip"
a:layout_height="48dp"
a:scaleType="fitCenter"
a:layout_height="42dp"
a:layout_gravity="center"
a:layout_weight="1"
a:layout_weight="2"
a:adjustViewBounds="true"
a:focusable="true"
a:scaleType="fitCenter"
a:src="?attr/media_next" />
<ImageView
a:id="@+id/download_repeat"
a:layout_width="0dip"
a:layout_height="32dp"
a:scaleType="fitCenter"
a:layout_height="26dp"
a:layout_gravity="center"
a:layout_weight="1"
a:adjustViewBounds="true"
a:focusable="true"
a:src="?attr/media_repeat_off"
a:paddingRight="2dip"/>
a:scaleType="fitCenter"
a:src="?attr/media_repeat_off" />
</LinearLayout>
</LinearLayout>

View File

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:a="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
a:id="@+id/download_button_bar_flipper"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:layout_marginTop="10dp"
a:layout_marginLeft="12dp"
a:layout_marginRight="12dp" >
<LinearLayout
a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:layout_alignParentLeft="true"
a:orientation="vertical">
<TextView
a:id="@+id/download_song_title"
a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:ellipsize="start"
a:gravity="left"
a:singleLine="true"
a:textAppearance="?android:attr/textAppearanceLarge"
a:textStyle="bold"
tools:text="Title" />
<TextView
a:id="@+id/download_artist"
a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:ellipsize="start"
a:gravity="left"
a:singleLine="true"
a:textAppearance="?android:attr/textAppearanceSmall"
tools:text="Artist" />
<TextView
a:id="@+id/download_album"
a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:ellipsize="start"
a:gravity="right"
a:singleLine="true"
a:textAppearance="?android:attr/textAppearanceSmall"
tools:text="Album" />
</LinearLayout>
<LinearLayout
a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:layout_alignParentRight="true"
a:layout_centerVertical="true"
a:gravity="right"
a:orientation="vertical">
<TextView
a:id="@+id/download_track"
a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:ellipsize="start"
a:gravity="right"
a:text="0 / 0"
a:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
a:id="@+id/download_total_duration"
a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:ellipsize="start"
a:gravity="right"
a:text="@string/util.no_time"
a:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</RelativeLayout>

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:layout_width="match_parent"
a:layout_height="wrap_content"
a:orientation="vertical"
a:layout_marginTop="10dp"
a:layout_marginLeft="12dp"
a:layout_marginRight="12dp" >
<SeekBar
a:id="@+id/download_progress_bar"
a:layout_width="fill_parent"
a:layout_height="32dp"
a:indeterminate="false" />
<RelativeLayout
a:layout_width="match_parent"
a:layout_height="match_parent">
<TextView
a:id="@+id/download_position"
a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:layout_alignParentLeft="true"
a:layout_marginLeft="12dip"
a:text="@string/util.no_time"
a:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
a:id="@+id/download_duration"
a:layout_width="wrap_content"
a:layout_height="wrap_content"
a:layout_alignParentRight="true"
a:layout_marginRight="12dip"
a:text="@string/util.no_time"
a:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
</LinearLayout>