Skip to content

Instantly share code, notes, and snippets.

@krossovochkin
Created January 18, 2020 12:07
Show Gist options
  • Select an option

  • Save krossovochkin/cb9f62537a14bbbf94cfe4c97ce24ded to your computer and use it in GitHub Desktop.

Select an option

Save krossovochkin/cb9f62537a14bbbf94cfe4c97ce24ded to your computer and use it in GitHub Desktop.
Theme_1_setup
private fun setTheme(theme: Theme) {
if (imageView.isVisible) {
return
}
val w = container.measuredWidth
val h = container.measuredHeight
val bitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888)
val canvas = Canvas(bitmap)
container.draw(canvas)
imageView.setImageBitmap(bitmap)
imageView.isVisible = true
val finalRadius = hypot(w.toFloat(), h.toFloat())
TODO("Change theme over all views")
val anim = ViewAnimationUtils.createCircularReveal(container, w / 2, h / 2, 0f, finalRadius)
anim.duration = 400L
anim.doOnEnd {
imageView.setImageDrawable(null)
imageView.isVisible = false
}
anim.start()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment