Update linter

This commit is contained in:
arkon
2022-05-10 17:54:52 -04:00
parent 8bee5accb7
commit ae7df4fb7f
49 changed files with 119 additions and 117 deletions

View File

@@ -43,7 +43,7 @@ class AppModule(val app: Application) : InjektModule {
.callback(DbOpenCallback())
.name(DbOpenCallback.DATABASE_NAME)
.noBackupDirectory(false)
.build()
.build(),
)
}
@@ -56,11 +56,11 @@ class AppModule(val app: Application) : InjektModule {
driver = get(),
historyAdapter = History.Adapter(
history_last_readAdapter = dateAdapter,
history_time_readAdapter = dateAdapter
history_time_readAdapter = dateAdapter,
),
mangasAdapter = Mangas.Adapter(
genreAdapter = listOfStringsAdapter
)
genreAdapter = listOfStringsAdapter,
),
)
}

View File

@@ -26,7 +26,7 @@ class DbOpenCallback : SupportSQLiteOpenHelper.Callback(Database.Schema.version)
Database.Schema.migrate(
driver = AndroidSqliteDriver(database = db, cacheSize = 1),
oldVersion = oldVersion,
newVersion = newVersion
newVersion = newVersion,
)
}
}

View File

@@ -42,7 +42,7 @@ class MigrationMangaController : ComposeController<MigrationMangaPresenter> {
},
onClickCover = {
router.pushController(MangaController(it.id))
}
},
)
}

View File

@@ -15,7 +15,7 @@ import uy.kohesive.injekt.api.get
class MigrationMangaPresenter(
private val sourceId: Long,
private val getFavoritesBySourceId: GetFavoritesBySourceId = Injekt.get()
private val getFavoritesBySourceId: GetFavoritesBySourceId = Injekt.get(),
) : BasePresenter<MigrationMangaController>() {
private val _state: MutableStateFlow<MigrateMangaState> = MutableStateFlow(MigrateMangaState.Loading)

View File

@@ -28,7 +28,7 @@ class SearchController(
constructor(mangaId: Long) : this(
Injekt.get<DatabaseHelper>()
.getManga(mangaId)
.executeAsBlocking()
.executeAsBlocking(),
)
private var newManga: Manga? = null

View File

@@ -30,8 +30,8 @@ class MigrationSourcesController : ComposeController<MigrationSourcesPresenter>(
parentController!!.router.pushController(
MigrationMangaController(
source.id,
source.name
)
source.name,
),
)
},
onLongClickItem = { source ->
@@ -51,12 +51,14 @@ class MigrationSourcesController : ComposeController<MigrationSourcesPresenter>(
true
}
R.id.asc_alphabetical,
R.id.desc_alphabetical -> {
R.id.desc_alphabetical,
-> {
presenter.setAlphabeticalSorting(itemId == R.id.asc_alphabetical)
true
}
R.id.asc_count,
R.id.desc_count -> {
R.id.desc_count,
-> {
presenter.setTotalSorting(itemId == R.id.asc_count)
true
}

View File

@@ -16,7 +16,7 @@ import uy.kohesive.injekt.api.get
class MigrationSourcesPresenter(
private val getSourcesWithFavoriteCount: GetSourcesWithFavoriteCount = Injekt.get(),
private val setMigrateSorting: SetMigrateSorting = Injekt.get()
private val setMigrateSorting: SetMigrateSorting = Injekt.get(),
) : BasePresenter<MigrationSourcesController>() {
private val _state: MutableStateFlow<MigrateSourceState> = MutableStateFlow(MigrateSourceState.Loading)

View File

@@ -20,7 +20,7 @@ class SourceFilterPresenter(
private val getLanguagesWithSources: GetLanguagesWithSources = Injekt.get(),
private val toggleSource: ToggleSource = Injekt.get(),
private val toggleLanguage: ToggleLanguage = Injekt.get(),
private val preferences: PreferencesHelper = Injekt.get()
private val preferences: PreferencesHelper = Injekt.get(),
) : BasePresenter<SourceFilterController>() {
private val _state: MutableStateFlow<SourceFilterState> = MutableStateFlow(SourceFilterState.Loading)
@@ -49,7 +49,7 @@ class SourceFilterPresenter(
header + it.value.map { source ->
FilterUiModel.Item(
source,
source.id.toString() !in preferences.disabledSources().get()
source.id.toString() !in preferences.disabledSources().get(),
)
}
}

View File

@@ -25,7 +25,7 @@ import java.util.TreeMap
class SourcePresenter(
private val getEnabledSources: GetEnabledSources = Injekt.get(),
private val toggleSource: ToggleSource = Injekt.get(),
private val toggleSourcePin: ToggleSourcePin = Injekt.get()
private val toggleSourcePin: ToggleSourcePin = Injekt.get(),
) : BasePresenter<SourceController>() {
private val _state: MutableStateFlow<SourceState> = MutableStateFlow(SourceState.Loading)

View File

@@ -25,7 +25,7 @@ fun syncChaptersWithSource(
db: DatabaseHelper,
rawSourceChapters: List<SChapter>,
manga: Manga,
source: Source
source: Source,
): Pair<List<Chapter>, List<Chapter>> {
if (rawSourceChapters.isEmpty()) {
throw NoChaptersException()

View File

@@ -91,7 +91,7 @@ class TachiyomiBottomNavigationView @JvmOverloads constructor(
currentAnimator = null
postInvalidate()
}
})
},)
}
internal class SavedState : AbsSavedState {

View File

@@ -25,7 +25,7 @@ class ThemesPreferenceAdapter(private val clickListener: OnItemClickListener) :
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ThemeViewHolder {
val themeResIds = ThemingDelegate.getThemeResIds(themes[viewType], preferences.themeDarkAmoled().get())
val themedContext = themeResIds.fold(parent.context) {
context, themeResId ->
context, themeResId ->
ContextThemeWrapper(context, themeResId)
}