Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
531
Issue boards
Milestones
Wiki
Code
Merge requests
13
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC-Android
Commits
bff8188e
Commit
bff8188e
authored
8 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
Util method to get default cover drawables
parent
12b00509
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
vlc-android/src/org/videolan/vlc/gui/helpers/AsyncImageLoader.java
+3
-1
3 additions, 1 deletion
...id/src/org/videolan/vlc/gui/helpers/AsyncImageLoader.java
vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.java
+16
-2
16 additions, 2 deletions
vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.java
with
19 additions
and
3 deletions
vlc-android/src/org/videolan/vlc/gui/helpers/AsyncImageLoader.java
+
3
−
1
View file @
bff8188e
...
...
@@ -59,8 +59,10 @@ public class AsyncImageLoader {
public
static
final
Bitmap
DEFAULT_COVER_VIDEO
=
BitmapCache
.
getFromResource
(
VLCApplication
.
getAppResources
(),
R
.
drawable
.
ic_no_thumbnail_1610
);
public
static
final
BitmapDrawable
DEFAULT_COVER_VIDEO_DRAWABLE
=
new
BitmapDrawable
(
VLCApplication
.
getAppResources
(),
DEFAULT_COVER_VIDEO
);
public
static
final
Bitmap
DEFAULT_COVER_AUDIO
=
BitmapCache
.
getFromResource
(
VLCApplication
.
getAppResources
(),
R
.
drawable
.
icon
);
public
static
final
Bitmap
DEFAULT_COVER_AUDIO
=
BitmapCache
.
getFromResource
(
VLCApplication
.
getAppResources
(),
R
.
drawable
.
ic
_no_s
on
g
);
public
static
final
BitmapDrawable
DEFAULT_COVER_AUDIO_DRAWABLE
=
new
BitmapDrawable
(
VLCApplication
.
getAppResources
(),
DEFAULT_COVER_AUDIO
);
public
static
final
BitmapDrawable
DEFAULT_COVER_ARTIST_DRAWABLE
=
new
BitmapDrawable
(
VLCApplication
.
getAppResources
(),
BitmapCache
.
getFromResource
(
VLCApplication
.
getAppResources
(),
R
.
drawable
.
ic_no_artist
));
public
static
final
BitmapDrawable
DEFAULT_COVER_ALBUM_DRAWABLE
=
new
BitmapDrawable
(
VLCApplication
.
getAppResources
(),
BitmapCache
.
getFromResource
(
VLCApplication
.
getAppResources
(),
R
.
drawable
.
ic_no_album
));
/*
* Custom bindings to trigger image (down)loading
...
...
This diff is collapsed.
Click to expand it.
vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.java
+
16
−
2
View file @
bff8188e
...
...
@@ -28,6 +28,7 @@ import android.content.Context;
import
android.content.SharedPreferences
;
import
android.content.res.TypedArray
;
import
android.databinding.BindingAdapter
;
import
android.graphics.drawable.BitmapDrawable
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Looper
;
...
...
@@ -36,9 +37,7 @@ import android.support.annotation.NonNull;
import
android.support.annotation.Nullable
;
import
android.support.design.widget.Snackbar
;
import
android.support.v4.app.FragmentActivity
;
import
android.support.v4.app.FragmentManager
;
import
android.support.v4.content.ContextCompat
;
import
android.support.v7.app.AppCompatActivity
;
import
android.text.Html
;
import
android.text.TextUtils
;
import
android.util.DisplayMetrics
;
...
...
@@ -52,6 +51,7 @@ import android.view.inputmethod.InputMethodManager;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
org.videolan.medialibrary.media.MediaLibraryItem
;
import
org.videolan.medialibrary.media.MediaWrapper
;
import
org.videolan.vlc.BuildConfig
;
import
org.videolan.vlc.R
;
...
...
@@ -249,4 +249,18 @@ public class UiTools {
if
(
Looper
.
getMainLooper
()
!=
Looper
.
myLooper
())
throw
new
IllegalThreadStateException
();
}
public
static
BitmapDrawable
getDefaultCover
(
MediaLibraryItem
item
)
{
switch
(
item
.
getItemType
())
{
case
MediaLibraryItem
.
TYPE_ARTIST
:
return
AsyncImageLoader
.
DEFAULT_COVER_ARTIST_DRAWABLE
;
case
MediaLibraryItem
.
TYPE_ALBUM
:
return
AsyncImageLoader
.
DEFAULT_COVER_ALBUM_DRAWABLE
;
case
MediaLibraryItem
.
TYPE_MEDIA
:
if
(((
MediaWrapper
)
item
).
getType
()
==
MediaWrapper
.
TYPE_VIDEO
)
return
AsyncImageLoader
.
DEFAULT_COVER_VIDEO_DRAWABLE
;
default
:
return
AsyncImageLoader
.
DEFAULT_COVER_AUDIO_DRAWABLE
;
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment