mirror of
https://github.com/Myzel394/Alibi.git
synced 2025-06-18 23:05:26 +02:00
refactor: Improve recorder models
This commit is contained in:
parent
06f2e1de5e
commit
ab108305ef
@ -14,7 +14,7 @@ import app.myzel394.alibi.services.AudioRecorderService
|
|||||||
import app.myzel394.alibi.ui.utils.MicrophoneInfo
|
import app.myzel394.alibi.ui.utils.MicrophoneInfo
|
||||||
|
|
||||||
class AudioRecorderModel :
|
class AudioRecorderModel :
|
||||||
BaseRecorderModel<RecordingInformation, AudioRecorderService, AudioBatchesFolder?>() {
|
BaseRecorderModel<RecordingInformation, AudioBatchesFolder, AudioRecorderService>() {
|
||||||
override var batchesFolder: AudioBatchesFolder? = null
|
override var batchesFolder: AudioBatchesFolder? = null
|
||||||
override val intentClass = AudioRecorderService::class.java
|
override val intentClass = AudioRecorderService::class.java
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ import app.myzel394.alibi.services.RecorderNotificationHelper
|
|||||||
import app.myzel394.alibi.services.RecorderService
|
import app.myzel394.alibi.services.RecorderService
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
|
|
||||||
abstract class BaseRecorderModel<I, T : IntervalRecorderService<I>, B : BatchesFolder?> :
|
abstract class BaseRecorderModel<I, B : BatchesFolder, T : IntervalRecorderService<I, B>> :
|
||||||
ViewModel() {
|
ViewModel() {
|
||||||
protected abstract val intentClass: Class<T>
|
protected abstract val intentClass: Class<T>
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ abstract class BaseRecorderModel<I, T : IntervalRecorderService<I>, B : BatchesF
|
|||||||
// thus the service is not running and thus doesn't need to be stopped or destroyed
|
// thus the service is not running and thus doesn't need to be stopped or destroyed
|
||||||
var onRecordingSave: (isSavingAsOldRecording: Boolean) -> Unit = {}
|
var onRecordingSave: (isSavingAsOldRecording: Boolean) -> Unit = {}
|
||||||
var onError: () -> Unit = {}
|
var onError: () -> Unit = {}
|
||||||
abstract var batchesFolder: B
|
abstract var batchesFolder: B?
|
||||||
|
|
||||||
private var notificationDetails: RecorderNotificationHelper.NotificationDetails? = null
|
private var notificationDetails: RecorderNotificationHelper.NotificationDetails? = null
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user