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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Casanowow Life for love
VLC-Android
Commits
f3ae5aff
Commit
f3ae5aff
authored
May 05, 2012
by
Sébastien Toque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UI: Alternative gradients on items in media lists + some orange for subitems
parent
4a9d0d9a
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
107 additions
and
23 deletions
+107
-23
vlc-android/res/drawable/background_item1.xml
vlc-android/res/drawable/background_item1.xml
+10
-0
vlc-android/res/drawable/background_item2.xml
vlc-android/res/drawable/background_item2.xml
+9
-0
vlc-android/res/layout/audio_browser.xml
vlc-android/res/layout/audio_browser.xml
+13
-1
vlc-android/res/layout/audio_browser_item.xml
vlc-android/res/layout/audio_browser_item.xml
+1
-0
vlc-android/res/layout/audio_browser_playlist.xml
vlc-android/res/layout/audio_browser_playlist.xml
+1
-0
vlc-android/res/layout/audio_browser_playlist_child.xml
vlc-android/res/layout/audio_browser_playlist_child.xml
+35
-21
vlc-android/res/layout/audio_list.xml
vlc-android/res/layout/audio_list.xml
+3
-0
vlc-android/res/layout/video_list.xml
vlc-android/res/layout/video_list.xml
+4
-1
vlc-android/res/layout/video_list_item.xml
vlc-android/res/layout/video_list_item.xml
+1
-0
vlc-android/res/values/colors.xml
vlc-android/res/values/colors.xml
+9
-0
vlc-android/src/org/videolan/vlc/Util.java
vlc-android/src/org/videolan/vlc/Util.java
+7
-0
vlc-android/src/org/videolan/vlc/gui/audio/AudioPlaylistAdapter.java
.../src/org/videolan/vlc/gui/audio/AudioPlaylistAdapter.java
+7
-0
vlc-android/src/org/videolan/vlc/gui/audio/AudioSongsListAdapter.java
...src/org/videolan/vlc/gui/audio/AudioSongsListAdapter.java
+4
-0
vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
...roid/src/org/videolan/vlc/gui/video/VideoListAdapter.java
+3
-0
No files found.
vlc-android/res/drawable/background_item1.xml
0 → 100644
View file @
f3ae5aff
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<gradient
android:angle=
"270"
android:centerColor=
"@color/item_1"
android:endColor=
"@color/item_common"
android:startColor=
"@color/item_common"
/>
</shape>
\ No newline at end of file
vlc-android/res/drawable/background_item2.xml
0 → 100644
View file @
f3ae5aff
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<gradient
android:angle=
"270"
android:centerColor=
"@color/item_2"
android:endColor=
"@color/item_common"
android:startColor=
"@color/item_common"
/>
</shape>
\ No newline at end of file
vlc-android/res/layout/audio_browser.xml
View file @
f3ae5aff
...
...
@@ -3,7 +3,8 @@
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
android:background=
"@color/item_common"
>
<HorizontalScrollView
android:id=
"@+id/header"
android:scrollbars=
"none"
...
...
@@ -62,23 +63,34 @@
android:id=
"@+id/songs_list"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
android:divider=
"@color/item_common"
android:dividerHeight=
"1dp"
android:fastScrollEnabled=
"true"
/>
<ExpandableListView
android:id=
"@+id/artists_list"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
android:divider=
"@color/item_common"
android:childDivider=
"@color/item_common"
android:dividerHeight=
"1dp"
android:groupIndicator=
"@null"
android:fastScrollEnabled=
"true"
/>
<ExpandableListView
android:id=
"@+id/albums_list"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
android:divider=
"@color/item_common"
android:childDivider=
"@color/item_common"
android:dividerHeight=
"1dp"
android:groupIndicator=
"@null"
android:fastScrollEnabled=
"true"
/>
<ExpandableListView
android:id=
"@+id/genres_list"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
android:divider=
"@color/item_common"
android:childDivider=
"@color/item_common"
android:dividerHeight=
"1dp"
android:groupIndicator=
"@null"
android:fastScrollEnabled=
"true"
/>
</org.videolan.vlc.widget.FlingViewGroup>
...
...
vlc-android/res/layout/audio_browser_item.xml
View file @
f3ae5aff
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/layout_item"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_vertical"
...
...
vlc-android/res/layout/audio_browser_playlist.xml
View file @
f3ae5aff
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/layout_item"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
...
...
vlc-android/res/layout/audio_browser_playlist_child.xml
View file @
f3ae5aff
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/layout_item"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_vertical"
android:orientation=
"vertical"
>
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"25dip"
android:layout_marginRight=
"5dip"
android:layout_marginTop=
"5dip"
android:text=
"@string/title"
android:textColor=
"#ffffff"
android:textSize=
"20dip"
/>
<View
android:layout_width=
"5dip"
android:layout_height=
"fill_parent"
android:layout_marginLeft=
"5dip"
android:background=
"@color/orange"
/>
<TextView
android:id=
"@+id/text"
android:layout_width=
"wrap_content"
<LinearLayout
android:layout_width=
"0dip"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"25dip"
android:layout_marginRight=
"5dip"
android:layout_marginBottom=
"5dip"
android:text=
"@string/songs"
android:textColor=
"#888888"
android:textSize=
"14dip"
/>
android:layout_weight=
"1"
android:gravity=
"center_vertical"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"15dip"
android:layout_marginRight=
"5dip"
android:layout_marginTop=
"5dip"
android:text=
"@string/title"
android:textColor=
"#ffffff"
android:textSize=
"20dip"
/>
<TextView
android:id=
"@+id/text"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"5dip"
android:layout_marginLeft=
"15dip"
android:layout_marginRight=
"5dip"
android:text=
"@string/songs"
android:textColor=
"#888888"
android:textSize=
"14dip"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
vlc-android/res/layout/audio_list.xml
View file @
f3ae5aff
...
...
@@ -2,6 +2,7 @@
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
android:background=
"@color/item_common"
android:orientation=
"vertical"
>
<LinearLayout
...
...
@@ -36,6 +37,8 @@
android:id=
"@id/android:list"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
android:divider=
"@color/item_common"
android:dividerHeight=
"1dp"
android:fastScrollEnabled=
"true"
/>
<TextView
...
...
vlc-android/res/layout/video_list.xml
View file @
f3ae5aff
...
...
@@ -2,11 +2,14 @@
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
>
android:layout_height=
"fill_parent"
android:background=
"@color/item_common"
>
<ListView
android:id=
"@id/android:list"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
android:divider=
"@color/item_common"
android:dividerHeight=
"1dp"
android:fastScrollEnabled=
"true"
/>
<FrameLayout
android:id=
"@id/android:empty"
...
...
vlc-android/res/layout/video_list_item.xml
View file @
f3ae5aff
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/layout_item"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
...
...
vlc-android/res/values/colors.xml
0 → 100644
View file @
f3ae5aff
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color
name=
"item_common"
>
#F111
</color>
<color
name=
"item_1"
>
#F222
</color>
<color
name=
"item_2"
>
#F000
</color>
<color
name=
"orange"
>
#FFF48B00
</color>
</resources>
\ No newline at end of file
vlc-android/src/org/videolan/vlc/Util.java
View file @
f3ae5aff
...
...
@@ -27,6 +27,7 @@ import java.text.DecimalFormat;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
android.net.Uri
;
import
android.view.View
;
import
android.widget.Toast
;
public
class
Util
{
...
...
@@ -159,4 +160,10 @@ public class Util {
{
return
(
string
!=
null
&&
string
.
length
()
>
0
)
?
string
:
context
.
getString
(
defaultId
);
}
public
static
void
setItemBackground
(
View
v
,
int
position
)
{
v
.
setBackgroundResource
(
position
%
2
==
0
?
R
.
drawable
.
background_item1
:
R
.
drawable
.
background_item2
);
}
}
vlc-android/src/org/videolan/vlc/gui/audio/AudioPlaylistAdapter.java
View file @
f3ae5aff
...
...
@@ -26,6 +26,7 @@ import java.util.List;
import
org.videolan.vlc.Media
;
import
org.videolan.vlc.R
;
import
org.videolan.vlc.Util
;
import
android.content.Context
;
import
android.content.res.Resources
;
...
...
@@ -150,6 +151,7 @@ public class AudioPlaylistAdapter extends BaseExpandableListAdapter {
if
(
v
==
null
)
{
v
=
mInflater
.
inflate
(
R
.
layout
.
audio_browser_playlist
,
parent
,
false
);
holder
=
new
GroupViewHolder
();
holder
.
layout
=
(
View
)
v
.
findViewById
(
R
.
id
.
layout_item
);
holder
.
title
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
title
);
holder
.
text
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
text
);
holder
.
more
=
(
ImageView
)
v
.
findViewById
(
R
.
id
.
more
);
...
...
@@ -162,6 +164,7 @@ public class AudioPlaylistAdapter extends BaseExpandableListAdapter {
int
countMedia
=
mGroups
.
get
(
name
).
get
(
null
).
size
();
Resources
res
=
mContext
.
getResources
();
Util
.
setItemBackground
(
holder
.
layout
,
groupPosition
);
holder
.
title
.
setText
(
name
);
if
(
count
>
2
)
holder
.
text
.
setText
(
res
.
getQuantityString
(
mGroupTextId
,
count
-
1
,
count
-
1
));
...
...
@@ -185,6 +188,7 @@ public class AudioPlaylistAdapter extends BaseExpandableListAdapter {
if
(
v
==
null
)
{
v
=
mInflater
.
inflate
(
R
.
layout
.
audio_browser_playlist_child
,
parent
,
false
);
holder
=
new
ChildViewHolder
();
holder
.
layout
=
(
View
)
v
.
findViewById
(
R
.
id
.
layout_item
);
holder
.
title
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
title
);
holder
.
text
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
text
);
v
.
setTag
(
holder
);
...
...
@@ -197,6 +201,7 @@ public class AudioPlaylistAdapter extends BaseExpandableListAdapter {
int
count
=
list
.
size
();
Resources
res
=
mContext
.
getResources
();
Util
.
setItemBackground
(
holder
.
layout
,
childPosition
);
if
(
name
!=
null
)
holder
.
title
.
setText
(
name
);
else
...
...
@@ -207,12 +212,14 @@ public class AudioPlaylistAdapter extends BaseExpandableListAdapter {
}
static
class
GroupViewHolder
{
View
layout
;
TextView
title
;
TextView
text
;
ImageView
more
;
}
static
class
ChildViewHolder
{
View
layout
;
TextView
title
;
TextView
text
;
}
...
...
vlc-android/src/org/videolan/vlc/gui/audio/AudioSongsListAdapter.java
View file @
f3ae5aff
...
...
@@ -25,6 +25,7 @@ import java.util.List;
import
org.videolan.vlc.Media
;
import
org.videolan.vlc.R
;
import
org.videolan.vlc.Util
;
import
android.content.Context
;
import
android.graphics.Color
;
...
...
@@ -69,6 +70,7 @@ public class AudioSongsListAdapter extends ArrayAdapter<Media> {
LayoutInflater
inflater
=
(
LayoutInflater
)
getContext
().
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
v
=
inflater
.
inflate
(
R
.
layout
.
audio_browser_item
,
parent
,
false
);
holder
=
new
ViewHolder
();
holder
.
layout
=
(
View
)
v
.
findViewById
(
R
.
id
.
layout_item
);
holder
.
title
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
title
);
holder
.
artist
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
artist
);
v
.
setTag
(
holder
);
...
...
@@ -76,6 +78,7 @@ public class AudioSongsListAdapter extends ArrayAdapter<Media> {
holder
=
(
ViewHolder
)
v
.
getTag
();
Media
media
=
getItem
(
position
);
Util
.
setItemBackground
(
holder
.
layout
,
position
);
holder
.
title
.
setText
(
media
.
getTitle
());
holder
.
title
.
setTextColor
(
mCurrentIndex
==
position
?
0xFFF48B00
/* ORANGE */
:
Color
.
WHITE
);
holder
.
artist
.
setText
(
media
.
getArtist
()
+
" - "
+
media
.
getAlbum
());
...
...
@@ -98,6 +101,7 @@ public class AudioSongsListAdapter extends ArrayAdapter<Media> {
}
static
class
ViewHolder
{
View
layout
;
TextView
title
;
TextView
artist
;
}
...
...
vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
View file @
f3ae5aff
...
...
@@ -122,6 +122,7 @@ public class VideoListAdapter extends ArrayAdapter<Media>
LayoutInflater
inflater
=
(
LayoutInflater
)
getContext
().
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
v
=
inflater
.
inflate
(
R
.
layout
.
video_list_item
,
parent
,
false
);
holder
=
new
ViewHolder
();
holder
.
layout
=
(
View
)
v
.
findViewById
(
R
.
id
.
layout_item
);
holder
.
thumbnail
=
(
ImageView
)
v
.
findViewById
(
R
.
id
.
ml_item_thumbnail
);
holder
.
length
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
ml_item_length
);
holder
.
title
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
ml_item_title
);
...
...
@@ -131,6 +132,7 @@ public class VideoListAdapter extends ArrayAdapter<Media>
holder
=
(
ViewHolder
)
v
.
getTag
();
Media
media
=
getItem
(
position
);
Util
.
setItemBackground
(
holder
.
layout
,
position
);
holder
.
title
.
setText
(
media
.
getTitle
());
holder
.
length
.
setText
(
" "
+
Util
.
millisToString
(
media
.
getLength
())
+
" "
);
...
...
@@ -163,6 +165,7 @@ public class VideoListAdapter extends ArrayAdapter<Media>
};
static
class
ViewHolder
{
View
layout
;
ImageView
thumbnail
;
TextView
length
;
TextView
title
;
...
...
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