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
16
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
c2b41e5c
Commit
c2b41e5c
authored
4 years ago
by
Nicolas Pomepuy
Browse files
Options
Downloads
Patches
Plain Diff
Show the band value in the equalizer
Fixes
#1238
parent
5421e6d2
No related branches found
No related tags found
Loading
Pipeline
#15218
failed with stage
in 21 minutes and 46 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
application/vlc-android/res/layout/equalizer_bar.xml
+10
-0
10 additions, 0 deletions
application/vlc-android/res/layout/equalizer_bar.xml
application/vlc-android/src/org/videolan/vlc/gui/view/EqualizerBar.kt
+13
-2
13 additions, 2 deletions
...vlc-android/src/org/videolan/vlc/gui/view/EqualizerBar.kt
with
23 additions
and
2 deletions
application/vlc-android/res/layout/equalizer_bar.xml
+
10
−
0
View file @
c2b41e5c
...
...
@@ -48,5 +48,15 @@
android:textSize=
"10sp"
tools:ignore=
"HardcodedText"
/>
<TextView
android:id=
"@+id/band_value"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:fontFamily=
"sans-serif-medium"
android:textColor=
"?attr/font_audio_light"
android:gravity=
"center"
android:textSize=
"10sp"
/>
</LinearLayout>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
application/vlc-android/src/org/videolan/vlc/gui/view/EqualizerBar.kt
+
13
−
2
View file @
c2b41e5c
...
...
@@ -36,8 +36,9 @@ import org.videolan.vlc.interfaces.OnEqualizerBarChangeListener
class
EqualizerBar
:
LinearLayout
{
private
lateinit
var
bandValueTextView
:
TextView
private
lateinit
var
verticalSeekBar
:
VerticalSeekBar
private
var
bandTextView
:
TextView
?
=
null
private
lateinit
var
bandTextView
:
TextView
private
var
listener
:
OnEqualizerBarChangeListener
?
=
null
override
fun
setNextFocusLeftId
(
nextFocusLeftId
:
Int
)
{
...
...
@@ -63,6 +64,7 @@ class EqualizerBar : LinearLayout {
// fromUser will always be false
// So use custom getFromUser() instead of fromUser
listener
?.
onProgressChanged
(
value
,
isFromUser
())
updateValueText
()
}
}
...
...
@@ -88,14 +90,22 @@ class EqualizerBar : LinearLayout {
verticalSeekBar
.
progress
=
RANGE
verticalSeekBar
.
setOnSeekBarChangeListener
(
seekListener
)
bandTextView
=
findViewById
(
R
.
id
.
equalizer_band
)
bandTextView
!!
.
text
=
if
(
band
<
999.5f
)
bandValueTextView
=
findViewById
(
R
.
id
.
band_value
)
bandTextView
.
text
=
if
(
band
<
999.5f
)
(
band
+
0.5f
).
toInt
().
toString
()
+
"Hz"
else
(
band
/
1000.0f
+
0.5f
).
toInt
().
toString
()
+
"kHz"
updateValueText
()
}
private
fun
updateValueText
()
{
val
newValue
=
(
verticalSeekBar
.
progress
/
10
)
-
20
bandValueTextView
.
text
=
if
(
newValue
>
0
)
"+${newValue}dB"
else
"${newValue}dB"
}
fun
setValue
(
value
:
Float
)
{
verticalSeekBar
.
progress
=
(
value
*
PRECISION
+
RANGE
).
toInt
()
updateValueText
()
}
fun
setListener
(
listener
:
OnEqualizerBarChangeListener
?)
{
...
...
@@ -104,6 +114,7 @@ class EqualizerBar : LinearLayout {
fun
setProgress
(
fl
:
Int
)
{
verticalSeekBar
.
progress
=
fl
updateValueText
()
}
fun
getProgress
():
Int
=
verticalSeekBar
.
progress
...
...
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