Skip to content

Instantly share code, notes, and snippets.

View MariusBudin-zz's full-sized avatar

Marius Budin MariusBudin-zz

  • Barcelona
View GitHub Profile
@MariusBudin-zz
MariusBudin-zz / BaseFragment.java
Created May 28, 2015 14:24
A sample of how to perform post delayed calls using rxJava/rxAndroid avoiding the need to store an instance of a handler and cancel it in the onDestroy for each `postDelayed` call to avoid memory leaks
package com.ics.rxsamples
import android.app.Fragment;
import java.util.concurrent.TimeUnit;
import rx.Observable;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;
import rx.functions.Func1;
import rx.subjects.PublishSubject;
@MariusBudin-zz
MariusBudin-zz / FontLoader.java
Last active August 29, 2015 14:26
Creating a Typefont each time you want to create a custom font TextView might impact the performance of your app, this is a one-time lazy loader class for custom text fonts in Android
package com.ics.utils;
import android.content.Context;
import android.graphics.Typeface;
import java.util.HashMap;
import java.util.Map;
/**
* Created by marius on 30/7/15.
@MariusBudin-zz
MariusBudin-zz / RxBoolean.java
Created September 1, 2015 09:57
Some simple Rx bindings on primitives based on android.databinding library. This allows you to apply, maps, filters and all the goodies in rxJava/rxAndroid on simple primitive data observers.
import android.databinding.ObservableBoolean;
import rx.Observable;
import rx.subjects.BehaviorSubject;
/**
* Created by marius on 31/8/15.
*
* @music Antonia Font - Me sobren paraules
*/