Skip to content

Instantly share code, notes, and snippets.

View ifucolo's full-sized avatar
🌞
🇧🇷 ➡️ 🇳🇱

Iago Mendes Fucolo ifucolo

🌞
🇧🇷 ➡️ 🇳🇱
View GitHub Profile
/* 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
view.visibility = View.VISIBLE
val spring = view.spring(SpringAnimation.ALPHA)
(view.getTag(R.id.tag_pending_end_listener) as?
DynamicAnimation.OnAnimationEndListener)?.let {
@orhanobut
orhanobut / gist:8665372
Created January 28, 2014 10:34
Up down animation for dialog fragment
// Slide up animation
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" >
<translate
android:duration="@android:integer/config_mediumAnimTime"
android:fromYDelta="100%"
android:interpolator="@android:anim/accelerate_interpolator"
android:toXDelta="0" />