mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 03:29:28 +01:00
bump detekt score
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
2b71d30637
commit
2cf5952fae
@ -116,7 +116,7 @@ class IncomingVoiceMessageViewHolder(incomingView: View) : MessageHolders
|
||||
override fun onStartTrackingTouch(seekBar: SeekBar) {}
|
||||
override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
|
||||
if (mediaPlayer != null && fromUser) {
|
||||
mediaPlayer!!.seekTo(progress * 1000)
|
||||
mediaPlayer!!.seekTo(progress * SEEKBAR_BASE)
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -269,10 +269,10 @@ class IncomingVoiceMessageViewHolder(incomingView: View) : MessageHolders
|
||||
activity.runOnUiThread(object : Runnable {
|
||||
override fun run() {
|
||||
if (mediaPlayer != null) {
|
||||
val currentPosition: Int = mediaPlayer!!.currentPosition / 1000
|
||||
val currentPosition: Int = mediaPlayer!!.currentPosition / SEEKBAR_BASE
|
||||
binding.seekbar.progress = currentPosition
|
||||
}
|
||||
handler.postDelayed(this, 1000)
|
||||
handler.postDelayed(this, SECOND)
|
||||
}
|
||||
})
|
||||
|
||||
@ -301,12 +301,12 @@ class IncomingVoiceMessageViewHolder(incomingView: View) : MessageHolders
|
||||
}
|
||||
}
|
||||
|
||||
binding.seekbar.max = mediaPlayer!!.duration / 1000
|
||||
binding.seekbar.max = mediaPlayer!!.duration / SEEKBAR_BASE
|
||||
|
||||
mediaPlayer!!.setOnCompletionListener {
|
||||
binding.playBtn.visibility = View.VISIBLE
|
||||
binding.pauseBtn.visibility = View.GONE
|
||||
binding.seekbar.progress = 0
|
||||
binding.seekbar.progress = SEEKBAR_START
|
||||
handler.removeCallbacksAndMessages(null)
|
||||
mediaPlayer?.stop()
|
||||
mediaPlayer?.release()
|
||||
@ -392,5 +392,8 @@ class IncomingVoiceMessageViewHolder(incomingView: View) : MessageHolders
|
||||
|
||||
companion object {
|
||||
private const val TAG = "VoiceInMessageView"
|
||||
private const val SECOND: Long = 1000
|
||||
private const val SEEKBAR_BASE: Int = 1000
|
||||
private const val SEEKBAR_START: Int = 0
|
||||
}
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ class OutcomingVoiceMessageViewHolder(incomingView: View) : MessageHolders
|
||||
override fun onStartTrackingTouch(seekBar: SeekBar) {}
|
||||
override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
|
||||
if (mediaPlayer != null && fromUser) {
|
||||
mediaPlayer!!.seekTo(progress * 1000)
|
||||
mediaPlayer!!.seekTo(progress * SEEKBAR_BASE)
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -245,10 +245,10 @@ class OutcomingVoiceMessageViewHolder(incomingView: View) : MessageHolders
|
||||
activity.runOnUiThread(object : Runnable {
|
||||
override fun run() {
|
||||
if (mediaPlayer != null) {
|
||||
val currentPosition: Int = mediaPlayer!!.currentPosition / 1000
|
||||
val currentPosition: Int = mediaPlayer!!.currentPosition / SEEKBAR_BASE
|
||||
binding.seekbar.progress = currentPosition
|
||||
}
|
||||
handler.postDelayed(this, 1000)
|
||||
handler.postDelayed(this, SECOND)
|
||||
}
|
||||
})
|
||||
|
||||
@ -277,12 +277,12 @@ class OutcomingVoiceMessageViewHolder(incomingView: View) : MessageHolders
|
||||
}
|
||||
}
|
||||
|
||||
binding.seekbar.max = mediaPlayer!!.duration / 1000
|
||||
binding.seekbar.max = mediaPlayer!!.duration / SEEKBAR_BASE
|
||||
|
||||
mediaPlayer!!.setOnCompletionListener {
|
||||
binding.playBtn.visibility = View.VISIBLE
|
||||
binding.pauseBtn.visibility = View.GONE
|
||||
binding.seekbar.progress = 0
|
||||
binding.seekbar.progress = SEEKBAR_START
|
||||
handler.removeCallbacksAndMessages(null)
|
||||
mediaPlayer?.stop()
|
||||
mediaPlayer?.release()
|
||||
@ -368,5 +368,8 @@ class OutcomingVoiceMessageViewHolder(incomingView: View) : MessageHolders
|
||||
|
||||
companion object {
|
||||
private const val TAG = "VoiceOutMessageView"
|
||||
private const val SECOND: Long = 1000
|
||||
private const val SEEKBAR_BASE: Int = 1000
|
||||
private const val SEEKBAR_START: Int = 0
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
build:
|
||||
maxIssues: 202
|
||||
maxIssues: 223
|
||||
weights:
|
||||
# complexity: 2
|
||||
# LongParameterList: 1
|
||||
|
Loading…
Reference in New Issue
Block a user