Skip to content

Commit

Permalink
Specify some types for MutableLiveData to pass the lint
Browse files Browse the repository at this point in the history
  • Loading branch information
DeweyReed committed Mar 22, 2024
1 parent 41ca4ef commit 24fb03a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@ class RecordViewModel @Inject constructor(
getRecords.calculateTimeline(it)
}

private val _minDateMilli = MutableLiveData<Long>()
private val _minDateMilli: MutableLiveData<Long> = MutableLiveData()
val minDateMilli: LiveData<Long> = _minDateMilli

init {
launch {
_minDateMilli.value = getRecords.getMinDateMilli()
val minDateMilli: Long = getRecords.getMinDateMilli()
_minDateMilli.value = minDateMilli

val all = mutableListOf<TimerInfo>()
val sortBy = folderSortByRule.get()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class TimerViewModel @Inject constructor(
folders.find { it.id == id }
}.asLiveData()

private val currentSortBy = MutableLiveData<FolderSortBy>()
private val currentSortBy: MutableLiveData<FolderSortBy> = MutableLiveData()

val timerInfo: LiveData<List<TimerInfo>> =
currentFolderId.asFlow().combine(currentSortBy.asFlow()) { id, by ->
Expand All @@ -106,12 +106,14 @@ class TimerViewModel @Inject constructor(
} else {
FolderEntity.FOLDER_DEFAULT
}
currentSortBy.value = folderSortByRule.get()
val folderSortBy: FolderSortBy = folderSortByRule.get()
currentSortBy.value = folderSortBy
}
}

private suspend fun refreshFolders() {
_allFolders.value = getFolders.invoke()
val folders: List<FolderEntity> = getFolders()
_allFolders.value = folders
}

fun changeFolder(folderId: Long) {
Expand Down

0 comments on commit 24fb03a

Please sign in to comment.