Flick Versions Save

Flick dismiss all the things!

v1.7.0

4 years ago

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

4 years ago

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

v1.5.0

4 years ago

Small release that makes rotation of flick dismissible View optional (https://github.com/saket/Flick/issues/9), useful in cases like shared element Activity transitions that silently ignore rotations.

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

v1.4.0

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

v1.3.0

5 years ago

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

5 years ago
  • Added a resource prefix (flick_)
  • Added Apache 2.0 license

v1.0.0

5 years ago

First release \m/