Skip to content

Commit 24fb03a

Browse files
committed
Specify some types for MutableLiveData to pass the lint
1 parent 41ca4ef commit 24fb03a

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

presentation/src/main/java/xyz/aprildown/timer/presentation/timer/RecordViewModel.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,13 @@ class RecordViewModel @Inject constructor(
6262
getRecords.calculateTimeline(it)
6363
}
6464

65-
private val _minDateMilli = MutableLiveData<Long>()
65+
private val _minDateMilli: MutableLiveData<Long> = MutableLiveData()
6666
val minDateMilli: LiveData<Long> = _minDateMilli
6767

6868
init {
6969
launch {
70-
_minDateMilli.value = getRecords.getMinDateMilli()
70+
val minDateMilli: Long = getRecords.getMinDateMilli()
71+
_minDateMilli.value = minDateMilli
7172

7273
val all = mutableListOf<TimerInfo>()
7374
val sortBy = folderSortByRule.get()

presentation/src/main/java/xyz/aprildown/timer/presentation/timer/TimerViewModel.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class TimerViewModel @Inject constructor(
7979
folders.find { it.id == id }
8080
}.asLiveData()
8181

82-
private val currentSortBy = MutableLiveData<FolderSortBy>()
82+
private val currentSortBy: MutableLiveData<FolderSortBy> = MutableLiveData()
8383

8484
val timerInfo: LiveData<List<TimerInfo>> =
8585
currentFolderId.asFlow().combine(currentSortBy.asFlow()) { id, by ->
@@ -106,12 +106,14 @@ class TimerViewModel @Inject constructor(
106106
} else {
107107
FolderEntity.FOLDER_DEFAULT
108108
}
109-
currentSortBy.value = folderSortByRule.get()
109+
val folderSortBy: FolderSortBy = folderSortByRule.get()
110+
currentSortBy.value = folderSortBy
110111
}
111112
}
112113

113114
private suspend fun refreshFolders() {
114-
_allFolders.value = getFolders.invoke()
115+
val folders: List<FolderEntity> = getFolders()
116+
_allFolders.value = folders
115117
}
116118

117119
fun changeFolder(folderId: Long) {

0 commit comments

Comments
 (0)