Update linter
This commit is contained in:
@@ -89,6 +89,6 @@ class EmptyView @JvmOverloads constructor(context: Context, attrs: AttributeSet?
|
||||
data class Action(
|
||||
@StringRes val stringResId: Int,
|
||||
@DrawableRes val iconResId: Int,
|
||||
val listener: OnClickListener
|
||||
val listener: OnClickListener,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||
open class ExtendedNavigationView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
defStyleAttr: Int = 0,
|
||||
) : SimpleNavigationView(context, attrs, defStyleAttr) {
|
||||
|
||||
/**
|
||||
|
||||
+5
-5
@@ -20,7 +20,7 @@ import kotlin.math.roundToLong
|
||||
*/
|
||||
class HideBottomNavigationOnScrollBehavior @JvmOverloads constructor(
|
||||
context: Context? = null,
|
||||
attrs: AttributeSet? = null
|
||||
attrs: AttributeSet? = null,
|
||||
) : CoordinatorLayout.Behavior<BottomNavigationView>(context, attrs) {
|
||||
|
||||
@ViewCompat.NestedScrollType
|
||||
@@ -37,7 +37,7 @@ class HideBottomNavigationOnScrollBehavior @JvmOverloads constructor(
|
||||
override fun onDependentViewChanged(
|
||||
parent: CoordinatorLayout,
|
||||
child: BottomNavigationView,
|
||||
dependency: View
|
||||
dependency: View,
|
||||
): Boolean {
|
||||
val toolbarSize = (dependency as ViewGroup).findChild<Toolbar>()?.height ?: 0
|
||||
dyRatio = if (toolbarSize > 0) {
|
||||
@@ -54,7 +54,7 @@ class HideBottomNavigationOnScrollBehavior @JvmOverloads constructor(
|
||||
directTargetChild: View,
|
||||
target: View,
|
||||
axes: Int,
|
||||
type: Int
|
||||
type: Int,
|
||||
): Boolean {
|
||||
if (axes != ViewCompat.SCROLL_AXIS_VERTICAL) {
|
||||
return false
|
||||
@@ -71,7 +71,7 @@ class HideBottomNavigationOnScrollBehavior @JvmOverloads constructor(
|
||||
dx: Int,
|
||||
dy: Int,
|
||||
consumed: IntArray,
|
||||
type: Int
|
||||
type: Int,
|
||||
) {
|
||||
super.onNestedPreScroll(coordinatorLayout, child, target, dx, dy, consumed, type)
|
||||
child.translationY = (child.translationY + (dy * dyRatio)).coerceIn(0F, child.height.toFloat())
|
||||
@@ -81,7 +81,7 @@ class HideBottomNavigationOnScrollBehavior @JvmOverloads constructor(
|
||||
coordinatorLayout: CoordinatorLayout,
|
||||
child: BottomNavigationView,
|
||||
target: View,
|
||||
type: Int
|
||||
type: Int,
|
||||
) {
|
||||
if (lastStartedType == ViewCompat.TYPE_TOUCH || type == ViewCompat.TYPE_NON_TOUCH) {
|
||||
animateBottomNavigationVisibility(child, child.translationY < child.height / 2)
|
||||
|
||||
@@ -27,7 +27,7 @@ class MangaSummaryView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
@AttrRes defStyleAttr: Int = 0,
|
||||
@StyleRes defStyleRes: Int = 0
|
||||
@StyleRes defStyleRes: Int = 0,
|
||||
) : FrameLayout(context, attrs, defStyleAttr, defStyleRes) {
|
||||
|
||||
private val binding = MangaSummaryBinding.inflate(LayoutInflater.from(context), this, true)
|
||||
|
||||
@@ -18,7 +18,7 @@ class MaterialFastScroll @JvmOverloads constructor(context: Context, attrs: Attr
|
||||
setViewsToUse(
|
||||
R.layout.material_fastscroll,
|
||||
R.id.fast_scroller_bubble,
|
||||
R.id.fast_scroller_handle,
|
||||
R.id.fast_scroller_handle
|
||||
)
|
||||
autoHideEnabled = true
|
||||
ignoreTouchesOutsideHandle = true
|
||||
|
||||
@@ -13,7 +13,7 @@ import androidx.annotation.Dimension
|
||||
*/
|
||||
class OutlineSpan(
|
||||
@ColorInt private val strokeColor: Int,
|
||||
@Dimension private val strokeWidth: Float
|
||||
@Dimension private val strokeWidth: Float,
|
||||
) : ReplacementSpan() {
|
||||
|
||||
override fun getSize(
|
||||
@@ -21,7 +21,7 @@ class OutlineSpan(
|
||||
text: CharSequence,
|
||||
start: Int,
|
||||
end: Int,
|
||||
fm: Paint.FontMetricsInt?
|
||||
fm: Paint.FontMetricsInt?,
|
||||
): Int {
|
||||
return paint.measureText(text.toString().substring(start until end)).toInt()
|
||||
}
|
||||
@@ -35,7 +35,7 @@ class OutlineSpan(
|
||||
top: Int,
|
||||
y: Int,
|
||||
bottom: Int,
|
||||
paint: Paint
|
||||
paint: Paint,
|
||||
) {
|
||||
val originTextColor = paint.color
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import eu.kanade.tachiyomi.R as TR
|
||||
open class SimpleNavigationView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
defStyleAttr: Int = 0,
|
||||
) : FrameLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,7 +30,7 @@ import reactivecircus.flowbinding.android.view.hierarchyChangeEvents
|
||||
*/
|
||||
class TachiyomiAppBarLayout @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null
|
||||
attrs: AttributeSet? = null,
|
||||
) : AppBarLayout(context, attrs) {
|
||||
|
||||
private var lifted = true
|
||||
|
||||
@@ -29,7 +29,7 @@ class TachiyomiBottomNavigationView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = R.attr.bottomNavigationStyle,
|
||||
defStyleRes: Int = R.style.Widget_Design_BottomNavigationView
|
||||
defStyleRes: Int = R.style.Widget_Design_BottomNavigationView,
|
||||
) : BottomNavigationView(context, attrs, defStyleAttr, defStyleRes) {
|
||||
|
||||
private var currentAnimator: ViewPropertyAnimator? = null
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.bluelinelabs.conductor.ChangeHandlerFrameLayout
|
||||
*/
|
||||
class TachiyomiChangeHandlerFrameLayout(
|
||||
context: Context,
|
||||
attrs: AttributeSet
|
||||
attrs: AttributeSet,
|
||||
) : ChangeHandlerFrameLayout(context, attrs), CoordinatorLayout.AttachedBehavior {
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,7 +29,7 @@ import eu.kanade.tachiyomi.util.view.findChild
|
||||
class TachiyomiCoordinatorLayout @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = R.attr.coordinatorLayoutStyle
|
||||
defStyleAttr: Int = R.attr.coordinatorLayoutStyle,
|
||||
) : CoordinatorLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
/**
|
||||
@@ -58,7 +58,7 @@ class TachiyomiCoordinatorLayout @JvmOverloads constructor(
|
||||
dxUnconsumed: Int,
|
||||
dyUnconsumed: Int,
|
||||
type: Int,
|
||||
consumed: IntArray
|
||||
consumed: IntArray,
|
||||
) {
|
||||
super.onNestedScroll(target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, type, consumed)
|
||||
// Disable elevation overlay when tabs are visible
|
||||
|
||||
@@ -23,7 +23,7 @@ import uy.kohesive.injekt.api.get
|
||||
class TachiyomiSearchView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = R.attr.searchViewStyle
|
||||
defStyleAttr: Int = R.attr.searchViewStyle,
|
||||
) : SearchView(context, attrs, defStyleAttr) {
|
||||
|
||||
private var scope: CoroutineScope? = null
|
||||
|
||||
@@ -26,7 +26,7 @@ import uy.kohesive.injekt.api.get
|
||||
class TachiyomiTextInputEditText @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = R.attr.editTextStyle
|
||||
defStyleAttr: Int = R.attr.editTextStyle,
|
||||
) : TextInputEditText(context, attrs, defStyleAttr) {
|
||||
|
||||
private var scope: CoroutineScope? = null
|
||||
|
||||
@@ -8,7 +8,7 @@ import eu.kanade.tachiyomi.util.system.getThemeColor
|
||||
|
||||
class ThemedSwipeRefreshLayout @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null
|
||||
attrs: AttributeSet? = null,
|
||||
) : SwipeRefreshLayout(context, attrs) {
|
||||
init {
|
||||
// Background
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ import eu.kanade.tachiyomi.databinding.DialogStubTextinputBinding
|
||||
fun MaterialAlertDialogBuilder.setTextInput(
|
||||
hint: String? = null,
|
||||
prefill: String? = null,
|
||||
onTextChanged: (String) -> Unit
|
||||
onTextChanged: (String) -> Unit,
|
||||
): MaterialAlertDialogBuilder {
|
||||
val binding = DialogStubTextinputBinding.inflate(LayoutInflater.from(context))
|
||||
binding.textField.hint = hint
|
||||
@@ -43,7 +43,7 @@ fun MaterialAlertDialogBuilder.setQuadStateMultiChoiceItems(
|
||||
items: List<CharSequence>,
|
||||
initialSelected: IntArray,
|
||||
disabledIndices: IntArray? = null,
|
||||
selection: QuadStateMultiChoiceListener
|
||||
selection: QuadStateMultiChoiceListener,
|
||||
): MaterialAlertDialogBuilder {
|
||||
val binding = DialogStubQuadstatemultichoiceBinding.inflate(LayoutInflater.from(context))
|
||||
binding.list.layoutManager = LinearLayoutManager(context)
|
||||
|
||||
+4
-4
@@ -19,7 +19,7 @@ internal class QuadStateMultiChoiceDialogAdapter(
|
||||
disabledItems: IntArray?,
|
||||
private var initialSelected: IntArray,
|
||||
internal var listener: QuadStateMultiChoiceListener,
|
||||
val isActionList: Boolean = true
|
||||
val isActionList: Boolean = true,
|
||||
) : RecyclerView.Adapter<QuadStateMultiChoiceViewHolder>() {
|
||||
|
||||
private val states = QuadStateTextView.State.values()
|
||||
@@ -80,7 +80,7 @@ internal class QuadStateMultiChoiceDialogAdapter(
|
||||
|
||||
override fun onCreateViewHolder(
|
||||
parent: ViewGroup,
|
||||
viewType: Int
|
||||
viewType: Int,
|
||||
): QuadStateMultiChoiceViewHolder {
|
||||
return QuadStateMultiChoiceViewHolder(
|
||||
itemBinding = DialogQuadstatemultichoiceItemBinding
|
||||
@@ -93,7 +93,7 @@ internal class QuadStateMultiChoiceDialogAdapter(
|
||||
|
||||
override fun onBindViewHolder(
|
||||
holder: QuadStateMultiChoiceViewHolder,
|
||||
position: Int
|
||||
position: Int,
|
||||
) {
|
||||
holder.isEnabled = !disabledIndices.contains(position)
|
||||
holder.controlView.state = states[currentSelection[position]]
|
||||
@@ -103,7 +103,7 @@ internal class QuadStateMultiChoiceDialogAdapter(
|
||||
override fun onBindViewHolder(
|
||||
holder: QuadStateMultiChoiceViewHolder,
|
||||
position: Int,
|
||||
payloads: MutableList<Any>
|
||||
payloads: MutableList<Any>,
|
||||
) {
|
||||
when (payloads.firstOrNull()) {
|
||||
CheckPayload -> {
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import eu.kanade.tachiyomi.databinding.DialogQuadstatemultichoiceItemBinding
|
||||
|
||||
internal class QuadStateMultiChoiceViewHolder(
|
||||
itemBinding: DialogQuadstatemultichoiceItemBinding,
|
||||
private val adapter: QuadStateMultiChoiceDialogAdapter
|
||||
private val adapter: QuadStateMultiChoiceDialogAdapter,
|
||||
) : RecyclerView.ViewHolder(itemBinding.root), View.OnClickListener {
|
||||
init {
|
||||
itemView.setOnClickListener(this)
|
||||
|
||||
@@ -17,7 +17,7 @@ import uy.kohesive.injekt.injectLazy
|
||||
|
||||
abstract class LoginDialogPreference(
|
||||
@StringRes private val usernameLabelRes: Int? = null,
|
||||
bundle: Bundle? = null
|
||||
bundle: Bundle? = null,
|
||||
) : DialogController(bundle) {
|
||||
|
||||
var binding: PrefAccountLoginBinding? = null
|
||||
|
||||
@@ -15,7 +15,7 @@ import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||
|
||||
class SwitchPreferenceCategory @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null
|
||||
attrs: AttributeSet? = null,
|
||||
) :
|
||||
PreferenceCategory(
|
||||
context,
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.lang.reflect.Field
|
||||
*/
|
||||
class BottomSheetViewPager @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null
|
||||
attrs: AttributeSet? = null,
|
||||
) : ViewPager(context, attrs) {
|
||||
|
||||
private val positionField: Field = LayoutParams::class.java.getDeclaredField("position").also {
|
||||
|
||||
Reference in New Issue
Block a user