mirror of
https://github.com/SimpleMobileTools/Simple-Voice-Recorder.git
synced 2025-06-05 21:59:31 +02:00
show the current recording duration at the bottom
This commit is contained in:
@ -89,6 +89,7 @@ class MainActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun initVoiceRecorder() {
|
private fun initVoiceRecorder() {
|
||||||
|
updateRecordingDuration(0)
|
||||||
toggle_recording_button.setOnClickListener {
|
toggle_recording_button.setOnClickListener {
|
||||||
toggleRecording()
|
toggleRecording()
|
||||||
}
|
}
|
||||||
@ -105,6 +106,10 @@ class MainActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun updateRecordingDuration(seconds: Int) {
|
||||||
|
recording_duration.text = seconds.getFormattedDuration()
|
||||||
|
}
|
||||||
|
|
||||||
// mp4 output format with aac encoding should produce good enough mp3 files according to https://stackoverflow.com/a/33054794/1967672
|
// mp4 output format with aac encoding should produce good enough mp3 files according to https://stackoverflow.com/a/33054794/1967672
|
||||||
private fun startRecording() {
|
private fun startRecording() {
|
||||||
val baseFolder = if (isQPlus()) {
|
val baseFolder = if (isQPlus()) {
|
||||||
|
@ -1,9 +1,20 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/recorder_holder"
|
android:id="@+id/recorder_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/recording_duration"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_above="@+id/toggle_recording_button"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginBottom="@dimen/bigger_margin"
|
||||||
|
android:textSize="@dimen/extra_big_text_size"
|
||||||
|
tools:text="00:00" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/toggle_recording_button"
|
android:id="@+id/toggle_recording_button"
|
||||||
android:layout_width="@dimen/toggle_recording_button_size"
|
android:layout_width="@dimen/toggle_recording_button_size"
|
||||||
|
Reference in New Issue
Block a user