|
|
|
@ -4,6 +4,7 @@ import android.content.Context
|
|
|
|
|
import android.util.TypedValue
|
|
|
|
|
import androidx.annotation.AttrRes
|
|
|
|
|
import androidx.annotation.ColorInt
|
|
|
|
|
import androidx.recyclerview.widget.RecyclerView
|
|
|
|
|
|
|
|
|
|
@ColorInt
|
|
|
|
|
fun Context.getColorFromAttr(
|
|
|
|
@ -13,4 +14,10 @@ fun Context.getColorFromAttr(
|
|
|
|
|
): Int {
|
|
|
|
|
theme.resolveAttribute(attrColor, typedValue, resolveRefs)
|
|
|
|
|
return typedValue.data
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val RecyclerView.isScrolledToBottom: Boolean
|
|
|
|
|
get() {
|
|
|
|
|
val contentHeight = height - (paddingTop + paddingBottom)
|
|
|
|
|
return computeVerticalScrollRange() == computeVerticalScrollOffset() + contentHeight
|
|
|
|
|
}
|
|
|
|
|