diff --git a/App Architectrue.puml b/App Architectrue.puml index 41338b8..3e8b539 100644 --- a/App Architectrue.puml +++ b/App Architectrue.puml @@ -9,34 +9,34 @@ skinparam activityBorderColor #ef5345 skinparam activityFontName Impact rectangle View #lightGreen -rectangle MvpView #white -rectangle MvpPresenter #white +rectangle AbstractView #white +rectangle AbstractPresenter #white rectangle Presenter #lightGreen -rectangle AppDataManager #lightGreen -rectangle ApiHelper #white -rectangle AppApiHelper #lightGreen +rectangle DataManager #lightGreen +rectangle HttpHelper #white +rectangle HttpHelperImpl #lightGreen rectangle PreferenceHelper #white -rectangle AppPreferenceHelper #lightGreen +rectangle PreferenceHelperImpl #lightGreen rectangle DbHelper #white -rectangle AppDbHelper #lightGreen - -View -- MvpView -View -r-> MvpPresenter -MvpPresenter -l-> View -MvpPresenter -- Presenter -Presenter -l-> MvpView -MvpView -r-> Presenter -Presenter -r-> AppDataManager -AppDataManager -l-> Presenter -AppDataManager -r-> PreferenceHelper -PreferenceHelper -l-> AppDataManager -PreferenceHelper -r- AppPreferenceHelper -AppDataManager -u-> ApiHelper -ApiHelper -d-> AppDataManager -ApiHelper -u-> AppApiHelper -AppDataManager -d-> DbHelper -DbHelper -u-> AppDataManager -DbHelper -d-> AppDbHelper +rectangle DBHelperImpl #lightGreen + +View -- AbstractView +View -r-> AbstractPresenter +AbstractPresenter -l-> View +AbstractPresenter -- Presenter +Presenter -l-> AbstractView +AbstractView -r-> Presenter +Presenter -r-> DataManager +DataManager -l-> Presenter +DataManager -r-> PreferenceHelper +PreferenceHelper -l-> DataManager +PreferenceHelper -r- PreferenceHelperImpl +DataManager -u-> HttpHelper +HttpHelper -d-> DataManager +HttpHelper -u- HttpHelperImpl +DataManager -d-> DbHelper +DbHelper -u-> DataManager +DbHelper -d- DBHelperImpl diff --git a/app/src/main/java/json/chao/com/wanandroid/base/activity/BaseActivity.java b/app/src/main/java/json/chao/com/wanandroid/base/activity/BaseActivity.java index 1c1e0a0..48e4e51 100644 --- a/app/src/main/java/json/chao/com/wanandroid/base/activity/BaseActivity.java +++ b/app/src/main/java/json/chao/com/wanandroid/base/activity/BaseActivity.java @@ -11,9 +11,8 @@ import dagger.android.AndroidInjector; import dagger.android.DispatchingAndroidInjector; import dagger.android.support.HasSupportFragmentInjector; -import json.chao.com.wanandroid.R; import json.chao.com.wanandroid.base.presenter.AbstractPresenter; -import json.chao.com.wanandroid.base.view.BaseView; +import json.chao.com.wanandroid.base.view.AbstractView; import json.chao.com.wanandroid.utils.CommonUtils; /** @@ -25,7 +24,7 @@ public abstract class BaseActivity extends AbstractSimpleActivity implements HasSupportFragmentInjector, - BaseView { + AbstractView { @Inject DispatchingAndroidInjector mFragmentDispatchingAndroidInjector; diff --git a/app/src/main/java/json/chao/com/wanandroid/base/activity/AbstractRootActivity.java b/app/src/main/java/json/chao/com/wanandroid/base/activity/BaseRootActivity.java similarity index 97% rename from app/src/main/java/json/chao/com/wanandroid/base/activity/AbstractRootActivity.java rename to app/src/main/java/json/chao/com/wanandroid/base/activity/BaseRootActivity.java index 053c91d..b3550c9 100644 --- a/app/src/main/java/json/chao/com/wanandroid/base/activity/AbstractRootActivity.java +++ b/app/src/main/java/json/chao/com/wanandroid/base/activity/BaseRootActivity.java @@ -15,7 +15,7 @@ * @date 2018/3/30 */ -public abstract class AbstractRootActivity extends BaseActivity { +public abstract class BaseRootActivity extends BaseActivity { private static final int NORMAL_STATE = 0; private static final int LOADING_STATE = 1; diff --git a/app/src/main/java/json/chao/com/wanandroid/base/fragment/BaseDialogFragment.java b/app/src/main/java/json/chao/com/wanandroid/base/fragment/BaseDialogFragment.java index 1f58514..3fbfaf6 100644 --- a/app/src/main/java/json/chao/com/wanandroid/base/fragment/BaseDialogFragment.java +++ b/app/src/main/java/json/chao/com/wanandroid/base/fragment/BaseDialogFragment.java @@ -6,9 +6,8 @@ import javax.inject.Inject; import dagger.android.support.AndroidSupportInjection; -import json.chao.com.wanandroid.R; import json.chao.com.wanandroid.base.presenter.AbstractPresenter; -import json.chao.com.wanandroid.base.view.BaseView; +import json.chao.com.wanandroid.base.view.AbstractView; import json.chao.com.wanandroid.utils.CommonUtils; /** @@ -19,7 +18,7 @@ */ public abstract class BaseDialogFragment extends AbstractSimpleDialogFragment - implements BaseView { + implements AbstractView { @Inject protected T mPresenter; diff --git a/app/src/main/java/json/chao/com/wanandroid/base/fragment/BaseFragment.java b/app/src/main/java/json/chao/com/wanandroid/base/fragment/BaseFragment.java index 12bcc2a..7f77573 100644 --- a/app/src/main/java/json/chao/com/wanandroid/base/fragment/BaseFragment.java +++ b/app/src/main/java/json/chao/com/wanandroid/base/fragment/BaseFragment.java @@ -8,9 +8,8 @@ import javax.inject.Inject; import dagger.android.support.AndroidSupportInjection; -import json.chao.com.wanandroid.R; import json.chao.com.wanandroid.base.presenter.AbstractPresenter; -import json.chao.com.wanandroid.base.view.BaseView; +import json.chao.com.wanandroid.base.view.AbstractView; import json.chao.com.wanandroid.utils.CommonUtils; /** @@ -21,7 +20,7 @@ */ public abstract class BaseFragment extends AbstractSimpleFragment - implements BaseView { + implements AbstractView { @Inject protected T mPresenter; diff --git a/app/src/main/java/json/chao/com/wanandroid/base/fragment/AbstractRootFragment.java b/app/src/main/java/json/chao/com/wanandroid/base/fragment/BaseRootFragment.java similarity index 97% rename from app/src/main/java/json/chao/com/wanandroid/base/fragment/AbstractRootFragment.java rename to app/src/main/java/json/chao/com/wanandroid/base/fragment/BaseRootFragment.java index a3fa1ac..e20e0a0 100644 --- a/app/src/main/java/json/chao/com/wanandroid/base/fragment/AbstractRootFragment.java +++ b/app/src/main/java/json/chao/com/wanandroid/base/fragment/BaseRootFragment.java @@ -15,7 +15,7 @@ * @date 2018/3/30 */ -public abstract class AbstractRootFragment extends BaseFragment { +public abstract class BaseRootFragment extends BaseFragment { private static final int NORMAL_STATE = 0; private static final int LOADING_STATE = 1; diff --git a/app/src/main/java/json/chao/com/wanandroid/base/presenter/AbstractPresenter.java b/app/src/main/java/json/chao/com/wanandroid/base/presenter/AbstractPresenter.java index 5637d75..8cc1def 100644 --- a/app/src/main/java/json/chao/com/wanandroid/base/presenter/AbstractPresenter.java +++ b/app/src/main/java/json/chao/com/wanandroid/base/presenter/AbstractPresenter.java @@ -1,7 +1,7 @@ package json.chao.com.wanandroid.base.presenter; import io.reactivex.disposables.Disposable; -import json.chao.com.wanandroid.base.view.BaseView; +import json.chao.com.wanandroid.base.view.AbstractView; /** * Presenter 基类 @@ -10,7 +10,7 @@ * @date 2017/11/27 */ -public interface AbstractPresenter { +public interface AbstractPresenter { /** * 注入View diff --git a/app/src/main/java/json/chao/com/wanandroid/base/presenter/BasePresenter.java b/app/src/main/java/json/chao/com/wanandroid/base/presenter/BasePresenter.java index 668cc89..f193c9b 100644 --- a/app/src/main/java/json/chao/com/wanandroid/base/presenter/BasePresenter.java +++ b/app/src/main/java/json/chao/com/wanandroid/base/presenter/BasePresenter.java @@ -2,7 +2,7 @@ import io.reactivex.disposables.CompositeDisposable; import io.reactivex.disposables.Disposable; -import json.chao.com.wanandroid.base.view.BaseView; +import json.chao.com.wanandroid.base.view.AbstractView; import json.chao.com.wanandroid.core.DataManager; /** @@ -13,7 +13,7 @@ * @date 2017/11/28 */ -public class BasePresenter implements AbstractPresenter { +public class BasePresenter implements AbstractPresenter { protected T mView; private CompositeDisposable compositeDisposable; diff --git a/app/src/main/java/json/chao/com/wanandroid/base/view/BaseView.java b/app/src/main/java/json/chao/com/wanandroid/base/view/AbstractView.java similarity index 96% rename from app/src/main/java/json/chao/com/wanandroid/base/view/BaseView.java rename to app/src/main/java/json/chao/com/wanandroid/base/view/AbstractView.java index e59bfce..f409a2a 100644 --- a/app/src/main/java/json/chao/com/wanandroid/base/view/BaseView.java +++ b/app/src/main/java/json/chao/com/wanandroid/base/view/AbstractView.java @@ -8,7 +8,7 @@ * @date 2017/11/27 */ -public interface BaseView { +public interface AbstractView { /** * Use night mode diff --git a/app/src/main/java/json/chao/com/wanandroid/contract/hierarchy/KnowledgeHierarchyContract.java b/app/src/main/java/json/chao/com/wanandroid/contract/hierarchy/KnowledgeHierarchyContract.java index 71b929b..01bc366 100644 --- a/app/src/main/java/json/chao/com/wanandroid/contract/hierarchy/KnowledgeHierarchyContract.java +++ b/app/src/main/java/json/chao/com/wanandroid/contract/hierarchy/KnowledgeHierarchyContract.java @@ -3,8 +3,8 @@ import java.util.List; import json.chao.com.wanandroid.base.presenter.AbstractPresenter; +import json.chao.com.wanandroid.base.view.AbstractView; import json.chao.com.wanandroid.core.bean.hierarchy.KnowledgeHierarchyData; -import json.chao.com.wanandroid.base.view.BaseView; /** * @author quchao @@ -13,7 +13,7 @@ public interface KnowledgeHierarchyContract { - interface View extends BaseView { + interface View extends AbstractView { /** * Show Knowledge Hierarchy Data diff --git a/app/src/main/java/json/chao/com/wanandroid/contract/hierarchy/KnowledgeHierarchyDetailContract.java b/app/src/main/java/json/chao/com/wanandroid/contract/hierarchy/KnowledgeHierarchyDetailContract.java index 1f7b37a..c83eae4 100644 --- a/app/src/main/java/json/chao/com/wanandroid/contract/hierarchy/KnowledgeHierarchyDetailContract.java +++ b/app/src/main/java/json/chao/com/wanandroid/contract/hierarchy/KnowledgeHierarchyDetailContract.java @@ -1,7 +1,7 @@ package json.chao.com.wanandroid.contract.hierarchy; import json.chao.com.wanandroid.base.presenter.AbstractPresenter; -import json.chao.com.wanandroid.base.view.BaseView; +import json.chao.com.wanandroid.base.view.AbstractView; /** * @author quchao @@ -10,7 +10,7 @@ public interface KnowledgeHierarchyDetailContract { - interface View extends BaseView { + interface View extends AbstractView { /** * Show switch project diff --git a/app/src/main/java/json/chao/com/wanandroid/contract/hierarchy/KnowledgeHierarchyListContract.java b/app/src/main/java/json/chao/com/wanandroid/contract/hierarchy/KnowledgeHierarchyListContract.java index 7d0439f..790c04a 100644 --- a/app/src/main/java/json/chao/com/wanandroid/contract/hierarchy/KnowledgeHierarchyListContract.java +++ b/app/src/main/java/json/chao/com/wanandroid/contract/hierarchy/KnowledgeHierarchyListContract.java @@ -1,8 +1,8 @@ package json.chao.com.wanandroid.contract.hierarchy; import json.chao.com.wanandroid.base.presenter.AbstractPresenter; +import json.chao.com.wanandroid.base.view.AbstractView; import json.chao.com.wanandroid.core.bean.main.collect.FeedArticleData; -import json.chao.com.wanandroid.base.view.BaseView; import json.chao.com.wanandroid.core.bean.main.collect.FeedArticleListData; /** @@ -12,7 +12,7 @@ public interface KnowledgeHierarchyListContract { - interface View extends BaseView { + interface View extends AbstractView { /** * Show Knowledge Hierarchy Detail Data diff --git a/app/src/main/java/json/chao/com/wanandroid/contract/main/ArticleDetailContract.java b/app/src/main/java/json/chao/com/wanandroid/contract/main/ArticleDetailContract.java index f68da48..0eb555d 100644 --- a/app/src/main/java/json/chao/com/wanandroid/contract/main/ArticleDetailContract.java +++ b/app/src/main/java/json/chao/com/wanandroid/contract/main/ArticleDetailContract.java @@ -3,7 +3,7 @@ import com.tbruyelle.rxpermissions2.RxPermissions; import json.chao.com.wanandroid.base.presenter.AbstractPresenter; -import json.chao.com.wanandroid.base.view.BaseView; +import json.chao.com.wanandroid.base.view.AbstractView; import json.chao.com.wanandroid.core.bean.main.collect.FeedArticleListData; /** @@ -13,7 +13,7 @@ public interface ArticleDetailContract { - interface View extends BaseView { + interface View extends AbstractView { /** * Show collect article data diff --git a/app/src/main/java/json/chao/com/wanandroid/contract/main/CollectContract.java b/app/src/main/java/json/chao/com/wanandroid/contract/main/CollectContract.java index a3947e0..598ccc7 100644 --- a/app/src/main/java/json/chao/com/wanandroid/contract/main/CollectContract.java +++ b/app/src/main/java/json/chao/com/wanandroid/contract/main/CollectContract.java @@ -1,7 +1,7 @@ package json.chao.com.wanandroid.contract.main; import json.chao.com.wanandroid.base.presenter.AbstractPresenter; -import json.chao.com.wanandroid.base.view.BaseView; +import json.chao.com.wanandroid.base.view.AbstractView; import json.chao.com.wanandroid.core.bean.main.collect.FeedArticleData; import json.chao.com.wanandroid.core.bean.main.collect.FeedArticleListData; @@ -12,7 +12,7 @@ public interface CollectContract { - interface View extends BaseView { + interface View extends AbstractView { /** * Show collect list diff --git a/app/src/main/java/json/chao/com/wanandroid/contract/main/LoginContract.java b/app/src/main/java/json/chao/com/wanandroid/contract/main/LoginContract.java index 740badb..4d05dfd 100644 --- a/app/src/main/java/json/chao/com/wanandroid/contract/main/LoginContract.java +++ b/app/src/main/java/json/chao/com/wanandroid/contract/main/LoginContract.java @@ -2,7 +2,7 @@ import json.chao.com.wanandroid.base.presenter.AbstractPresenter; import json.chao.com.wanandroid.core.bean.main.login.LoginData; -import json.chao.com.wanandroid.base.view.BaseView; +import json.chao.com.wanandroid.base.view.AbstractView; /** * @author quchao @@ -11,7 +11,7 @@ public interface LoginContract { - interface View extends BaseView { + interface View extends AbstractView { /** * Show login data diff --git a/app/src/main/java/json/chao/com/wanandroid/contract/main/MainContract.java b/app/src/main/java/json/chao/com/wanandroid/contract/main/MainContract.java index 760b132..073f316 100644 --- a/app/src/main/java/json/chao/com/wanandroid/contract/main/MainContract.java +++ b/app/src/main/java/json/chao/com/wanandroid/contract/main/MainContract.java @@ -1,7 +1,7 @@ package json.chao.com.wanandroid.contract.main; import json.chao.com.wanandroid.base.presenter.AbstractPresenter; -import json.chao.com.wanandroid.base.view.BaseView; +import json.chao.com.wanandroid.base.view.AbstractView; /** * @author quchao @@ -10,7 +10,7 @@ public interface MainContract { - interface View extends BaseView { + interface View extends AbstractView { /** * Show switch project diff --git a/app/src/main/java/json/chao/com/wanandroid/contract/main/RegisterContract.java b/app/src/main/java/json/chao/com/wanandroid/contract/main/RegisterContract.java index d4f3b62..bb7434d 100644 --- a/app/src/main/java/json/chao/com/wanandroid/contract/main/RegisterContract.java +++ b/app/src/main/java/json/chao/com/wanandroid/contract/main/RegisterContract.java @@ -1,7 +1,7 @@ package json.chao.com.wanandroid.contract.main; import json.chao.com.wanandroid.base.presenter.AbstractPresenter; -import json.chao.com.wanandroid.base.view.BaseView; +import json.chao.com.wanandroid.base.view.AbstractView; import json.chao.com.wanandroid.core.bean.main.login.LoginData; /** @@ -10,7 +10,7 @@ */ public interface RegisterContract { - interface View extends BaseView { + interface View extends AbstractView { /** * Show register data diff --git a/app/src/main/java/json/chao/com/wanandroid/contract/main/SearchContract.java b/app/src/main/java/json/chao/com/wanandroid/contract/main/SearchContract.java index 8ae8e15..1a1f942 100644 --- a/app/src/main/java/json/chao/com/wanandroid/contract/main/SearchContract.java +++ b/app/src/main/java/json/chao/com/wanandroid/contract/main/SearchContract.java @@ -4,7 +4,7 @@ import json.chao.com.wanandroid.base.presenter.AbstractPresenter; import json.chao.com.wanandroid.core.bean.main.search.TopSearchData; -import json.chao.com.wanandroid.base.view.BaseView; +import json.chao.com.wanandroid.base.view.AbstractView; import json.chao.com.wanandroid.core.dao.HistoryData; /** @@ -14,7 +14,7 @@ public interface SearchContract { - interface View extends BaseView { + interface View extends AbstractView { /** * Show history data diff --git a/app/src/main/java/json/chao/com/wanandroid/contract/main/SearchListContract.java b/app/src/main/java/json/chao/com/wanandroid/contract/main/SearchListContract.java index 1b56a7d..7c1b167 100644 --- a/app/src/main/java/json/chao/com/wanandroid/contract/main/SearchListContract.java +++ b/app/src/main/java/json/chao/com/wanandroid/contract/main/SearchListContract.java @@ -2,7 +2,7 @@ import json.chao.com.wanandroid.base.presenter.AbstractPresenter; -import json.chao.com.wanandroid.base.view.BaseView; +import json.chao.com.wanandroid.base.view.AbstractView; import json.chao.com.wanandroid.core.bean.main.collect.FeedArticleData; import json.chao.com.wanandroid.core.bean.main.collect.FeedArticleListData; @@ -13,7 +13,7 @@ public interface SearchListContract { - interface View extends BaseView { + interface View extends AbstractView { /** * Show search list diff --git a/app/src/main/java/json/chao/com/wanandroid/contract/main/SettingContract.java b/app/src/main/java/json/chao/com/wanandroid/contract/main/SettingContract.java index eb0c60f..5731b6d 100644 --- a/app/src/main/java/json/chao/com/wanandroid/contract/main/SettingContract.java +++ b/app/src/main/java/json/chao/com/wanandroid/contract/main/SettingContract.java @@ -1,7 +1,7 @@ package json.chao.com.wanandroid.contract.main; import json.chao.com.wanandroid.base.presenter.AbstractPresenter; -import json.chao.com.wanandroid.base.view.BaseView; +import json.chao.com.wanandroid.base.view.AbstractView; /** * @author quchao @@ -10,7 +10,7 @@ public interface SettingContract { - interface View extends BaseView { + interface View extends AbstractView { } diff --git a/app/src/main/java/json/chao/com/wanandroid/contract/main/SplashContract.java b/app/src/main/java/json/chao/com/wanandroid/contract/main/SplashContract.java index 00c3b15..9f9e8b2 100644 --- a/app/src/main/java/json/chao/com/wanandroid/contract/main/SplashContract.java +++ b/app/src/main/java/json/chao/com/wanandroid/contract/main/SplashContract.java @@ -1,7 +1,7 @@ package json.chao.com.wanandroid.contract.main; import json.chao.com.wanandroid.base.presenter.AbstractPresenter; -import json.chao.com.wanandroid.base.view.BaseView; +import json.chao.com.wanandroid.base.view.AbstractView; /** * @author quchao @@ -10,7 +10,7 @@ public interface SplashContract { - interface View extends BaseView { + interface View extends AbstractView { /** * after some time jump to main page */ diff --git a/app/src/main/java/json/chao/com/wanandroid/contract/main/UsageDialogContract.java b/app/src/main/java/json/chao/com/wanandroid/contract/main/UsageDialogContract.java index b835933..b80dc54 100644 --- a/app/src/main/java/json/chao/com/wanandroid/contract/main/UsageDialogContract.java +++ b/app/src/main/java/json/chao/com/wanandroid/contract/main/UsageDialogContract.java @@ -3,7 +3,7 @@ import java.util.List; import json.chao.com.wanandroid.base.presenter.AbstractPresenter; -import json.chao.com.wanandroid.base.view.BaseView; +import json.chao.com.wanandroid.base.view.AbstractView; import json.chao.com.wanandroid.core.bean.main.search.UsefulSiteData; @@ -14,7 +14,7 @@ public interface UsageDialogContract { - interface View extends BaseView { + interface View extends AbstractView { /** * Show useful sites diff --git a/app/src/main/java/json/chao/com/wanandroid/contract/mainpager/MainPagerContract.java b/app/src/main/java/json/chao/com/wanandroid/contract/mainpager/MainPagerContract.java index 704743a..ce54a20 100644 --- a/app/src/main/java/json/chao/com/wanandroid/contract/mainpager/MainPagerContract.java +++ b/app/src/main/java/json/chao/com/wanandroid/contract/mainpager/MainPagerContract.java @@ -2,10 +2,10 @@ import java.util.List; +import json.chao.com.wanandroid.base.view.AbstractView; import json.chao.com.wanandroid.core.bean.main.banner.BannerData; import json.chao.com.wanandroid.core.bean.main.collect.FeedArticleData; import json.chao.com.wanandroid.base.presenter.AbstractPresenter; -import json.chao.com.wanandroid.base.view.BaseView; import json.chao.com.wanandroid.core.bean.main.collect.FeedArticleListData; /** @@ -15,7 +15,7 @@ public interface MainPagerContract { - interface View extends BaseView { + interface View extends AbstractView { /** * Show auto login success diff --git a/app/src/main/java/json/chao/com/wanandroid/contract/navigation/NavigationContract.java b/app/src/main/java/json/chao/com/wanandroid/contract/navigation/NavigationContract.java index 95bf173..ed377e4 100644 --- a/app/src/main/java/json/chao/com/wanandroid/contract/navigation/NavigationContract.java +++ b/app/src/main/java/json/chao/com/wanandroid/contract/navigation/NavigationContract.java @@ -4,7 +4,7 @@ import json.chao.com.wanandroid.core.bean.navigation.NavigationListData; import json.chao.com.wanandroid.base.presenter.AbstractPresenter; -import json.chao.com.wanandroid.base.view.BaseView; +import json.chao.com.wanandroid.base.view.AbstractView; /** * @author quchao @@ -13,7 +13,7 @@ public interface NavigationContract { - interface View extends BaseView { + interface View extends AbstractView { /** * Show navigation list data diff --git a/app/src/main/java/json/chao/com/wanandroid/contract/project/ProjectContract.java b/app/src/main/java/json/chao/com/wanandroid/contract/project/ProjectContract.java index 3236218..c36602d 100644 --- a/app/src/main/java/json/chao/com/wanandroid/contract/project/ProjectContract.java +++ b/app/src/main/java/json/chao/com/wanandroid/contract/project/ProjectContract.java @@ -4,7 +4,7 @@ import json.chao.com.wanandroid.base.presenter.AbstractPresenter; import json.chao.com.wanandroid.core.bean.project.ProjectClassifyData; -import json.chao.com.wanandroid.base.view.BaseView; +import json.chao.com.wanandroid.base.view.AbstractView; /** * @author quchao @@ -13,7 +13,7 @@ public interface ProjectContract { - interface View extends BaseView { + interface View extends AbstractView { /** * Show project classify data diff --git a/app/src/main/java/json/chao/com/wanandroid/contract/project/ProjectListContract.java b/app/src/main/java/json/chao/com/wanandroid/contract/project/ProjectListContract.java index b727f16..266f1e9 100644 --- a/app/src/main/java/json/chao/com/wanandroid/contract/project/ProjectListContract.java +++ b/app/src/main/java/json/chao/com/wanandroid/contract/project/ProjectListContract.java @@ -1,10 +1,10 @@ package json.chao.com.wanandroid.contract.project; import json.chao.com.wanandroid.base.presenter.AbstractPresenter; +import json.chao.com.wanandroid.base.view.AbstractView; import json.chao.com.wanandroid.core.bean.main.collect.FeedArticleData; import json.chao.com.wanandroid.core.bean.main.collect.FeedArticleListData; import json.chao.com.wanandroid.core.bean.project.ProjectListData; -import json.chao.com.wanandroid.base.view.BaseView; /** * @author quchao @@ -13,7 +13,7 @@ public interface ProjectListContract { - interface View extends BaseView { + interface View extends AbstractView { /** * Show project list data diff --git a/app/src/main/java/json/chao/com/wanandroid/ui/hierarchy/fragment/KnowledgeHierarchyFragment.java b/app/src/main/java/json/chao/com/wanandroid/ui/hierarchy/fragment/KnowledgeHierarchyFragment.java index 9e33a18..eae5c5c 100644 --- a/app/src/main/java/json/chao/com/wanandroid/ui/hierarchy/fragment/KnowledgeHierarchyFragment.java +++ b/app/src/main/java/json/chao/com/wanandroid/ui/hierarchy/fragment/KnowledgeHierarchyFragment.java @@ -13,7 +13,7 @@ import java.util.List; import butterknife.BindView; -import json.chao.com.wanandroid.base.fragment.AbstractRootFragment; +import json.chao.com.wanandroid.base.fragment.BaseRootFragment; import json.chao.com.wanandroid.core.bean.hierarchy.KnowledgeHierarchyData; import json.chao.com.wanandroid.R; import json.chao.com.wanandroid.app.Constants; @@ -28,7 +28,7 @@ * @date 2017/11/29 */ -public class KnowledgeHierarchyFragment extends AbstractRootFragment +public class KnowledgeHierarchyFragment extends BaseRootFragment implements KnowledgeHierarchyContract.View { @BindView(R.id.normal_view) diff --git a/app/src/main/java/json/chao/com/wanandroid/ui/hierarchy/fragment/KnowledgeHierarchyListFragment.java b/app/src/main/java/json/chao/com/wanandroid/ui/hierarchy/fragment/KnowledgeHierarchyListFragment.java index f713cc1..34f707d 100644 --- a/app/src/main/java/json/chao/com/wanandroid/ui/hierarchy/fragment/KnowledgeHierarchyListFragment.java +++ b/app/src/main/java/json/chao/com/wanandroid/ui/hierarchy/fragment/KnowledgeHierarchyListFragment.java @@ -11,7 +11,7 @@ import java.util.List; import butterknife.BindView; -import json.chao.com.wanandroid.base.fragment.AbstractRootFragment; +import json.chao.com.wanandroid.base.fragment.BaseRootFragment; import json.chao.com.wanandroid.component.RxBus; import json.chao.com.wanandroid.core.bean.main.collect.FeedArticleData; import json.chao.com.wanandroid.R; @@ -32,7 +32,7 @@ * @date 2018/2/23 */ -public class KnowledgeHierarchyListFragment extends AbstractRootFragment +public class KnowledgeHierarchyListFragment extends BaseRootFragment implements KnowledgeHierarchyListContract.View { @BindView(R.id.normal_view) diff --git a/app/src/main/java/json/chao/com/wanandroid/ui/main/activity/AboutUsActivity.java b/app/src/main/java/json/chao/com/wanandroid/ui/main/activity/AboutUsActivity.java index 29d4e81..7065ee0 100644 --- a/app/src/main/java/json/chao/com/wanandroid/ui/main/activity/AboutUsActivity.java +++ b/app/src/main/java/json/chao/com/wanandroid/ui/main/activity/AboutUsActivity.java @@ -139,6 +139,9 @@ public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { float fraction = 1f * (scrollRange + verticalOffset) / scrollRange; double minFraction = 0.1; double maxFraction = 0.8; + if (mScrollView == null || mAboutUsFab == null || mAboutUsFlyView == null) { + return; + } if (fraction < minFraction && misAppbarExpand) { misAppbarExpand = false; mAboutUsFab.animate().scaleX(0).scaleY(0); diff --git a/app/src/main/java/json/chao/com/wanandroid/ui/main/activity/CollectFragment.java b/app/src/main/java/json/chao/com/wanandroid/ui/main/activity/CollectFragment.java index cc8f604..d2d99ac 100644 --- a/app/src/main/java/json/chao/com/wanandroid/ui/main/activity/CollectFragment.java +++ b/app/src/main/java/json/chao/com/wanandroid/ui/main/activity/CollectFragment.java @@ -16,7 +16,7 @@ import butterknife.OnClick; import json.chao.com.wanandroid.R; import json.chao.com.wanandroid.app.Constants; -import json.chao.com.wanandroid.base.fragment.AbstractRootFragment; +import json.chao.com.wanandroid.base.fragment.BaseRootFragment; import json.chao.com.wanandroid.contract.main.CollectContract; import json.chao.com.wanandroid.core.bean.main.collect.FeedArticleData; import json.chao.com.wanandroid.core.bean.main.collect.FeedArticleListData; @@ -31,7 +31,7 @@ * @date 2018/2/27 */ -public class CollectFragment extends AbstractRootFragment implements CollectContract.View { +public class CollectFragment extends BaseRootFragment implements CollectContract.View { @BindView(R.id.normal_view) SmartRefreshLayout mRefreshLayout; diff --git a/app/src/main/java/json/chao/com/wanandroid/ui/main/activity/LoginActivity.java b/app/src/main/java/json/chao/com/wanandroid/ui/main/activity/LoginActivity.java index 3d78937..57488c8 100644 --- a/app/src/main/java/json/chao/com/wanandroid/ui/main/activity/LoginActivity.java +++ b/app/src/main/java/json/chao/com/wanandroid/ui/main/activity/LoginActivity.java @@ -16,10 +16,10 @@ import butterknife.BindView; import butterknife.OnClick; import json.chao.com.wanandroid.app.Constants; +import json.chao.com.wanandroid.base.activity.BaseActivity; import json.chao.com.wanandroid.component.RxBus; import json.chao.com.wanandroid.core.bean.main.login.LoginData; import json.chao.com.wanandroid.R; -import json.chao.com.wanandroid.base.activity.BaseActivity; import json.chao.com.wanandroid.contract.main.LoginContract; import json.chao.com.wanandroid.core.event.LoginEvent; import json.chao.com.wanandroid.presenter.main.LoginPresenter; diff --git a/app/src/main/java/json/chao/com/wanandroid/ui/main/activity/SearchListActivity.java b/app/src/main/java/json/chao/com/wanandroid/ui/main/activity/SearchListActivity.java index 927164c..d047dc2 100644 --- a/app/src/main/java/json/chao/com/wanandroid/ui/main/activity/SearchListActivity.java +++ b/app/src/main/java/json/chao/com/wanandroid/ui/main/activity/SearchListActivity.java @@ -21,7 +21,7 @@ import butterknife.OnClick; import json.chao.com.wanandroid.R; import json.chao.com.wanandroid.app.Constants; -import json.chao.com.wanandroid.base.activity.AbstractRootActivity; +import json.chao.com.wanandroid.base.activity.BaseRootActivity; import json.chao.com.wanandroid.component.RxBus; import json.chao.com.wanandroid.contract.main.SearchListContract; import json.chao.com.wanandroid.core.bean.main.collect.FeedArticleData; @@ -39,7 +39,7 @@ * @date 2018/3/13 */ -public class SearchListActivity extends AbstractRootActivity implements SearchListContract.View { +public class SearchListActivity extends BaseRootActivity implements SearchListContract.View { @BindView(R.id.common_toolbar) Toolbar mToolbar; diff --git a/app/src/main/java/json/chao/com/wanandroid/ui/mainpager/fragment/MainPagerFragment.java b/app/src/main/java/json/chao/com/wanandroid/ui/mainpager/fragment/MainPagerFragment.java index c84eccf..45c0ef2 100644 --- a/app/src/main/java/json/chao/com/wanandroid/ui/mainpager/fragment/MainPagerFragment.java +++ b/app/src/main/java/json/chao/com/wanandroid/ui/mainpager/fragment/MainPagerFragment.java @@ -20,7 +20,7 @@ import java.util.List; import butterknife.BindView; -import json.chao.com.wanandroid.base.fragment.AbstractRootFragment; +import json.chao.com.wanandroid.base.fragment.BaseRootFragment; import json.chao.com.wanandroid.component.RxBus; import json.chao.com.wanandroid.core.bean.main.banner.BannerData; import json.chao.com.wanandroid.core.bean.main.collect.FeedArticleData; @@ -45,7 +45,7 @@ * @date 2017/11/29 */ -public class MainPagerFragment extends AbstractRootFragment implements MainPagerContract.View { +public class MainPagerFragment extends BaseRootFragment implements MainPagerContract.View { @BindView(R.id.normal_view) SmartRefreshLayout mRefreshLayout; diff --git a/app/src/main/java/json/chao/com/wanandroid/ui/navigation/fragment/NavigationFragment.java b/app/src/main/java/json/chao/com/wanandroid/ui/navigation/fragment/NavigationFragment.java index f87ce58..f97e8a8 100644 --- a/app/src/main/java/json/chao/com/wanandroid/ui/navigation/fragment/NavigationFragment.java +++ b/app/src/main/java/json/chao/com/wanandroid/ui/navigation/fragment/NavigationFragment.java @@ -10,7 +10,7 @@ import java.util.List; import butterknife.BindView; -import json.chao.com.wanandroid.base.fragment.AbstractRootFragment; +import json.chao.com.wanandroid.base.fragment.BaseRootFragment; import json.chao.com.wanandroid.core.bean.navigation.NavigationListData; import json.chao.com.wanandroid.R; import json.chao.com.wanandroid.app.Constants; @@ -29,7 +29,7 @@ * @date 2018/2/11 */ -public class NavigationFragment extends AbstractRootFragment implements NavigationContract.View { +public class NavigationFragment extends BaseRootFragment implements NavigationContract.View { @BindView(R.id.navigation_tab_layout) VerticalTabLayout mTabLayout; diff --git a/app/src/main/java/json/chao/com/wanandroid/ui/project/fragment/ProjectFragment.java b/app/src/main/java/json/chao/com/wanandroid/ui/project/fragment/ProjectFragment.java index aec3756..1f7daa4 100644 --- a/app/src/main/java/json/chao/com/wanandroid/ui/project/fragment/ProjectFragment.java +++ b/app/src/main/java/json/chao/com/wanandroid/ui/project/fragment/ProjectFragment.java @@ -12,7 +12,7 @@ import java.util.List; import butterknife.BindView; -import json.chao.com.wanandroid.base.fragment.AbstractRootFragment; +import json.chao.com.wanandroid.base.fragment.BaseRootFragment; import json.chao.com.wanandroid.component.RxBus; import json.chao.com.wanandroid.core.bean.project.ProjectClassifyData; import json.chao.com.wanandroid.R; @@ -28,7 +28,7 @@ * @date 2018/2/11 */ -public class ProjectFragment extends AbstractRootFragment implements ProjectContract.View { +public class ProjectFragment extends BaseRootFragment implements ProjectContract.View { @BindView(R.id.project_tab_layout) SlidingTabLayout mTabLayout; diff --git a/app/src/main/java/json/chao/com/wanandroid/ui/project/fragment/ProjectListFragment.java b/app/src/main/java/json/chao/com/wanandroid/ui/project/fragment/ProjectListFragment.java index 841fa36..3774fda 100644 --- a/app/src/main/java/json/chao/com/wanandroid/ui/project/fragment/ProjectListFragment.java +++ b/app/src/main/java/json/chao/com/wanandroid/ui/project/fragment/ProjectListFragment.java @@ -13,7 +13,7 @@ import java.util.List; import butterknife.BindView; -import json.chao.com.wanandroid.base.fragment.AbstractRootFragment; +import json.chao.com.wanandroid.base.fragment.BaseRootFragment; import json.chao.com.wanandroid.core.bean.main.collect.FeedArticleData; import json.chao.com.wanandroid.core.bean.main.collect.FeedArticleListData; import json.chao.com.wanandroid.core.bean.project.ProjectListData; @@ -30,7 +30,7 @@ * @date 2018/2/24 */ -public class ProjectListFragment extends AbstractRootFragment implements ProjectListContract.View { +public class ProjectListFragment extends BaseRootFragment implements ProjectListContract.View { @BindView(R.id.normal_view) SmartRefreshLayout mRefreshLayout; diff --git a/app/src/main/java/json/chao/com/wanandroid/widget/BaseObserver.java b/app/src/main/java/json/chao/com/wanandroid/widget/BaseObserver.java index e462d91..e237804 100644 --- a/app/src/main/java/json/chao/com/wanandroid/widget/BaseObserver.java +++ b/app/src/main/java/json/chao/com/wanandroid/widget/BaseObserver.java @@ -4,10 +4,10 @@ import io.reactivex.observers.ResourceObserver; import json.chao.com.wanandroid.app.WanAndroidApp; +import json.chao.com.wanandroid.base.view.AbstractView; import json.chao.com.wanandroid.core.http.exception.ServerException; import json.chao.com.wanandroid.R; import json.chao.com.wanandroid.utils.LogHelper; -import json.chao.com.wanandroid.base.view.BaseView; import retrofit2.HttpException; /** @@ -19,25 +19,25 @@ public abstract class BaseObserver extends ResourceObserver { - private BaseView mView; + private AbstractView mView; private String mErrorMsg; private boolean isShowError = true; - protected BaseObserver(BaseView view){ + protected BaseObserver(AbstractView view){ this.mView = view; } - protected BaseObserver(BaseView view, String errorMsg){ + protected BaseObserver(AbstractView view, String errorMsg){ this.mView = view; this.mErrorMsg = errorMsg; } - protected BaseObserver(BaseView view, boolean isShowError){ + protected BaseObserver(AbstractView view, boolean isShowError){ this.mView = view; this.isShowError = isShowError; } - protected BaseObserver(BaseView view, String errorMsg, boolean isShowError){ + protected BaseObserver(AbstractView view, String errorMsg, boolean isShowError){ this.mView = view; this.mErrorMsg = errorMsg; this.isShowError = isShowError; diff --git a/app/src/main/java/json/chao/com/wanandroid/widget/BaseSubscribe.java b/app/src/main/java/json/chao/com/wanandroid/widget/BaseSubscribe.java index 44eb5ba..ac85add 100644 --- a/app/src/main/java/json/chao/com/wanandroid/widget/BaseSubscribe.java +++ b/app/src/main/java/json/chao/com/wanandroid/widget/BaseSubscribe.java @@ -5,7 +5,7 @@ import io.reactivex.subscribers.ResourceSubscriber; import json.chao.com.wanandroid.R; import json.chao.com.wanandroid.app.WanAndroidApp; -import json.chao.com.wanandroid.base.view.BaseView; +import json.chao.com.wanandroid.base.view.AbstractView; import json.chao.com.wanandroid.core.http.exception.ServerException; import json.chao.com.wanandroid.utils.LogHelper; import retrofit2.HttpException; @@ -17,25 +17,25 @@ public abstract class BaseSubscribe extends ResourceSubscriber { - private BaseView mView; + private AbstractView mView; private String mErrorMsg; private boolean isShowError = true; - protected BaseSubscribe(BaseView view){ + protected BaseSubscribe(AbstractView view){ this.mView = view; } - protected BaseSubscribe(BaseView view, String errorMsg){ + protected BaseSubscribe(AbstractView view, String errorMsg){ this.mView = view; this.mErrorMsg = errorMsg; } - protected BaseSubscribe(BaseView view, boolean isShowError){ + protected BaseSubscribe(AbstractView view, boolean isShowError){ this.mView = view; this.isShowError = isShowError; } - protected BaseSubscribe(BaseView view, String errorMsg, boolean isShowError){ + protected BaseSubscribe(AbstractView view, String errorMsg, boolean isShowError){ this.mView = view; this.mErrorMsg = errorMsg; this.isShowError = isShowError; diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml index a053977..8b7662d 100644 --- a/app/src/main/res/layout/activity_login.xml +++ b/app/src/main/res/layout/activity_login.xml @@ -92,31 +92,37 @@ android:layout_marginStart="@dimen/dp_64" android:layout_marginEnd="@dimen/dp_64" /> -