mirror of
https://github.com/SimpleMobileTools/Simple-Voice-Recorder.git
synced 2025-06-05 21:59:31 +02:00
cleanup PlayerFragment
This commit is contained in:
@@ -167,20 +167,24 @@ class PlayerFragment(context: Context, attributeSet: AttributeSet) : MyViewPager
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun getRecordings(): ArrayList<Recording> {
|
private fun getRecordings(): ArrayList<Recording> {
|
||||||
|
val recordings = ArrayList<Recording>()
|
||||||
return when {
|
return when {
|
||||||
isRPlus() -> {
|
isRPlus() -> {
|
||||||
ArrayList(getMediaStoreRecordings() + getSAFRecordings()).apply {
|
recordings.addAll(getMediaStoreRecordings())
|
||||||
sortByDescending { it.timestamp }
|
recordings.addAll(getSAFRecordings())
|
||||||
}
|
recordings
|
||||||
}
|
}
|
||||||
isQPlus() -> {
|
isQPlus() -> {
|
||||||
ArrayList(getMediaStoreRecordings() + getLegacyRecordings()).apply {
|
recordings.addAll(getMediaStoreRecordings())
|
||||||
sortByDescending { it.timestamp }
|
recordings.addAll(getLegacyRecordings())
|
||||||
}
|
recordings
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
getLegacyRecordings()
|
recordings.addAll(getLegacyRecordings())
|
||||||
|
recordings
|
||||||
}
|
}
|
||||||
|
}.apply {
|
||||||
|
sortByDescending { it.timestamp }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user