remove audio visualizer
This commit is contained in:
@@ -37,6 +37,7 @@ import kr.co.vividnext.sodalive.message.SelectMessageRecipientActivity
|
||||
import org.koin.android.ext.android.inject
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
import java.util.Locale
|
||||
|
||||
class VoiceMessageWriteFragment(
|
||||
private val onSendSuccess: () -> Unit,
|
||||
@@ -219,7 +220,6 @@ class VoiceMessageWriteFragment(
|
||||
binding.ivRecordStart.visibility = View.VISIBLE
|
||||
binding.llRetryOrSend.visibility = View.GONE
|
||||
binding.rlRecordPlay.visibility = View.GONE
|
||||
binding.soundVisualizer.visibility = View.GONE
|
||||
}
|
||||
|
||||
binding.tvRetryRecord.setOnClickListener {
|
||||
@@ -234,7 +234,6 @@ class VoiceMessageWriteFragment(
|
||||
binding.ivRecordStart.visibility = View.VISIBLE
|
||||
binding.llRetryOrSend.visibility = View.GONE
|
||||
binding.rlRecordPlay.visibility = View.GONE
|
||||
binding.soundVisualizer.visibility = View.GONE
|
||||
}
|
||||
|
||||
binding.tvSendMessage.setOnClickListener {
|
||||
@@ -301,7 +300,7 @@ class VoiceMessageWriteFragment(
|
||||
|
||||
try {
|
||||
mediaRecorder!!.prepare()
|
||||
} catch (e: Exception) {
|
||||
} catch (_: Exception) {
|
||||
Toast.makeText(requireActivity(), R.string.retry, Toast.LENGTH_LONG).show()
|
||||
return
|
||||
}
|
||||
@@ -345,14 +344,11 @@ class VoiceMessageWriteFragment(
|
||||
binding.ivRecordPlay.visibility = View.VISIBLE
|
||||
binding.llRetryOrSend.visibility = View.VISIBLE
|
||||
binding.ivRecordPause.visibility = View.GONE
|
||||
binding.soundVisualizer.visibility = View.GONE
|
||||
|
||||
stopCountDownTimer()
|
||||
}
|
||||
|
||||
mediaPlayer!!.setOnPreparedListener {
|
||||
binding.soundVisualizer.visibility = View.VISIBLE
|
||||
binding.soundVisualizer.setAudioSessionId(mediaPlayer!!.audioSessionId)
|
||||
it.start()
|
||||
|
||||
startCountDownTimer()
|
||||
@@ -361,7 +357,7 @@ class VoiceMessageWriteFragment(
|
||||
try {
|
||||
mediaPlayer!!.setDataSource(fileNameMedia)
|
||||
mediaPlayer!!.prepare()
|
||||
} catch (e: Exception) {
|
||||
} catch (_: Exception) {
|
||||
Toast.makeText(requireActivity(), R.string.retry, Toast.LENGTH_LONG).show()
|
||||
return
|
||||
}
|
||||
@@ -383,7 +379,6 @@ class VoiceMessageWriteFragment(
|
||||
binding.ivRecordPlay.visibility = View.VISIBLE
|
||||
binding.llRetryOrSend.visibility = View.VISIBLE
|
||||
binding.ivRecordPause.visibility = View.GONE
|
||||
binding.soundVisualizer.visibility = View.GONE
|
||||
|
||||
stopCountDownTimer()
|
||||
}
|
||||
@@ -413,7 +408,13 @@ class VoiceMessageWriteFragment(
|
||||
minute = 0
|
||||
}
|
||||
|
||||
return String.format("%02d:%02d:%02d", hour, minute, second)
|
||||
return String.format(
|
||||
Locale.getDefault(),
|
||||
"%02d:%02d:%02d",
|
||||
hour,
|
||||
minute,
|
||||
second
|
||||
)
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
|
||||
Reference in New Issue
Block a user