|
@@ -19,12 +19,18 @@ import com.miekir.mvp.model.MvpModel;
|
|
|
public abstract class BasePresenter extends ViewModel {
|
|
public abstract class BasePresenter extends ViewModel {
|
|
|
//private ThreadLocal<Integer> mThreadLocal = new ThreadLocal<>();
|
|
//private ThreadLocal<Integer> mThreadLocal = new ThreadLocal<>();
|
|
|
|
|
|
|
|
|
|
+ public BasePresenter() {
|
|
|
|
|
+ // todo 是否要初始化
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* ViewModel的生命周期和Activity保持一致;在onStart()、onResume()、onPause()时调用LiveData的setValue才会通知观察者
|
|
* ViewModel的生命周期和Activity保持一致;在onStart()、onResume()、onPause()时调用LiveData的setValue才会通知观察者
|
|
|
* liveData在ViewModel(Presenter)创建,然后提供方法给Activity获取,方便取消观察
|
|
* liveData在ViewModel(Presenter)创建,然后提供方法给Activity获取,方便取消观察
|
|
|
- * 由于使用了AspectJ,这个变量名和属性不能改动,否则AspectJ会拿不到值
|
|
|
|
|
*/
|
|
*/
|
|
|
public MutableLiveData<DataResult> liveData = new MutableLiveData<DataResult>();
|
|
public MutableLiveData<DataResult> liveData = new MutableLiveData<DataResult>();
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 由于使用了AspectJ,这个变量名和属性不能改动,否则AspectJ会拿不到值
|
|
|
|
|
+ */
|
|
|
public MutableLiveData<DataResult> dialogLiveData = new MutableLiveData<DataResult>();
|
|
public MutableLiveData<DataResult> dialogLiveData = new MutableLiveData<DataResult>();
|
|
|
|
|
|
|
|
public MutableLiveData<DataResult> getLiveData() {
|
|
public MutableLiveData<DataResult> getLiveData() {
|