remove audio visualizer
This commit is contained in:
@@ -173,9 +173,6 @@ dependencies {
|
||||
implementation "io.agora.rtc:voice-sdk:4.2.6"
|
||||
implementation 'io.agora.rtm:rtm-sdk:1.5.3'
|
||||
|
||||
// sound visualizer
|
||||
implementation "com.gauravk.audiovisualizer:audiovisualizer:0.9.2"
|
||||
|
||||
// Glide
|
||||
implementation 'com.github.bumptech.glide:glide:5.0.5'
|
||||
annotationProcessor 'com.github.bumptech.glide:compiler:5.0.5'
|
||||
|
||||
@@ -109,7 +109,6 @@ class RecordingVoiceFragment : BottomSheetDialogFragment() {
|
||||
binding.ivRecordStart.visibility = View.VISIBLE
|
||||
binding.llRetryOrComplete.visibility = View.GONE
|
||||
binding.rlRecordPlay.visibility = View.GONE
|
||||
binding.soundVisualizer.visibility = View.GONE
|
||||
}
|
||||
|
||||
binding.tvRetryRecord.setOnClickListener {
|
||||
@@ -118,7 +117,6 @@ class RecordingVoiceFragment : BottomSheetDialogFragment() {
|
||||
binding.ivRecordStart.visibility = View.VISIBLE
|
||||
binding.llRetryOrComplete.visibility = View.GONE
|
||||
binding.rlRecordPlay.visibility = View.GONE
|
||||
binding.soundVisualizer.visibility = View.GONE
|
||||
}
|
||||
|
||||
binding.tvComplete.setOnClickListener {
|
||||
@@ -214,12 +212,9 @@ class RecordingVoiceFragment : BottomSheetDialogFragment() {
|
||||
binding.ivRecordPlay.visibility = View.VISIBLE
|
||||
binding.llRetryOrComplete.visibility = View.VISIBLE
|
||||
binding.ivRecordPause.visibility = View.GONE
|
||||
binding.soundVisualizer.visibility = View.GONE
|
||||
}
|
||||
|
||||
mediaPlayer!!.setOnPreparedListener {
|
||||
binding.soundVisualizer.visibility = View.VISIBLE
|
||||
binding.soundVisualizer.setAudioSessionId(mediaPlayer!!.audioSessionId)
|
||||
it.start()
|
||||
|
||||
startCountDownTimer()
|
||||
@@ -248,7 +243,6 @@ class RecordingVoiceFragment : BottomSheetDialogFragment() {
|
||||
binding.ivRecordPlay.visibility = View.VISIBLE
|
||||
binding.llRetryOrComplete.visibility = View.VISIBLE
|
||||
binding.ivRecordPause.visibility = View.GONE
|
||||
binding.soundVisualizer.visibility = View.GONE
|
||||
}
|
||||
|
||||
private fun releaseMediaPlayer() {
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -51,17 +51,6 @@
|
||||
android:textColor="@color/white"
|
||||
android:textSize="33.3sp" />
|
||||
|
||||
<com.gauravk.audiovisualizer.visualizer.WaveVisualizer
|
||||
android:id="@+id/sound_visualizer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginHorizontal="13.3dp"
|
||||
android:visibility="gone"
|
||||
app:avColor="@color/av_deep_orange"
|
||||
app:avDensity="0.8"
|
||||
app:avSpeed="normal"
|
||||
app:avType="fill" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_record_start"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -110,17 +110,6 @@
|
||||
android:textColor="@color/white"
|
||||
android:textSize="33.3sp" />
|
||||
|
||||
<com.gauravk.audiovisualizer.visualizer.WaveVisualizer
|
||||
android:id="@+id/sound_visualizer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginHorizontal="13.3dp"
|
||||
android:visibility="gone"
|
||||
app:avColor="@color/av_deep_orange"
|
||||
app:avDensity="0.8"
|
||||
app:avSpeed="normal"
|
||||
app:avType="fill" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_record_start"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
Reference in New Issue
Block a user