Skip to content

Instantly share code, notes, and snippets.

View stepango's full-sized avatar
👁️
Making devs happier with Bazel

Stepan Goncharov stepango

👁️
Making devs happier with Bazel
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();
/**
@stepango
stepango / BindingObservablesExt.kt
Last active November 7, 2018 21:09
Databinding Observable RxJava2 extensions
package com.ninetyseconds.auckland.core.databindings
import android.databinding.*
import android.databinding.Observable.OnPropertyChangedCallback
import android.os.Parcelable
import io.reactivex.Observable
import io.reactivex.Observable.create
import org.funktionale.option.toOption
import java.lang.Math.max
import java.lang.Math.min
@rakshakhegde
rakshakhegde / fragment_utility.kt
Last active January 19, 2023 09:26
Handy Idiom: Pass Arguments to Android Fragment using Kotlin + Anko
import android.support.v4.app.Fragment
import org.jetbrains.anko.bundleOf
/**
* Pass arguments to a Fragment without the hassle of
* creating a static newInstance() method for every Fragment.
*
* Declared outside any class to have full access in any
* part of your package.
*
@danielhawkes
danielhawkes / MediaPlayerStateWrapper.java
Created June 16, 2011 15:58
A drop-in replacement for a MediaPlayer instance, that provides an accessor for the current state.
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.AbstractCollection;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import android.media.AudioManager;
import android.media.MediaPlayer;