Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLC-Android
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
323
Issues
323
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VideoLAN
VLC-Android
Commits
741df078
Commit
741df078
authored
Apr 02, 2015
by
Alexandre Perraud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UI : Change colors and shadows of the Playlist view
parent
fce46541
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
124 additions
and
135 deletions
+124
-135
vlc-android/res/layout/audio_player.xml
vlc-android/res/layout/audio_player.xml
+124
-108
vlc-android/src/org/videolan/vlc/gui/audio/AudioPlaylistView.java
...oid/src/org/videolan/vlc/gui/audio/AudioPlaylistView.java
+0
-27
No files found.
vlc-android/res/layout/audio_player.xml
View file @
741df078
<?xml version="1.0" encoding="utf-8"?>
<
Linear
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
Relative
Layout
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>
vlc-android/src/org/videolan/vlc/gui/audio/AudioPlaylistView.java
View file @
741df078
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment