Improve: Android Studio's Reformat

This commit is contained in:
LooKeR
2021-11-16 01:12:52 +05:30
parent e49b357173
commit a321e9bfa5
32 changed files with 91 additions and 80 deletions

View File

@ -10,10 +10,11 @@ import com.looker.droidify.utility.extension.resources.getDrawableFromAttr
import kotlin.math.roundToInt
class DividerItemDecoration(
context: Context, private val configure: (
context: Context,
private val configure: (
context: Context,
position: Int, configuration: Configuration
) -> Unit
position: Int, configuration: Configuration,
) -> Unit,
) : RecyclerView.ItemDecoration() {
interface Configuration {
fun set(needDivider: Boolean, toTop: Boolean, paddingStart: Int, paddingEnd: Int)
@ -49,7 +50,7 @@ class DividerItemDecoration(
view: View,
top: Int,
width: Int,
rtl: Boolean
rtl: Boolean,
) {
val divider = divider
val left = if (rtl) configuration.paddingEnd else configuration.paddingStart
@ -105,7 +106,7 @@ class DividerItemDecoration(
outRect: Rect,
view: View,
parent: RecyclerView,
state: RecyclerView.State
state: RecyclerView.State,
) {
val configuration = view.configuration
val position = parent.getChildAdapterPosition(view)

View File

@ -33,7 +33,7 @@ class RecyclerFastScroller(private val recyclerView: RecyclerView) {
private data class FastScrolling(
val startAtThumbOffset: Float?,
val startY: Float,
val currentY: Float
val currentY: Float,
)
private var scrolling = false
@ -130,7 +130,7 @@ class RecyclerFastScroller(private val recyclerView: RecyclerView) {
itemHeight: Int,
thumbHeight: Int,
range: Int,
fastScrolling: FastScrolling
fastScrolling: FastScrolling,
) {
val offset = calculateOffset(thumbHeight, fastScrolling)
val scrollPosition = ((range - recyclerView.height) * offset).roundToInt()