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 ObservableManager obsManager = new ObservableManager(EventBus.getDefault()); | |
@Override | |
public Subscription getStores() { | |
// Get the observable if exists and is not too old | |
Observable<StoresList> observable = obsManager.get(ObservableManager.Types.STORES); | |
if (observable == null) { | |
// If is null create it and us cache to keep it in memeroy | |
observable = api.getStoresList() | |
.compose(applySchedulers(api.getStoresList())) |
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
abstract class GenericAdapter<T> : RecyclerView.Adapter<RecyclerView.ViewHolder> { | |
var listItems: List<T> | |
constructor(listItems: List<T>) { | |
this.listItems = listItems | |
} | |
constructor() { |