Commit 43bbdc701cbf09a13e396be52e07febd6b7601eb
1 parent
83168fea
代码测试基类
Showing
2 changed files
with
6 additions
and
2 deletions
app/strike/src/main/java/com/cnlive/strike/MyFragmentView.java
| 1 | 1 | package com.cnlive.strike; |
| 2 | 2 | |
| 3 | -import com.hannesdorfmann.mosby3.mvp.MvpView; | |
| 3 | +import com.cnlive.libs.base.frame.view.BaseView; | |
| 4 | 4 | |
| 5 | -public class MyFragmentView implements MvpView { | |
| 5 | +public class MyFragmentView extends BaseView { | |
| 6 | 6 | MyFragment fragment; |
| 7 | 7 | |
| 8 | 8 | public MyFragmentView(MyFragment fragment) { | ... | ... |
core/base/src/main/java/com/cnlive/libs/base/frame/fragment/BaseFragment.java
| 1 | 1 | package com.cnlive.libs.base.frame.fragment; |
| 2 | 2 | |
| 3 | 3 | import android.os.Bundle; |
| 4 | +import android.util.Log; | |
| 4 | 5 | import android.view.LayoutInflater; |
| 5 | 6 | import android.view.View; |
| 6 | 7 | import android.view.ViewGroup; |
| ... | ... | @@ -15,6 +16,7 @@ import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter; |
| 15 | 16 | import com.hannesdorfmann.mosby3.mvp.MvpPresenter; |
| 16 | 17 | import com.hannesdorfmann.mosby3.mvp.MvpView; |
| 17 | 18 | |
| 19 | + | |
| 18 | 20 | /** |
| 19 | 21 | * MVP Databinding Base Fragment |
| 20 | 22 | * |
| ... | ... | @@ -40,11 +42,13 @@ public abstract class BaseFragment<V extends MvpView, P extends MvpBasePresenter |
| 40 | 42 | |
| 41 | 43 | @NonNull |
| 42 | 44 | public V createView() { |
| 45 | + Log.e("sssss", "createView: "); | |
| 43 | 46 | return ReflectUtil.instanceView(0, this.getClass(), this, BaseView.class); |
| 44 | 47 | } |
| 45 | 48 | |
| 46 | 49 | @Override |
| 47 | 50 | public P createPresenter() { |
| 51 | + Log.e("sssss", "createPresenter: "); | |
| 48 | 52 | return ReflectUtil.instancePresenter(1, this.getClass(), BasePresenter.class); |
| 49 | 53 | } |
| 50 | 54 | ... | ... |