Skip to content

Instantly share code, notes, and snippets.

@lzanita09
lzanita09 / CircleRevealDrawable.java
Last active Jan 20, 2016
An animated Drawable that expands and reveals
View CircleRevealDrawable.java
package com.ifttt.iftttprototype;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
@lzanita09
lzanita09 / ResizeImageSpan.java
Created Jun 19, 2014
ImageSpan subclass that can resize the image to fit the cantainer's width if possible, and recalculate the Rect to avoid overlay text.
View ResizeImageSpan.java
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.text.style.ImageSpan;
import java.lang.ref.WeakReference;
/**
* Subclass of ImageSpan that resizes images automatically to fit the container's width, and then
* re-calculate the size of the image to let TextView know how much space it needs to display
@lzanita09
lzanita09 / ParallaxViewtransformer.java
Created May 10, 2014
Custom PageTransformer simulates Yahoo News Digest ViewPager animation.
View ParallaxViewtransformer.java
import android.support.v4.view.ViewPager;
import android.view.View;
/**
* Custom PageTransformer simulates Yahoo News Digest ViewPager animation.
*
*
* Created by zhelu on 2/27/14.
*/
public class ParallaxViewTransformer implements ViewPager.PageTransformer {