Authentication with batoto done
This commit is contained in:
@@ -25,6 +25,9 @@ import eu.kanade.mangafeed.data.helpers.SourceManager;
|
||||
import eu.kanade.mangafeed.sources.base.Source;
|
||||
import eu.kanade.mangafeed.ui.activity.base.BaseActivity;
|
||||
import rx.Observable;
|
||||
import rx.android.schedulers.AndroidSchedulers;
|
||||
import rx.schedulers.Schedulers;
|
||||
import timber.log.Timber;
|
||||
|
||||
public class SettingsAccountsFragment extends PreferenceFragment {
|
||||
|
||||
@@ -112,6 +115,14 @@ public class SettingsAccountsFragment extends PreferenceFragment {
|
||||
username.getText().toString(),
|
||||
password.getText().toString());
|
||||
|
||||
source.login(username.getText().toString(), password.getText().toString())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(result -> {
|
||||
Timber.e("Result is " + result);
|
||||
});
|
||||
|
||||
|
||||
super.onDialogClosed(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -56,8 +56,12 @@ public class SourceFragment extends BaseRxFragment<SourcePresenter> {
|
||||
public void onSourceClick(int position) {
|
||||
Source source = adapter.getItem(position);
|
||||
|
||||
CatalogueFragment fragment = CatalogueFragment.newInstance(source.getSourceId());
|
||||
activity.setFragment(fragment);
|
||||
if (getPresenter().isValidSource(source)) {
|
||||
CatalogueFragment fragment = CatalogueFragment.newInstance(source.getSourceId());
|
||||
activity.setFragment(fragment);
|
||||
} else {
|
||||
// TODO ask for password
|
||||
}
|
||||
}
|
||||
|
||||
private void createAdapter() {
|
||||
|
||||
Reference in New Issue
Block a user