Run linter

This commit is contained in:
arkon
2020-02-26 18:03:34 -05:00
parent 58ab06b4f8
commit 043e3784e8
331 changed files with 876 additions and 1075 deletions
@@ -18,8 +18,12 @@ class ChangeMangaCategoriesDialog<T>(bundle: Bundle? = null) :
private var preselected = emptyArray<Int>()
constructor(target: T, mangas: List<Manga>, categories: List<Category>,
preselected: Array<Int>) : this() {
constructor(
target: T,
mangas: List<Manga>,
categories: List<Category>,
preselected: Array<Int>
) : this() {
this.mangas = mangas
this.categories = categories
@@ -44,5 +48,4 @@ class ChangeMangaCategoriesDialog<T>(bundle: Bundle? = null) :
interface Listener {
fun updateCategoriesForMangas(mangas: List<Manga>, categories: List<Category>)
}
}
}
@@ -99,5 +99,4 @@ class LibraryAdapter(private val controller: LibraryController) : RecyclerViewPa
}
}
}
}
@@ -44,5 +44,4 @@ class LibraryCategoryAdapter(view: LibraryCategoryView) :
}
updateDataSet(mangas.filter { it.filter(s) })
}
}
@@ -267,7 +267,6 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att
controller.invalidateActionMode()
}
/**
* Tells the presenter to set the selection for the given position.
*
@@ -279,5 +278,4 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att
controller.setSelection(item.manga, true)
controller.invalidateActionMode()
}
}
@@ -35,6 +35,7 @@ import eu.kanade.tachiyomi.ui.main.MainActivity
import eu.kanade.tachiyomi.ui.manga.MangaController
import eu.kanade.tachiyomi.util.system.toast
import eu.kanade.tachiyomi.util.view.inflate
import java.io.IOException
import kotlinx.android.synthetic.main.library_controller.empty_view
import kotlinx.android.synthetic.main.library_controller.library_pager
import kotlinx.android.synthetic.main.main_activity.drawer
@@ -43,12 +44,10 @@ import rx.Subscription
import timber.log.Timber
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.io.IOException
class LibraryController(
bundle: Bundle? = null,
private val preferences: PreferencesHelper = Injekt.get()
bundle: Bundle? = null,
private val preferences: PreferencesHelper = Injekt.get()
) : NucleusController<LibraryPresenter>(bundle),
TabbedController,
SecondaryDrawerController,
@@ -556,5 +555,4 @@ class LibraryController(
*/
const val REQUEST_IMAGE_OPEN = 101
}
}
@@ -17,8 +17,8 @@ import kotlinx.android.synthetic.main.catalogue_grid_item.*
* @constructor creates a new library holder.
*/
class LibraryGridHolder(
private val view: View,
private val adapter: FlexibleAdapter<*>
private val view: View,
private val adapter: FlexibleAdapter<*>
) : LibraryHolder(view, adapter) {
@@ -42,7 +42,7 @@ class LibraryGridHolder(
visibility = if (item.downloadCount > 0) View.VISIBLE else View.GONE
text = item.downloadCount.toString()
}
//set local visibility if its local manga
// set local visibility if its local manga
local_text.visibility = if (item.manga.source == LocalSource.ID) View.VISIBLE else View.GONE
// Update the cover.
@@ -53,5 +53,4 @@ class LibraryGridHolder(
.centerCrop()
.into(thumbnail)
}
}
@@ -12,8 +12,8 @@ import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
*/
abstract class LibraryHolder(
view: View,
adapter: FlexibleAdapter<*>
view: View,
adapter: FlexibleAdapter<*>
) : BaseFlexibleViewHolder(view, adapter) {
/**
@@ -23,5 +23,4 @@ abstract class LibraryHolder(
* @param item the manga item to bind.
*/
abstract fun onSetValues(item: LibraryItem)
}
@@ -49,10 +49,12 @@ class LibraryItem(val manga: LibraryManga, private val libraryAsList: Preference
}
}
override fun bindViewHolder(adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>,
holder: LibraryHolder,
position: Int,
payloads: List<Any?>?) {
override fun bindViewHolder(
adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>,
holder: LibraryHolder,
position: Int,
payloads: List<Any?>?
) {
holder.onSetValues(this)
}
@@ -18,8 +18,8 @@ import kotlinx.android.synthetic.main.catalogue_list_item.*
*/
class LibraryListHolder(
private val view: View,
private val adapter: FlexibleAdapter<*>
private val view: View,
private val adapter: FlexibleAdapter<*>
) : LibraryHolder(view, adapter) {
/**
@@ -42,7 +42,7 @@ class LibraryListHolder(
visibility = if (item.downloadCount > 0) View.VISIBLE else View.GONE
text = "${item.downloadCount}"
}
//show local text badge if local manga
// show local text badge if local manga
local_text.visibility = if (item.manga.source == LocalSource.ID) View.VISIBLE else View.GONE
// Create thumbnail onclick to simulate long click
@@ -61,5 +61,4 @@ class LibraryListHolder(
.dontAnimate()
.into(thumbnail)
}
}
@@ -14,8 +14,8 @@ import uy.kohesive.injekt.injectLazy
/**
* The navigation view shown in a drawer with the different options to show the library.
*/
class LibraryNavigationView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null)
: ExtendedNavigationView(context, attrs) {
class LibraryNavigationView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
ExtendedNavigationView(context, attrs) {
/**
* Preferences helper.
@@ -161,6 +161,5 @@ class LibraryNavigationView @JvmOverloads constructor(context: Context, attrs: A
item.group.items.forEach { adapter.notifyItemChanged(it) }
}
}
}
@@ -17,17 +17,17 @@ import eu.kanade.tachiyomi.source.online.HttpSource
import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter
import eu.kanade.tachiyomi.util.lang.combineLatest
import eu.kanade.tachiyomi.util.lang.isNullOrUnsubscribed
import java.io.IOException
import java.io.InputStream
import java.util.ArrayList
import java.util.Collections
import java.util.Comparator
import rx.Observable
import rx.Subscription
import rx.android.schedulers.AndroidSchedulers
import rx.schedulers.Schedulers
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.io.IOException
import java.io.InputStream
import java.util.ArrayList
import java.util.Collections
import java.util.Comparator
/**
* Class containing library information.
@@ -43,11 +43,11 @@ private typealias LibraryMap = Map<Int, List<LibraryItem>>
* Presenter of [LibraryController].
*/
class LibraryPresenter(
private val db: DatabaseHelper = Injekt.get(),
private val preferences: PreferencesHelper = Injekt.get(),
private val coverCache: CoverCache = Injekt.get(),
private val sourceManager: SourceManager = Injekt.get(),
private val downloadManager: DownloadManager = Injekt.get()
private val db: DatabaseHelper = Injekt.get(),
private val preferences: PreferencesHelper = Injekt.get(),
private val coverCache: CoverCache = Injekt.get(),
private val sourceManager: SourceManager = Injekt.get(),
private val downloadManager: DownloadManager = Injekt.get()
) : BasePresenter<LibraryController>() {
private val context = preferences.context
@@ -375,5 +375,4 @@ class LibraryPresenter(
}
return false
}
}
@@ -8,5 +8,4 @@ object LibrarySort {
const val UNREAD = 3
const val TOTAL = 4
const val LATEST_CHAPTER = 6
}