Skip to content

Releases: saket/flick

v1.7.0

29 Oct 05:49

Choose a tag to compare

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) }
)

You can leverage lambda references to make the code super compact:

val callbacks = FlickCallbacks(
  onMove = this::updateBackgroundDimming,
  onFlickDismiss = this::finishActivityAfterMillis
)

The parameters have default values so you can also skip callbacks you're not interested in:

val callbacks = FlickCallbacks(onFlickDismiss = { ... })

v1.6.0

27 Oct 23:53

Choose a tag to compare

Migrated to AndroidX, thanks to @ZacSweers (#10)

v1.5.0

19 Sep 03:01

Choose a tag to compare

Small release that makes rotation of flick dismissible View optional (#9), useful in cases like shared element Activity transitions that silently ignore rotations.

val gestureListener = FlickGestureListener(
  context, contentSizeProvider, callbacks, rotationEnabled = false
)

v1.4.0

22 Sep 17:04

Choose a tag to compare

  • Include sources and javadoc for Kotlin files in the generated archives
  • Expose FlickGestureListener.INTERPOLATOR as a Java static field

v1.3.0

16 Aug 18:34

Choose a tag to compare

This release brings in some breaking changes:

  • Updated ContentSizeProvider to use functions instead of property values
  • Replaced GestureInterceptor with a lambda
  • Moved non-optional dependencies of FlickGestureListener to the constructor

v1.2.0

15 Aug 11:07

Choose a tag to compare

  • Added a resource prefix (flick_)
  • Added Apache 2.0 license

v1.0.0

12 Aug 17:22

Choose a tag to compare

First release \m/