mirror of
https://github.com/SimpleMobileTools/Simple-Voice-Recorder.git
synced 2025-06-05 21:59:31 +02:00
update the recordings in case the save folder changes
This commit is contained in:
@ -38,9 +38,14 @@ class PlayerFragment(context: Context, attributeSet: AttributeSet) : MyViewPager
|
|||||||
private var progressTimer = Timer()
|
private var progressTimer = Timer()
|
||||||
private var playedRecordingIDs = Stack<Int>()
|
private var playedRecordingIDs = Stack<Int>()
|
||||||
private var bus: EventBus? = null
|
private var bus: EventBus? = null
|
||||||
|
private var prevSavePath = ""
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
setupColors()
|
setupColors()
|
||||||
|
if (!prevSavePath.isEmpty() && context!!.config.saveRecordingsFolder != prevSavePath) {
|
||||||
|
setupAdapter()
|
||||||
|
}
|
||||||
|
storePrevPath()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
@ -61,6 +66,7 @@ class PlayerFragment(context: Context, attributeSet: AttributeSet) : MyViewPager
|
|||||||
setupAdapter()
|
setupAdapter()
|
||||||
initMediaPlayer()
|
initMediaPlayer()
|
||||||
setupViews()
|
setupViews()
|
||||||
|
storePrevPath()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupViews() {
|
private fun setupViews() {
|
||||||
@ -361,6 +367,10 @@ class PlayerFragment(context: Context, attributeSet: AttributeSet) : MyViewPager
|
|||||||
|
|
||||||
private fun getRecordingsAdapter() = recordings_list.adapter as? RecordingsAdapter
|
private fun getRecordingsAdapter() = recordings_list.adapter as? RecordingsAdapter
|
||||||
|
|
||||||
|
private fun storePrevPath() {
|
||||||
|
prevSavePath = context!!.config.saveRecordingsFolder
|
||||||
|
}
|
||||||
|
|
||||||
private fun setupColors() {
|
private fun setupColors() {
|
||||||
recordings_fastscroller.updatePrimaryColor()
|
recordings_fastscroller.updatePrimaryColor()
|
||||||
recordings_fastscroller.updateBubbleColors()
|
recordings_fastscroller.updateBubbleColors()
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<string name="recording_saved_successfully">Nahrávka bola uložená ako \n\"%s\"</string>
|
<string name="recording_saved_successfully">Nahrávka bola uložená ako \n\"%s\"</string>
|
||||||
<string name="recording">Nahráva sa</string>
|
<string name="recording">Nahráva sa</string>
|
||||||
<string name="no_recordings_found">Nenašli sa žiadne nahrávky\nvytvorené touto aplikáciou</string>
|
<string name="no_recordings_found">Nenašli sa žiadne nahrávky\nvytvorené touto aplikáciou</string>
|
||||||
<string name="no_recordings_in_folder_found">V zvolenom priečinku sa nenašli\nžiadne nahrávky</string>
|
<string name="no_recordings_in_folder_found">Vo zvolenom priečinku sa nenašli\nžiadne nahrávky</string>
|
||||||
|
|
||||||
<!-- Confirmation dialog -->
|
<!-- Confirmation dialog -->
|
||||||
<string name="delete_recordings_confirmation">Ste si istý, že chcete odstrániť %s?</string> <!-- Are you sure you want to delete 5 recordings? -->
|
<string name="delete_recordings_confirmation">Ste si istý, že chcete odstrániť %s?</string> <!-- Are you sure you want to delete 5 recordings? -->
|
||||||
|
Reference in New Issue
Block a user