mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-11 15:17:43 +00:00
Fix scroll to bottom button visibility (#1219)
This commit is contained in:
@@ -5,6 +5,7 @@ import android.util.TypedValue
|
||||
import androidx.annotation.AttrRes
|
||||
import androidx.annotation.ColorInt
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import kotlin.math.max
|
||||
|
||||
@ColorInt
|
||||
fun Context.getColorFromAttr(
|
||||
@@ -17,4 +18,4 @@ fun Context.getColorFromAttr(
|
||||
}
|
||||
|
||||
val RecyclerView.isScrolledToBottom: Boolean
|
||||
get() = computeVerticalScrollOffset() + computeVerticalScrollExtent() >= computeVerticalScrollRange()
|
||||
get() = max(0, computeVerticalScrollOffset()) + computeVerticalScrollExtent() >= computeVerticalScrollRange()
|
||||
|
Reference in New Issue
Block a user