mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-21 14:51:52 +01:00
Mark some state data classes as immutable
This commit is contained in:
parent
22e8050fff
commit
54733e6ceb
@ -16,6 +16,7 @@ import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.Immutable
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateListOf
|
||||
@ -313,6 +314,7 @@ internal class MigrateDialogScreenModel(
|
||||
)
|
||||
}
|
||||
|
||||
@Immutable
|
||||
data class State(
|
||||
val isMigrating: Boolean = false,
|
||||
)
|
||||
|
@ -20,6 +20,7 @@ import androidx.compose.material3.SelectableDates
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.Immutable
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
@ -265,6 +266,7 @@ data class TrackInfoDialogHomeScreen(
|
||||
.filter { (it.service as? EnhancedTrackService)?.accept(source) ?: true }
|
||||
}
|
||||
|
||||
@Immutable
|
||||
data class State(
|
||||
val trackItems: List<TrackItem> = emptyList(),
|
||||
)
|
||||
@ -314,6 +316,7 @@ private data class TrackStatusSelectorScreen(
|
||||
}
|
||||
}
|
||||
|
||||
@Immutable
|
||||
data class State(
|
||||
val selection: Int,
|
||||
)
|
||||
@ -369,6 +372,7 @@ private data class TrackChapterSelectorScreen(
|
||||
}
|
||||
}
|
||||
|
||||
@Immutable
|
||||
data class State(
|
||||
val selection: Int,
|
||||
)
|
||||
@ -419,6 +423,7 @@ private data class TrackScoreSelectorScreen(
|
||||
}
|
||||
}
|
||||
|
||||
@Immutable
|
||||
data class State(
|
||||
val selection: String,
|
||||
)
|
||||
@ -724,6 +729,7 @@ data class TrackServiceSearchScreen(
|
||||
mutableState.update { it.copy(selected = selected) }
|
||||
}
|
||||
|
||||
@Immutable
|
||||
data class State(
|
||||
val queryResult: Result<List<TrackSearch>>? = null,
|
||||
val selected: TrackSearch? = null,
|
||||
|
@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.ui.reader
|
||||
|
||||
import android.app.Application
|
||||
import android.net.Uri
|
||||
import androidx.compose.runtime.Immutable
|
||||
import androidx.lifecycle.SavedStateHandle
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
@ -790,16 +791,12 @@ class ReaderViewModel(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Results of the set as cover feature.
|
||||
*/
|
||||
enum class SetAsCoverResult {
|
||||
Success, AddToLibraryFirst, Error
|
||||
Success,
|
||||
AddToLibraryFirst,
|
||||
Error,
|
||||
}
|
||||
|
||||
/**
|
||||
* Results of the save image feature.
|
||||
*/
|
||||
sealed class SaveImageResult {
|
||||
class Success(val uri: Uri) : SaveImageResult()
|
||||
class Error(val error: Throwable) : SaveImageResult()
|
||||
@ -844,6 +841,7 @@ class ReaderViewModel(
|
||||
}
|
||||
}
|
||||
|
||||
@Immutable
|
||||
data class State(
|
||||
val manga: Manga? = null,
|
||||
val viewerChapters: ViewerChapters? = null,
|
||||
|
Loading…
Reference in New Issue
Block a user