Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
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
Marcus Radisch
VLC-Android
Commits
dfd00321
Commit
dfd00321
authored
2 weeks ago
by
Nicolas Pomepuy
Browse files
Options
Downloads
Patches
Plain Diff
Prevent a crash in the DuplicationWarningDialog
parent
61aa4149
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
application/vlc-android/src/org/videolan/vlc/gui/dialogs/DuplicationWarningDialog.kt
+7
-2
7 additions, 2 deletions
.../org/videolan/vlc/gui/dialogs/DuplicationWarningDialog.kt
with
7 additions
and
2 deletions
application/vlc-android/src/org/videolan/vlc/gui/dialogs/DuplicationWarningDialog.kt
+
7
−
2
View file @
dfd00321
...
...
@@ -7,6 +7,7 @@ import android.text.SpannableString
import
android.text.Spanned
import
android.text.style.ForegroundColorSpan
import
android.text.style.StyleSpan
import
android.util.Log
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
...
...
@@ -92,8 +93,12 @@ class DuplicationWarningDialog : VLCBottomSheetDialogFragment(), View.OnClickLis
val
styledText
=
SpannableString
.
valueOf
(
secondaryMessage
)
val
startIndex
=
styledText
.
indexOf
(
searchTitle
)
val
endIndex
=
startIndex
+
searchTitle
.
length
styledText
.
setSpan
(
StyleSpan
(
Typeface
.
BOLD
),
startIndex
,
endIndex
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
styledText
.
setSpan
(
ForegroundColorSpan
(
MaterialColors
.
getColor
(
requireContext
(),
R
.
attr
.
font_default
,
Color
.
BLACK
)),
startIndex
,
endIndex
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
try
{
styledText
.
setSpan
(
StyleSpan
(
Typeface
.
BOLD
),
startIndex
,
endIndex
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
styledText
.
setSpan
(
ForegroundColorSpan
(
MaterialColors
.
getColor
(
requireContext
(),
R
.
attr
.
font_default
,
Color
.
BLACK
)),
startIndex
,
endIndex
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
}
catch
(
e
:
Exception
)
{
Log
.
e
(
"DupWarningDialog"
,
"setupSecondaryText: $e"
)
}
finalMessage
=
SpannableString
.
valueOf
(
finalMessage
.
toString
()
+
styledText
.
toString
()+
"\n"
)
}
...
...
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