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