Skip to content

Instantly share code, notes, and snippets.

@samiuelson
Created May 6, 2020 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samiuelson/f20fd60d1f41c44e6de1f9bc8b35bfa3 to your computer and use it in GitHub Desktop.
Save samiuelson/f20fd60d1f41c44e6de1f9bc8b35bfa3 to your computer and use it in GitHub Desktop.
class LiveStreamActivity : AppCompatActivity(R.layout.activity_main) {
private val adapter = MessagesListAdapter()
private val messageListSmoothScroller by lazy {
object : LinearSmoothScroller(this) {
val MILLISECONDS_PER_INCH = 400f
override fun calculateSpeedPerPixel(displayMetrics: DisplayMetrics?): Float {
return MILLISECONDS_PER_INCH / displayMetrics!!.densityDpi
}
}
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment