Commit 741df078 authored by Alexandre Perraud's avatar Alexandre Perraud

UI : Change colors and shadows of the Playlist view

parent fce46541
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
android:layout_height="fill_parent">
<ProgressBar
android:id="@+id/progressBar"
......@@ -23,7 +22,9 @@
android:layout_width="fill_parent"
android:layout_height="60dip"
android:gravity="center_vertical"
android:orientation="horizontal" >
android:orientation="horizontal"
android:background="?attr/background_default"
android:layout_below="@+id/progressBar">
<org.videolan.vlc.gui.audio.widget.HeaderMediaSwitcher
android:id="@+id/audio_media_switcher"
......@@ -101,11 +102,18 @@
android:background="#00000000" />
</LinearLayout>
<include layout="@layout/shadow_top"
android:layout_width="match_parent"
android:layout_height="6dp"
android:layout_below="@+id/header"/>
<ViewSwitcher
android:id="@+id/view_switcher"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
android:layout_weight="1"
android:layout_below="@+id/header"
android:layout_above="@+id/player_controls">
<org.videolan.vlc.gui.audio.AudioPlaylistView
android:id="@+id/songs_list"
......@@ -121,113 +129,121 @@
</ViewSwitcher>
<LinearLayout
android:layout_width="fill_parent"
android:id="@+id/player_controls"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:layout_marginTop="5dip"
android:layout_weight="0"
android:gravity="center"
android:orientation="horizontal" >
android:orientation="vertical"
android:layout_alignParentBottom="true"
android:background="?attr/background_default">
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center|left"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:layout_marginTop="5dip"
android:layout_weight="0"
android:clickable="true"
android:text="@string/time_0"
android:textSize="12sp" />
<SeekBar
android:id="@+id/timeline"
android:gravity="center"
android:orientation="horizontal" >
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|left"
android:layout_weight="0"
android:clickable="true"
android:text="@string/time_0"
android:textSize="12sp" />
<SeekBar
android:id="@+id/timeline"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:focusable="true"
android:maxHeight="4dip"
android:minHeight="4dip"
android:paddingLeft="16dip"
android:paddingRight="16dip"
android:progressDrawable="@drawable/po_seekbar"
android:splitTrack="false"
android:thumb="@drawable/seekbar_thumb" />
<TextView
android:id="@+id/length"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|right"
android:layout_weight="0"
android:text="@string/time_0"
android:textSize="12sp" />
</LinearLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:focusable="true"
android:maxHeight="4dip"
android:minHeight="4dip"
android:paddingLeft="16dip"
android:paddingRight="16dip"
android:progressDrawable="@drawable/po_seekbar"
android:splitTrack="false"
android:thumb="@drawable/seekbar_thumb" />
<TextView
android:id="@+id/length"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|right"
android:layout_weight="0"
android:text="@string/time_0"
android:textSize="12sp" />
android:layout_weight="0" >
<ImageButton
android:id="@+id/shuffle"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="#00000000"
android:contentDescription="@string/shuffle"
android:focusable="true"
android:scaleType="fitXY"
android:src="?attr/ic_shuffle_normal" />
<ImageButton
android:id="@+id/repeat"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="#00000000"
android:contentDescription="@string/repeat"
android:focusable="true"
android:scaleType="fitXY"
android:src="?attr/ic_repeat_normal" />
<ImageButton
android:id="@+id/play_pause"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="#00000000"
android:contentDescription="@string/pause"
android:focusable="true"
android:scaleType="fitXY"
android:src="?attr/ic_pause" />
<ImageButton
android:id="@+id/next"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/play_pause"
android:background="#00000000"
android:contentDescription="@string/next"
android:focusable="true"
android:scaleType="fitXY"
android:src="?attr/ic_next" />
<ImageButton
android:id="@+id/previous"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:layout_marginRight="10dp"
android:layout_toLeftOf="@+id/play_pause"
android:background="#00000000"
android:contentDescription="@string/previous"
android:focusable="true"
android:scaleType="fitXY"
android:src="?attr/ic_previous" />
</RelativeLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0" >
<ImageButton
android:id="@+id/shuffle"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="#00000000"
android:contentDescription="@string/shuffle"
android:focusable="true"
android:scaleType="fitXY"
android:src="?attr/ic_shuffle_normal" />
<ImageButton
android:id="@+id/repeat"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="#00000000"
android:contentDescription="@string/repeat"
android:focusable="true"
android:scaleType="fitXY"
android:src="?attr/ic_repeat_normal" />
<ImageButton
android:id="@+id/play_pause"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="#00000000"
android:contentDescription="@string/pause"
android:focusable="true"
android:scaleType="fitXY"
android:src="?attr/ic_pause" />
<ImageButton
android:id="@+id/next"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/play_pause"
android:background="#00000000"
android:contentDescription="@string/next"
android:focusable="true"
android:scaleType="fitXY"
android:src="?attr/ic_next" />
<ImageButton
android:id="@+id/previous"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:layout_marginRight="10dp"
android:layout_toLeftOf="@+id/play_pause"
android:background="#00000000"
android:contentDescription="@string/previous"
android:focusable="true"
android:scaleType="fitXY"
android:src="?attr/ic_previous" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
......@@ -47,8 +47,6 @@ public class AudioPlaylistView extends ListView {
private OnItemRemovedListener mOnItemRemovedListener;
private OnItemLongClickListener mOnItemLongClickListener;
Drawable mShadowDrawable;
public AudioPlaylistView(Context context, AttributeSet attrs) {
super(context, attrs);
......@@ -57,8 +55,6 @@ public class AudioPlaylistView extends ListView {
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mDragShadow = inflater.inflate(R.layout.audio_playlist_item_drag_shadow, this, false);
int resId = Util.getResourceFromAttribute(context, R.attr.audio_playlist_shadow);
mShadowDrawable = resId != 0 ? getResources().getDrawable(resId) : null;
}
@Override
......@@ -141,29 +137,6 @@ public class AudioPlaylistView extends ListView {
}
}
@Override
public void draw(Canvas c) {
super.draw(c);
if (mShadowDrawable == null)
return;
// Draw the top and bottom list shadows.
final int shadowHeight = mShadowDrawable.getIntrinsicHeight();
final int right = getRight();
final int left = getLeft();
final int bottom = getBottom();
final int top = bottom - shadowHeight;
mShadowDrawable.setBounds(left, top, right, bottom);
mShadowDrawable.draw(c);
c.rotate(180, getWidth() / 2, getHeight() / 2);
mShadowDrawable.setBounds(left, top, right, bottom);
mShadowDrawable.draw(c);
}
public void startDrag(int positionDragStart, String title, String artist) {
mPositionDragStart = positionDragStart;
if (mDragShadow != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment