This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Helper class for creating pools of objects. | |
* | |
* An example use looks like this: | |
* | |
* <pre> | |
* public class MyPooledClass implements {@link PoolObject}{ | |
* | |
* private static final SynchronizedPool<MyPooledClass> sPool = new SynchronizedPool<MyPooledClass>(new MyPooledFactoryClass(), 10); | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.annotation.TargetApi; | |
import android.app.Activity; | |
import android.content.res.Configuration; | |
import android.content.res.Resources; | |
import android.os.Build; | |
import java.util.Locale; | |
/** | |
* Utility class to change app locale settings. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.os.Parcel; | |
import android.os.Parcelable; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
/** | |
* Utility class for parceling objects | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.support.v4.content.AsyncTaskLoader; | |
/** | |
* Loader which extends AsyncTaskLoader and handles caveats as pointed out in | |
* http://code.google.com/p/android/issues/detail?id=14944. | |
* <p/> | |
* | |
* @param <T> data type | |
* @author Antonio Gutierrez <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.support.v4.content.Loader; | |
public final class PresenterLoader<T extends Presenter> extends Loader<T>{ | |
private final PresenterFactory<T> factory; | |
private T presenter; | |
public PresenterLoader(Context context, PresenterFactory<T> factory) { | |
super(context); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.v4.util.Pools; | |
/** | |
* Simple (non-synchronized) pool of objects. This Pool does not do any check whether an object to be released is | |
* already in the pool, unlike {@link android.support.v4.util.Pools.SimplePool} | |
* | |
* @param <T> The pooled type. | |
*/ | |
public class UncheckedPool<T> implements Pools.Pool<T> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.jakewharton.rxrelay.BehaviorRelay; | |
import com.jakewharton.rxrelay.Relay; | |
import rx.Observable; | |
public class Store<T> { | |
private final Relay<T, T> storeSubject; | |
public Store() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.jakewharton.rxrelay.PublishRelay; | |
import com.jakewharton.rxrelay.Relay; | |
import rx.Observable; | |
public class RxBus { | |
private static final RxBus INSTANCE = new RxBus(); | |
private final Relay<Object, Object> busSubject = PublishRelay.create().toSerialized(); |