v1.7.0
This release introduces a much simpler way for providing height of your flick-dismissible content:
val contentSizeProvider = ContentSizeProvider2 { imageView.zoomedImageHeight() }
The function names in the older interface were confusing to understand. To be honest, I don't even remember why I wrote them that way:
val contentSizeProvider = object : ContentSizeProvider {
override fun heightForDismissAnimation(): Int =
imageView.zoomedImageHeight()
override fun heightForCalculatingDismissThreshold(): Int =
// Zoomed in height minus the portion of image that has gone
// outside display bounds, because they are no longer visible.
imageView.visibleZoomedImageHeight()
}
Flick v1.7.0 gets rid of an extra function by automatically calculating if the content height exceeds the flickable View's bounds. The changes are fully backward compatible. In case you notice any differences, you can go back to using the old ContentSizeProvider without downgrading Flick. Don't forget to file a bug report!
This release also brings in support for optionally providing flick callbacks using lambdas:
val callbacks = FlickCallbacks(
onMove = { moveRatio -> updateBackgroundDimming(moveRatio) },
onFlickDismiss = { flickAnimDuration -> finishActivityAfterMillis(flickAnimDuration) }
)