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
private TimedCacheSource<Discover> discoverObservable = TimedCacheSource.createWithTimeout(30, TimeUnit.SECONDS); | |
public Single<Discover> getProviders() { | |
return discoverObservable.switchIfEmpty(fetchProviders().doOnSuccess(discoverObservable)); | |
} |
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
public class ResourceProvider { | |
private final Context context; | |
@Inject | |
public ResourceProvider(Context context) { | |
this.context = context; | |
} | |
@NonNull |
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
package me.mesmo.app.presentation.views; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.support.annotation.ColorInt; | |
import android.support.annotation.Nullable; | |
import android.support.v7.widget.AppCompatTextView; | |
import android.text.Layout; |
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 java.util.concurrent.TimeUnit; | |
import io.reactivex.ObservableOperator; | |
import io.reactivex.Observer; | |
import io.reactivex.disposables.Disposable; | |
public class FilterWithTimeout<T> implements ObservableOperator<T, T> { | |
private final long intervalDuration; | |
private final TimeUnit unit; |
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
public class ViewModelInjectionFactory<VM extends ViewModel> implements ViewModelProvider.Factory { | |
private Lazy<VM> viewModel; | |
@Inject | |
public ViewModelInjectionFactory(Lazy<VM> viewModel) { | |
this.viewModel = viewModel; | |
} | |
@Override |
NewerOlder