Skip to content

Instantly share code, notes, and snippets.

View FrancoisBlavoet's full-sized avatar

François Blavoet FrancoisBlavoet

View GitHub Profile
@FrancoisBlavoet
FrancoisBlavoet / GammaEvaluator.java
Last active November 17, 2020 07:03
Correct color interpolation
import android.animation.TypeEvaluator;
import android.animation.ValueAnimator;
import static java.lang.Math.pow;
public class GammaEvaluator implements TypeEvaluator {
private static final GammaEvaluator instance = new GammaEvaluator();
/**
@FrancoisBlavoet
FrancoisBlavoet / DiaporamaAdapter.java
Created March 30, 2015 22:09
Helper Class allowing to load multiple images consecutively in the same view with Glide and animate between them.
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.TransitionDrawable;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.animation.AlphaAnimation;
@FrancoisBlavoet
FrancoisBlavoet / ASynchronizableDataFetcher.java
Created March 27, 2015 10:52
Glide two levels Fetcher (and its associated ModelLoader) allowing to query another source (local storage, other API, ....) before calling the network fetcher.
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.data.DataFetcher;
import java.io.InputStream;
/**
@FrancoisBlavoet
FrancoisBlavoet / ContextMenuRecyclerView.java
Last active October 26, 2016 23:38
ContextMenuRecyclerView - simple sample on how to adapt an existing ContextMenu to RecyclerView
import android.content.Context;
import android.util.AttributeSet;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.View;
public class ContextMenuRecyclerView extends RecyclerView {