Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
534
Issue boards
Milestones
Wiki
Code
Merge requests
11
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
c6a92dfe
Commit
c6a92dfe
authored
6 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
TV background: prevent NPE
parent
4ccc6064
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.kt
+10
-8
10 additions, 8 deletions
vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.kt
with
10 additions
and
8 deletions
vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.kt
+
10
−
8
View file @
c6a92dfe
...
...
@@ -28,15 +28,14 @@ import android.graphics.Bitmap
import
android.graphics.drawable.BitmapDrawable
import
android.net.Uri
import
android.os.Build
import
android.text.TextUtils
import
android.view.View
import
androidx.annotation.RequiresApi
import
androidx.core.content.ContextCompat
import
androidx.leanback.app.BackgroundManager
import
androidx.leanback.widget.DiffCallback
import
androidx.leanback.widget.ListRow
import
androidx.leanback.widget.Row
import
androidx.fragment.app.FragmentActivity
import
androidx.core.content.ContextCompat
import
android.text.TextUtils
import
android.view.View
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.launch
import
kotlinx.coroutines.withContext
...
...
@@ -46,7 +45,6 @@ import org.videolan.medialibrary.media.MediaWrapper
import
org.videolan.vlc.R
import
org.videolan.vlc.VLCApplication
import
org.videolan.vlc.gui.DialogActivity
import
org.videolan.vlc.gui.dialogs.NetworkServerDialog
import
org.videolan.vlc.gui.helpers.AudioUtil
import
org.videolan.vlc.gui.helpers.BitmapUtil
import
org.videolan.vlc.gui.helpers.UiTools
...
...
@@ -199,14 +197,18 @@ object TvUtil {
cover
=
BitmapUtil
.
centerCrop
(
cover
,
cover
!!
.
width
,
cover
.
width
*
10
/
16
)
UiTools
.
blurBitmap
(
cover
,
10f
)
}
bm
.
color
=
0
bm
.
drawable
=
BitmapDrawable
(
VLCApplication
.
getAppResources
(),
blurred
)
@Suppress
(
"SENSELESS_COMPARISON"
)
if
(
bm
!==
null
)
{
bm
.
color
=
0
bm
.
drawable
=
BitmapDrawable
(
VLCApplication
.
getAppResources
(),
blurred
)
}
}
}
clearBackground
(
bm
)
}
private
fun
clearBackground
(
bm
:
BackgroundManager
)
{
private
fun
clearBackground
(
bm
:
BackgroundManager
?)
{
if
(
bm
===
null
)
return
bm
.
color
=
ContextCompat
.
getColor
(
VLCApplication
.
getAppContext
(),
R
.
color
.
tv_bg
)
bm
.
drawable
=
null
}
...
...
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