[1.0.0]
[m1] [声音的部分调整]
This commit is contained in:
@@ -362,9 +362,13 @@ class BusPassengerFunctionSoftFragment :
|
||||
tv_current_voice_value.text = "$progress%"
|
||||
if (fromUser) {
|
||||
mMaxVolume?.let {
|
||||
var currnetValue = ((progress.toFloat() / 100) * it).toInt()
|
||||
if(currnetValue <=0){
|
||||
currnetValue = 1;
|
||||
}
|
||||
mAudioManager?.setStreamVolume(
|
||||
AudioManager.STREAM_MUSIC,
|
||||
((progress.toFloat() / 100) * it).toInt(),
|
||||
currnetValue,
|
||||
AudioManager.FLAG_SHOW_UI
|
||||
)
|
||||
}
|
||||
@@ -389,8 +393,14 @@ class BusPassengerFunctionSoftFragment :
|
||||
val mCurrentVolume = mAudioManager?.getStreamVolume(AudioManager.STREAM_MUSIC)
|
||||
mMaxVolume?.let { max ->
|
||||
mCurrentVolume?.let { current ->
|
||||
val fl = current.toFloat() / max * 100
|
||||
sb_voice_bar.progress = fl.toInt()
|
||||
if(current==1){
|
||||
sb_voice_bar.progress = 5
|
||||
tv_current_voice_value.text= "5%"
|
||||
}else {
|
||||
val fl = current.toFloat() / max * 100
|
||||
sb_voice_bar.progress = fl.toInt()
|
||||
tv_current_voice_value.text= "${fl.toInt()}%"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user