π My name is Sergey and I'm mobile developer currently working at Raiffeisen Bank Russia.
Among other things sometimes I make mods for CD Projekt RED games, just for fun
Udacity Android Developer Nanodegree, project 2.
In RecipeListFragment.java there is a need to implement the onSaveInstanceState and onActivityCreated methods to preserve and restore user or app state. We need to retain & restore the RecyclerView scroll position.
RecipeListFragment.zip
Hi , i am just beginner in rx android and dagger2 . i tried implementing some samples from your codebase..this is my code sample..
LocalDataSource.java
@Singleton
public class LocalDataSource implements DataSource {
@Override
public Observable getServerSettings() {
return mDBHelper.createQuery(ServerSettingsEntry.TABLE_NAME,
DbUtils.getSelectAllQuery(ServerSettingsEntry.TABLE_NAME))
.mapToOne(DbUtils::getServerSettings);
Repository.java
@Singleton
public class MyRepository implements DataSource {
@Override
public Observable<ServerSettings> getServerSettings() {
return mLocalDataSource.getServerSettings().compose(RxUtils.applySchedulers());
LoginPresenter.java
public class LoginPresenter implements LoginActivityContract.Presenter{
@Override
public void checkServerDbSynced() {
mCompositeDisposable.clear();
Disposable subscription = mRepository
.getServerSettings()
.doOnSubscribe(disposable -> {
Timber.d(" onSubscribe");
mView.showLoadingIndicator(true, "Checking Server ....");
})
.subscribe(serverSettings -> {
if (serverSettings == null) {
Timber.d("*** Server Db Synced ****" + "\n" + "*** Checking Licence Key **** ");
checkLicenceKey();
} else {
Timber.d("*** Server Db Not Synced *** " + " \n" + "*** Opening Login Dialog ****");
mView.showLoadingIndicator(false, "Db Not Synced ....");
mView.openLoginDialog();
}
},
throwable -> {
mView.showErrorMessage(throwable.getLocalizedMessage());
});
mCompositeDisposable.add(subscription);
}
}
@Override
public void subscribe() {
checkServerDbSynced();
}
@Override
public void unSubscribe() {
mCompositeDisposable.clear();
}
The problem is the statements inside subscribe is not being called. When debugging,
I noticed that after this line composite disposable.add(subscription); Observable.subscribe() is not called!!β¦
Kindly help β¦!!
PS :if i use if (Thread.currentThread() == Looper.getMainLooper().getThread()) throw new IllegalStateException(); inside the onSubscribe ...the error is thrown and caught in OnError method of the subscribe to check whether executed on the main thread..
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.