Clean up some companion object usages

This commit is contained in:
arkon
2021-09-05 14:34:29 -04:00
parent 02b430a5bf
commit ec4e631760
24 changed files with 87 additions and 138 deletions
@@ -40,15 +40,13 @@ class PageIndicatorTextView(
super.setText(finalText, BufferType.SPANNABLE)
}
private companion object {
private val fillColor = Color.rgb(235, 235, 235)
private val strokeColor = Color.rgb(45, 45, 45)
// A span object with text outlining properties
val spanOutline = OutlineSpan(
strokeColor = strokeColor,
strokeWidth = 4f
)
}
}
private val fillColor = Color.rgb(235, 235, 235)
private val strokeColor = Color.rgb(45, 45, 45)
// A span object with text outlining properties
private val spanOutline = OutlineSpan(
strokeColor = strokeColor,
strokeWidth = 4f
)
@@ -219,18 +219,16 @@ class ReaderColorFilterSettings @JvmOverloads constructor(context: Context, attr
val updatedColor = (color shl bitShift) or (currentColor and mask.inv().toInt())
preferences.colorFilterValue().set(updatedColor)
}
private companion object {
/** Integer mask of alpha value **/
const val ALPHA_MASK: Long = 0xFF000000
/** Integer mask of red value **/
const val RED_MASK: Long = 0x00FF0000
/** Integer mask of green value **/
const val GREEN_MASK: Long = 0x0000FF00
/** Integer mask of blue value **/
const val BLUE_MASK: Long = 0x000000FF
}
}
/** Integer mask of alpha value **/
private const val ALPHA_MASK: Long = 0xFF000000
/** Integer mask of red value **/
private const val RED_MASK: Long = 0x00FF0000
/** Integer mask of green value **/
private const val GREEN_MASK: Long = 0x0000FF00
/** Integer mask of blue value **/
private const val BLUE_MASK: Long = 0x000000FF
@@ -183,16 +183,14 @@ class WebtoonAdapter(val viewer: WebtoonViewer) : RecyclerView.Adapter<RecyclerV
return newItems.size
}
}
private companion object {
/**
* View holder type of a chapter page view.
*/
const val PAGE_VIEW = 0
/**
* View holder type of a chapter transition view.
*/
const val TRANSITION_VIEW = 1
}
}
/**
* View holder type of a chapter page view.
*/
private const val PAGE_VIEW = 0
/**
* View holder type of a chapter transition view.
*/
private const val TRANSITION_VIEW = 1
@@ -314,11 +314,9 @@ open class WebtoonRecyclerView @JvmOverloads constructor(
return super.onTouchEvent(ev)
}
}
private companion object {
const val ANIMATOR_DURATION_TIME = 200
const val MIN_RATE = 0.5f
const val DEFAULT_RATE = 1f
const val MAX_SCALE_RATE = 3f
}
}
private const val ANIMATOR_DURATION_TIME = 200
private const val MIN_RATE = 0.5f
private const val DEFAULT_RATE = 1f
private const val MAX_SCALE_RATE = 3f