mirror of
https://github.com/Suwayomi/TachideskJUI.git
synced 2025-12-22 12:32:31 +01:00
Fix formatting in a few more files
This commit is contained in:
@@ -11,12 +11,11 @@ import ca.gosyer.jui.domain.migration.service.MigrationPreferences
|
||||
import ca.gosyer.jui.uicore.vm.ContextWrapper
|
||||
import me.tatarka.inject.annotations.Inject
|
||||
|
||||
class AppMigrations
|
||||
@Inject
|
||||
constructor(
|
||||
@Inject
|
||||
class AppMigrations(
|
||||
private val migrationPreferences: MigrationPreferences,
|
||||
private val contextWrapper: ContextWrapper,
|
||||
) {
|
||||
) {
|
||||
fun runMigrations(): Boolean {
|
||||
val oldVersion = migrationPreferences.appVersion().get()
|
||||
if (oldVersion < BuildConfig.VERSION_CODE) {
|
||||
@@ -32,4 +31,4 @@ class AppMigrations
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,11 +10,10 @@ import android.content.Context
|
||||
import com.russhwolf.settings.SharedPreferencesSettings
|
||||
import me.tatarka.inject.annotations.Inject
|
||||
|
||||
actual class PreferenceStoreFactory
|
||||
@Inject
|
||||
constructor(
|
||||
@Inject
|
||||
actual class PreferenceStoreFactory(
|
||||
private val context: Context,
|
||||
) {
|
||||
) {
|
||||
actual fun create(vararg names: String): PreferenceStore =
|
||||
StandardPreferenceStore(
|
||||
SharedPreferencesSettings(
|
||||
@@ -24,4 +23,4 @@ actual class PreferenceStoreFactory
|
||||
),
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,9 +10,8 @@ import com.russhwolf.settings.PreferencesSettings
|
||||
import me.tatarka.inject.annotations.Inject
|
||||
import java.util.prefs.Preferences
|
||||
|
||||
actual class PreferenceStoreFactory
|
||||
@Inject
|
||||
constructor() {
|
||||
@Inject
|
||||
actual class PreferenceStoreFactory() {
|
||||
private val rootNode: Preferences = Preferences.userRoot()
|
||||
.node("ca/gosyer/tachideskjui")
|
||||
|
||||
@@ -22,4 +21,4 @@ actual class PreferenceStoreFactory
|
||||
rootNode.node(names.joinToString(separator = "/")),
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,13 +10,12 @@ import com.russhwolf.settings.NSUserDefaultsSettings
|
||||
import me.tatarka.inject.annotations.Inject
|
||||
import platform.Foundation.NSUserDefaults
|
||||
|
||||
actual class PreferenceStoreFactory
|
||||
@Inject
|
||||
constructor() {
|
||||
@Inject
|
||||
actual class PreferenceStoreFactory() {
|
||||
actual fun create(vararg names: String): PreferenceStore =
|
||||
StandardPreferenceStore(
|
||||
NSUserDefaultsSettings(
|
||||
NSUserDefaults.standardUserDefaults,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,8 @@ import ca.gosyer.jui.core.lang.toPlatform
|
||||
import kotlinx.datetime.Instant
|
||||
import me.tatarka.inject.annotations.Inject
|
||||
|
||||
actual class DateHandler
|
||||
@Inject
|
||||
constructor() {
|
||||
@Inject
|
||||
actual class DateHandler() {
|
||||
actual val formatOptions by lazy {
|
||||
listOf(
|
||||
"",
|
||||
@@ -49,4 +48,4 @@ actual class DateHandler
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,9 +9,8 @@ import java.time.ZoneId
|
||||
import java.time.format.DateTimeFormatter
|
||||
import java.time.format.FormatStyle
|
||||
|
||||
actual class DateHandler
|
||||
@Inject
|
||||
constructor() {
|
||||
@Inject
|
||||
actual class DateHandler() {
|
||||
actual val formatOptions by lazy {
|
||||
listOf(
|
||||
"",
|
||||
@@ -45,4 +44,4 @@ actual class DateHandler
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,12 +15,11 @@ import okio.FileSystem
|
||||
import okio.Path.Companion.toPath
|
||||
import org.lighthousegames.logging.logging
|
||||
|
||||
class AppMigrations
|
||||
@Inject
|
||||
constructor(
|
||||
@Inject
|
||||
class AppMigrations(
|
||||
private val migrationPreferences: MigrationPreferences,
|
||||
private val contextWrapper: ContextWrapper,
|
||||
) {
|
||||
) {
|
||||
@Suppress("KotlinConstantConditions")
|
||||
fun runMigrations(): Boolean {
|
||||
val oldVersion = migrationPreferences.appVersion().get()
|
||||
@@ -58,4 +57,4 @@ class AppMigrations
|
||||
companion object {
|
||||
private val log = logging()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,12 +11,11 @@ import ca.gosyer.jui.ios.build.BuildKonfig
|
||||
import ca.gosyer.jui.uicore.vm.ContextWrapper
|
||||
import me.tatarka.inject.annotations.Inject
|
||||
|
||||
class AppMigrations
|
||||
@Inject
|
||||
constructor(
|
||||
@Inject
|
||||
class AppMigrations(
|
||||
private val migrationPreferences: MigrationPreferences,
|
||||
private val contextWrapper: ContextWrapper,
|
||||
) {
|
||||
) {
|
||||
fun runMigrations(): Boolean {
|
||||
val oldVersion = migrationPreferences.appVersion().get()
|
||||
if (oldVersion < BuildKonfig.MIGRATION_CODE) {
|
||||
@@ -30,4 +29,4 @@ class AppMigrations
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,11 +14,10 @@ import dev.icerock.moko.resources.desc.desc
|
||||
import dev.icerock.moko.resources.format
|
||||
import me.tatarka.inject.annotations.Inject
|
||||
|
||||
actual class ContextWrapper
|
||||
@Inject
|
||||
constructor(
|
||||
@Inject
|
||||
actual class ContextWrapper(
|
||||
context: Context,
|
||||
) : ContextWrapper(context) {
|
||||
) : ContextWrapper(context) {
|
||||
actual fun toPlatformString(stringResource: StringResource): String = stringResource.desc().toString(this)
|
||||
|
||||
actual fun toPlatformString(
|
||||
@@ -39,4 +38,4 @@ actual class ContextWrapper
|
||||
},
|
||||
).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,9 +15,8 @@ import kotlinx.coroutines.flow.MutableSharedFlow
|
||||
import kotlinx.coroutines.flow.asSharedFlow
|
||||
import me.tatarka.inject.annotations.Inject
|
||||
|
||||
actual class ContextWrapper
|
||||
@Inject
|
||||
constructor() {
|
||||
@Inject
|
||||
actual class ContextWrapper() {
|
||||
private val _toasts = MutableSharedFlow<Pair<String, Length>>()
|
||||
val toasts = _toasts.asSharedFlow()
|
||||
|
||||
@@ -36,4 +35,4 @@ actual class ContextWrapper
|
||||
_toasts.emit(string to length)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user