Skip to content

Instantly share code, notes, and snippets.

@nickbutcher nickbutcher/lazy.diff

Last active Jul 24, 2019
What would you like to do?
/* Copyright 2019 Google LLC.
SPDX-License-Identifier: Apache-2.0 */
fun animateVisibility(view: View, visible: Boolean) {
+ val targetAlpha = if (visible) 1f else 0f
+ if (view.alpha == targetAlpha) return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.