Upgrade to nucleus 3
This commit is contained in:
@@ -11,7 +11,6 @@ import nucleus.presenter.Presenter;
|
||||
import nucleus.view.PresenterLifecycleDelegate;
|
||||
import nucleus.view.ViewWithPresenter;
|
||||
|
||||
|
||||
/**
|
||||
* This class is an example of how an activity could controls it's presenter.
|
||||
* You can inherit from this class or copy/paste this class's code to
|
||||
@@ -87,8 +86,9 @@ public abstract class BaseRxActivity<P extends Presenter> extends BaseActivity i
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
presenterDelegate.onPause(isFinishing());
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
presenterDelegate.onDropView();
|
||||
presenterDelegate.onDestroy(!isChangingConfigurations());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package eu.kanade.tachiyomi.ui.base.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
|
||||
import eu.kanade.tachiyomi.App;
|
||||
import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter;
|
||||
@@ -85,13 +84,14 @@ public abstract class BaseRxFragment<P extends Presenter> extends BaseFragment i
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
presenterDelegate.onPause(getActivity().isFinishing() || isRemoving(this));
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
presenterDelegate.onDropView();
|
||||
}
|
||||
|
||||
private static boolean isRemoving(Fragment fragment) {
|
||||
Fragment parent = fragment.getParentFragment();
|
||||
return fragment.isRemoving() || (parent != null && isRemoving(parent));
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
presenterDelegate.onDestroy(!getActivity().isChangingConfigurations());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user